fix(extractor): deal better with cases where video ID URLs end with a slash
This commit is contained in:
parent
6f24b7928d
commit
9f5ac02ec6
3 changed files with 3 additions and 3 deletions
|
|
@ -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}`);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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[]> {
|
||||
|
|
|
|||
Loading…
Reference in a new issue