diff --git a/README.md b/README.md index f2b7974..ee19ee5 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ A public instance is available at https://webstreamr.hayd.uk. Hosting infrastruc ## Known issues / limitations -- Dropload on Android does not work because Stremio does not use the `Referer` header properly via HLS playlists: https://github.com/Stremio/stremio-bugs/issues/2389, maybe https://github.com/Stremio/stremio-bugs/issues/1579 +- Dropload and SuperVideo on Android do not work because Stremio does not use the `Referer` header properly via HLS playlists: https://github.com/Stremio/stremio-bugs/issues/2389, maybe https://github.com/Stremio/stremio-bugs/issues/1579 - MediaFlow proxy has to be used in an inefficient way because Stremio on Android or its players cannot deal with HLS playlist with redirects: https://github.com/Stremio/stremio-bugs/issues/1574 - FlareSolverr cookies cannot be used because Cloudflare does techniques like TLS fingerprinting most likely. But FlareSolverr uses a session per host and should be quick. - VidSrc works but rate limits heavily and is therefore only queried as fallback if nothing else is found. diff --git a/src/extractor/Dropload.ts b/src/extractor/Dropload.ts index 5a04942..cce9d3e 100644 --- a/src/extractor/Dropload.ts +++ b/src/extractor/Dropload.ts @@ -28,8 +28,7 @@ export class Dropload extends Extractor { } const playlistUrl = extractUrlFromPacked(html, [/sources:\[{file:"(.*?)"/]); - const hostUrlMatch = html.match(/(https:\/\/.+?\/)player/) as string[]; - const playlistHeaders = { Referer: hostUrlMatch[1] as string }; + const playlistHeaders = { Referer: 'https://dr0pstream.com/' }; const heightMatch = html.match(/\d{3,}x(\d{3,}),/); const height = heightMatch diff --git a/src/extractor/SuperVideo.ts b/src/extractor/SuperVideo.ts index c5e905c..52d61e3 100644 --- a/src/extractor/SuperVideo.ts +++ b/src/extractor/SuperVideo.ts @@ -33,20 +33,21 @@ export class SuperVideo extends Extractor { throw new NotFoundError(); } - const m3u8Url = extractUrlFromPacked(html, [/sources:\[{file:"(.*?)"/]); + const playlistUrl = extractUrlFromPacked(html, [/sources:\[{file:"(.*?)"/]); + const playlistHeaders = { Referer: 'https://supervideo.cc/' }; const heightAndSizeMatch = html.match(/\d{3,}x(\d{3,}), ([\d.]+ ?[GM]B)/); const size = heightAndSizeMatch ? bytes.parse(heightAndSizeMatch[2] as string) as number : undefined; const height = heightAndSizeMatch ? parseInt(heightAndSizeMatch[1] as string) - : meta.height ?? await guessHeightFromPlaylist(ctx, this.fetcher, m3u8Url, { headers: { Referer: url.href } }); + : meta.height ?? await guessHeightFromPlaylist(ctx, this.fetcher, playlistUrl, { headers: playlistHeaders }); const $ = cheerio.load(html); const title = $('.download__title').text().trim(); return [ { - url: m3u8Url, + url: playlistUrl, format: Format.hls, meta: { ...meta, @@ -54,6 +55,7 @@ export class SuperVideo extends Extractor { ...(size && { bytes: size }), ...(height && { height }), }, + requestHeaders: playlistHeaders, }, ]; }; diff --git a/src/extractor/__snapshots__/Dropload.test.ts.snap b/src/extractor/__snapshots__/Dropload.test.ts.snap index 5f4ca90..eea4deb 100644 --- a/src/extractor/__snapshots__/Dropload.test.ts.snap +++ b/src/extractor/__snapshots__/Dropload.test.ts.snap @@ -12,7 +12,7 @@ exports[`Dropload download URL 1`] = ` "title": "[~Squid~Game~EnG~]~S03E01~720p~WebRip ~❤️GLD❤️~", }, "requestHeaders": { - "Referer": "https://dropload.io/", + "Referer": "https://dr0pstream.com/", }, "ttl": 10800000, "url": "https://srv29.dropload.io/hls2/01/00305/xhcmgcc2txnv_h/master.m3u8?t=MBKiIoVlA42YcZEixT7ZR1xJA5qKhcKgBi84GPmyT7U&s=1752613129&e=14400&f=1526758&i=0.0&sp=0&ii=130.61.236.204", @@ -31,7 +31,7 @@ exports[`Dropload dropload unknown height and size 1`] = ` "title": "The Lost Bus 2025 1080p WEBRip x265", }, "requestHeaders": { - "Referer": "https://dropload.tv/", + "Referer": "https://dr0pstream.com/", }, "ttl": 10800000, "url": "https://ds16.dropcdn.io/hls2/02/00314/gf2apij3ql37_h/master.m3u8?t=jq0VCV2dOyLIIH07IGIpzruCXvbfdVqzGLWfMeo00AM&s=1759845990&e=14400&f=1571895&srv=ds3&i=0.0&sp=0&ii=2.184.0.222&p1=ds3&p2=ds3", @@ -51,7 +51,7 @@ exports[`Dropload dropload.io 1`] = ` "title": "des-teufels-bad-2024", }, "requestHeaders": { - "Referer": "https://dropload.io/", + "Referer": "https://dr0pstream.com/", }, "ttl": 10800000, "url": "https://srv34.dropload.io/hls2/01/00197/lyo2h1snpe5c_h/master.m3u8?t=ESjD9Le53ttKN2JPyxrhLUqTebDZvx3vcQUlNgP6Vko&s=1749845553&e=14400&f=987607&srv=srv27&i=0.0&sp=0&ii=50.99.15.93&p1=srv27&p2=srv27", diff --git a/src/extractor/__snapshots__/SuperVideo.test.ts.snap b/src/extractor/__snapshots__/SuperVideo.test.ts.snap index 4ac1146..2ffd6e7 100644 --- a/src/extractor/__snapshots__/SuperVideo.test.ts.snap +++ b/src/extractor/__snapshots__/SuperVideo.test.ts.snap @@ -12,6 +12,9 @@ exports[`SuperVideo embed only 1`] = ` "height": 1080, "title": "", }, + "requestHeaders": { + "Referer": "https://supervideo.cc/", + }, "ttl": 10800000, "url": "https://hfs308.serversicuro.cc/hls/,dnzpe7rf5xg4a3gyva3h5orlyw23xosfzwunl5xbmjpz2l6t3doh5zbwynna,.urlset/master.m3u8", }, @@ -31,6 +34,9 @@ exports[`SuperVideo supervideo.cc /e/ 1`] = ` "height": 720, "title": "des-teufels-bad-2024", }, + "requestHeaders": { + "Referer": "https://supervideo.cc/", + }, "ttl": 10800000, "url": "https://hfs309.serversicuro.cc/hls/,dnzpfi3d27g4a3gyvbmh5klwtl65qh654hyjtgupd6p577fze64cp3rsmdyq,.urlset/master.m3u8", }, @@ -48,6 +54,9 @@ exports[`SuperVideo supervideo.tv /embed-/ 1`] = ` "height": 344, "title": "Babylon 5 2x3", }, + "requestHeaders": { + "Referer": "https://supervideo.cc/", + }, "ttl": 10800000, "url": "https://hfs307.serversicuro.cc/hls/,dnzpaalv5xg4a3gyvavh52jryoft7o5cd5nm7cwtnu74kmc4ohiklh5qwq4q,.urlset/master.m3u8", }, diff --git a/src/utils/__snapshots__/StreamResolver.test.ts.snap b/src/utils/__snapshots__/StreamResolver.test.ts.snap index 0ec3c5c..dd3d42b 100644 --- a/src/utils/__snapshots__/StreamResolver.test.ts.snap +++ b/src/utils/__snapshots__/StreamResolver.test.ts.snap @@ -236,7 +236,7 @@ exports[`resolve returns sorted results 1`] = ` "notWebReady": true, "proxyHeaders": { "request": { - "Referer": "https://dropload.io/", + "Referer": "https://dr0pstream.com/", }, }, "videoSize": 1395864371, @@ -252,7 +252,7 @@ exports[`resolve returns sorted results 1`] = ` "notWebReady": true, "proxyHeaders": { "request": { - "Referer": "https://dropload.io/", + "Referer": "https://dr0pstream.com/", }, }, "videoSize": 1181116006, @@ -266,6 +266,11 @@ exports[`resolve returns sorted results 1`] = ` "behaviorHints": { "bingeGroup": "webstreamr-mostraguarda-supervideo-it", "notWebReady": true, + "proxyHeaders": { + "request": { + "Referer": "https://supervideo.cc/", + }, + }, "videoSize": 1181116006, }, "name": "WebStreamr 🇮🇹 720p", @@ -277,6 +282,11 @@ exports[`resolve returns sorted results 1`] = ` "behaviorHints": { "bingeGroup": "webstreamr-meinecloud-supervideo-de", "notWebReady": true, + "proxyHeaders": { + "request": { + "Referer": "https://supervideo.cc/", + }, + }, "videoSize": 1073741824, }, "name": "WebStreamr 🇩🇪 720p", @@ -295,7 +305,7 @@ exports[`resolve returns sorted results 2`] = ` "notWebReady": true, "proxyHeaders": { "request": { - "Referer": "https://dropload.io/", + "Referer": "https://dr0pstream.com/", }, }, "videoSize": 1395864371, @@ -311,7 +321,7 @@ exports[`resolve returns sorted results 2`] = ` "notWebReady": true, "proxyHeaders": { "request": { - "Referer": "https://dropload.io/", + "Referer": "https://dr0pstream.com/", }, }, "videoSize": 1181116006, @@ -325,6 +335,11 @@ exports[`resolve returns sorted results 2`] = ` "behaviorHints": { "bingeGroup": "webstreamr-mostraguarda-supervideo-it", "notWebReady": true, + "proxyHeaders": { + "request": { + "Referer": "https://supervideo.cc/", + }, + }, "videoSize": 1181116006, }, "name": "WebStreamr 🇮🇹 720p", @@ -336,6 +351,11 @@ exports[`resolve returns sorted results 2`] = ` "behaviorHints": { "bingeGroup": "webstreamr-meinecloud-supervideo-de", "notWebReady": true, + "proxyHeaders": { + "request": { + "Referer": "https://supervideo.cc/", + }, + }, "videoSize": 1073741824, }, "name": "WebStreamr 🇩🇪 720p",