fix(extractor): deal better with cases where video ID URLs end with a slash

This commit is contained in:
WebStreamr 2025-12-22 13:32:33 +00:00
parent 6f24b7928d
commit 9f5ac02ec6
No known key found for this signature in database
3 changed files with 3 additions and 3 deletions

View file

@ -18,7 +18,7 @@ export class DoodStream extends Extractor {
};
public override normalize(url: URL): URL {
const videoId = url.pathname.split('/').at(-1) as string;
const videoId = url.pathname.replace(/\/+$/, '').split('/').at(-1) as string;
return new URL(`http://dood.to/e/${videoId}`);
};

View file

@ -29,7 +29,7 @@ export class LuluStream extends Extractor {
}
public override normalize(url: URL): URL {
const videoId = url.pathname.split('/').at(-1) as string;
const videoId = url.pathname.replace(/\/+$/, '').split('/').at(-1) as string;
return new URL(`/e/${videoId}`, url);
}

View file

@ -119,7 +119,7 @@ export class Voe extends Extractor {
}
public override normalize(url: URL): URL {
return new URL(`/${url.pathname.split('/').at(-1)}`, url);
return new URL(`/${url.pathname.replace(/\/+$/, '').split('/').at(-1)}`, url);
}
protected async extractInternal(ctx: Context, url: URL, meta: Meta): Promise<UrlResult[]> {