Compare commits

...

2 Commits

Author SHA1 Message Date
dirkf
162a44679f
Merge a250e9974f into e1b3fa242c 2024-07-28 01:29:42 +09:00
dirkf
a250e9974f
Test for valid URL with HEAD
Reverts 4069766c52: originally had HEAD, then changed to GET.
Possibly try HEAD and then GET if bad method? Test cases needed.
2021-09-29 15:26:47 +01:00

View File

@ -59,6 +59,7 @@ from ..utils import (
float_or_none, float_or_none,
GeoRestrictedError, GeoRestrictedError,
GeoUtils, GeoUtils,
HEADRequest,
int_or_none, int_or_none,
join_nonempty, join_nonempty,
js_to_json, js_to_json,
@ -1653,7 +1654,8 @@ class InfoExtractor(object):
if not (url.startswith('http://') or url.startswith('https://')): if not (url.startswith('http://') or url.startswith('https://')):
return True return True
try: try:
self._request_webpage(url, video_id, 'Checking %s URL' % item, headers=headers) req = HEADRequest(url, headers=headers)
self._request_webpage(req, video_id, 'Checking %s URL' % item)
return True return True
except ExtractorError as e: except ExtractorError as e:
self.to_screen( self.to_screen(