mirror of
https://github.com/sussy-code/providers.git
synced 2026-04-21 08:31:57 +00:00
fix url validation for base64 encoded playlists, we should skip for these kinda playlists it but im keeping it in for now
This commit is contained in:
parent
964cddcae5
commit
3e0040b58a
1 changed files with 5 additions and 1 deletions
|
|
@ -15,7 +15,11 @@ export function makeFullUrl(url: string, ops?: FullUrlOptions): string {
|
||||||
if (rightSide.startsWith('/')) rightSide = rightSide.slice(1);
|
if (rightSide.startsWith('/')) rightSide = rightSide.slice(1);
|
||||||
|
|
||||||
const fullUrl = leftSide + rightSide;
|
const fullUrl = leftSide + rightSide;
|
||||||
if (!fullUrl.startsWith('http://') && !fullUrl.startsWith('https://'))
|
|
||||||
|
// we need the data scheme for base64 encoded hls playlists
|
||||||
|
// this is for playlists that themselves have cors but not their parts
|
||||||
|
// this allows us to proxy them, encode them into base64 and then fetch the parts normally
|
||||||
|
if (!fullUrl.startsWith('http://') && !fullUrl.startsWith('https://') && !fullUrl.startsWith('data:'))
|
||||||
throw new Error(`Invald URL -- URL doesn't start with a http scheme: '${fullUrl}'`);
|
throw new Error(`Invald URL -- URL doesn't start with a http scheme: '${fullUrl}'`);
|
||||||
|
|
||||||
const parsedUrl = new URL(fullUrl);
|
const parsedUrl = new URL(fullUrl);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue