mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-12-22 20:20:09 +09:00
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.
This commit is contained in:
parent
a803582717
commit
a250e9974f
@ -53,6 +53,7 @@ from ..utils import (
|
||||
float_or_none,
|
||||
GeoRestrictedError,
|
||||
GeoUtils,
|
||||
HEADRequest,
|
||||
int_or_none,
|
||||
js_to_json,
|
||||
JSON_LD_RE,
|
||||
@ -1469,7 +1470,8 @@ class InfoExtractor(object):
|
||||
if not (url.startswith('http://') or url.startswith('https://')):
|
||||
return True
|
||||
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
|
||||
except ExtractorError as e:
|
||||
self.to_screen(
|
||||
|
Loading…
Reference in New Issue
Block a user