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

@ -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
},