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:
wukko 2023-07-04 17:57:58 +06:00
parent db5d62ae58
commit fafd2c8ccc
4 changed files with 19 additions and 2 deletions

View file

@ -1,7 +1,7 @@
{
"name": "cobalt",
"description": "save what you love",
"version": "6.2.2",
"version": "6.2.3",
"author": "wukko",
"exports": "./src/cobalt.js",
"type": "module",

View file

@ -17,6 +17,7 @@ export default async function(obj) {
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]);
if (Array.isArray(postInfo)) postInfo = postInfo[0];
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"]}) }

View file

@ -23,7 +23,7 @@
},
"youtube": {
"alias": "youtube videos & shorts & music",
"patterns": ["watch?v=:id"],
"patterns": ["watch?v=:id", "embed/:id"],
"bestAudio": "opus",
"enabled": true
},

View file

@ -893,6 +893,22 @@
"code": 400,
"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": [{
"name": "regular vine link (9+10=21)",