fix(extractor): do not skip external blocked URLs

This commit is contained in:
WebStreamr 2025-07-18 17:47:28 +00:00
parent f6dcd74dfb
commit 533470d080
No known key found for this signature in database

View file

@ -1,3 +1,4 @@
import { BlockedError } from '../error';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { Fetcher, showExternalUrls } from '../utils';
import { Extractor } from './Extractor';
@ -25,8 +26,11 @@ export class ExternalUrl extends Extractor {
try {
// Make sure the URL is accessible, but avoid causing noise and delays doing this
await this.fetcher.head(ctx, url, { noFlareSolverr: true, timeout: 1000, headers: { Referer: url.origin } });
} catch {
return [];
} catch (error) {
/* istanbul ignore if */
if (!(error instanceof BlockedError)) {
return [];
}
}
return [