mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-18 06:09:58 +00:00
small fix for instagram reels
- now all reels should be possible to download - also added support for youtube embed links
This commit is contained in:
parent
db5d62ae58
commit
fafd2c8ccc
4 changed files with 19 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "cobalt",
|
"name": "cobalt",
|
||||||
"description": "save what you love",
|
"description": "save what you love",
|
||||||
"version": "6.2.2",
|
"version": "6.2.3",
|
||||||
"author": "wukko",
|
"author": "wukko",
|
||||||
"exports": "./src/cobalt.js",
|
"exports": "./src/cobalt.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
@ -17,6 +17,7 @@ export default async function(obj) {
|
||||||
if (!html.includes('application/ld+json')) return { error: 'ErrorEmptyDownload' };
|
if (!html.includes('application/ld+json')) return { error: 'ErrorEmptyDownload' };
|
||||||
|
|
||||||
let single, multiple = [], postInfo = JSON.parse(html.split('script type="application/ld+json"')[1].split('">')[1].split('</script>')[0]);
|
let single, multiple = [], postInfo = JSON.parse(html.split('script type="application/ld+json"')[1].split('">')[1].split('</script>')[0]);
|
||||||
|
if (Array.isArray(postInfo)) postInfo = postInfo[0];
|
||||||
|
|
||||||
if (postInfo.video.length > 1) {
|
if (postInfo.video.length > 1) {
|
||||||
for (let i in postInfo.video) { multiple.push({type: "video", thumb: postInfo.video[i]["thumbnailUrl"], url: postInfo.video[i]["contentUrl"]}) }
|
for (let i in postInfo.video) { multiple.push({type: "video", thumb: postInfo.video[i]["thumbnailUrl"], url: postInfo.video[i]["contentUrl"]}) }
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
},
|
},
|
||||||
"youtube": {
|
"youtube": {
|
||||||
"alias": "youtube videos & shorts & music",
|
"alias": "youtube videos & shorts & music",
|
||||||
"patterns": ["watch?v=:id"],
|
"patterns": ["watch?v=:id", "embed/:id"],
|
||||||
"bestAudio": "opus",
|
"bestAudio": "opus",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
|
|
|
@ -893,6 +893,22 @@
|
||||||
"code": 400,
|
"code": 400,
|
||||||
"status": "error"
|
"status": "error"
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"name": "post info in an array (for whatever reason??)",
|
||||||
|
"url": "https://www.instagram.com/reel/CrVB9tatUDv/?igshid=blaBlABALALbLABULLSHIT==",
|
||||||
|
"params": {},
|
||||||
|
"expected": {
|
||||||
|
"code": 200,
|
||||||
|
"status": "redirect"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"name": "prone to get rate limited",
|
||||||
|
"url": "https://www.instagram.com/reel/CrO-T7Qo6rq/?igshid=fuckYouNoTrackingIdForYou==",
|
||||||
|
"params": {},
|
||||||
|
"expected": {
|
||||||
|
"code": 200,
|
||||||
|
"status": "redirect"
|
||||||
|
}
|
||||||
}],
|
}],
|
||||||
"vine": [{
|
"vine": [{
|
||||||
"name": "regular vine link (9+10=21)",
|
"name": "regular vine link (9+10=21)",
|
||||||
|
|
Loading…
Reference in a new issue