refactor: use template literal consistently

This commit is contained in:
WebStreamr 2025-05-17 21:10:40 +02:00
parent f635d6c233
commit f2fb4821e3
No known key found for this signature in database
3 changed files with 3 additions and 3 deletions

View file

@ -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,

View file

@ -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;
}

View file

@ -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:)?\/\//, '')}`);
}
}