refactor: use .at() instead of .slice() construct
This commit is contained in:
parent
5e1c3eea24
commit
22c6754efc
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('/').slice(-1)[0] as string;
|
||||
const videoId = url.pathname.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('/').slice(-1)[0] as string;
|
||||
const videoId = url.pathname.split('/').at(-1) as string;
|
||||
|
||||
return new URL(`/e/${videoId}`, url);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ export class Voe extends Extractor {
|
|||
}
|
||||
|
||||
public override normalize(url: URL): URL {
|
||||
return new URL(`/${url.pathname.split('/').slice(-1)[0]}`, url);
|
||||
return new URL(`/${url.pathname.split('/').at(-1)}`, url);
|
||||
}
|
||||
|
||||
protected async extractInternal(ctx: Context, url: URL, meta: Meta): Promise<UrlResult[]> {
|
||||
|
|
|
|||
Loading…
Reference in a new issue