refactor: use template literal consistently
This commit is contained in:
parent
f635d6c233
commit
f2fb4821e3
3 changed files with 3 additions and 3 deletions
|
|
@ -31,7 +31,7 @@ export class DoodStream implements Extractor {
|
|||
const baseUrl = await this.fetcher.text(ctx, new URL(`http://dood.to${passMd5Match[0]}`));
|
||||
|
||||
return {
|
||||
url: new URL(`${baseUrl + randomstring.generate(10)}?token=${token}&expiry=${Date.now()}`),
|
||||
url: new URL(`${baseUrl}${randomstring.generate(10)}?token=${token}&expiry=${Date.now()}`),
|
||||
label: this.label,
|
||||
sourceId: `${this.id}_${countryCode.toLowerCase()}`,
|
||||
height: 0,
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export class ExtractorRegistry {
|
|||
try {
|
||||
urlResult = await extractor.extract(ctx, url, countryCode);
|
||||
} catch (error) {
|
||||
this.logger.warn(`${extractor.id} error: ` + error, ctx);
|
||||
this.logger.warn(`${extractor.id} error: ${error}`, ctx);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export const extractUrlFromPacked = (html: string, linkRegExps: RegExp[]): URL =
|
|||
for (const linkRegexp of linkRegExps) {
|
||||
const linkMatch = unpacked.match(linkRegexp);
|
||||
if (linkMatch && linkMatch[1]) {
|
||||
return new URL('https://' + linkMatch[1].replace(/^(https:)?\/\//, ''));
|
||||
return new URL(`https://${linkMatch[1].replace(/^(https:)?\/\//, '')}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue