1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-01-23 14:57:51 +08:00

skip_http_head flag added

This commit is contained in:
Barak Tawily 2018-11-06 17:17:52 +02:00 committed by GitHub
parent 6c5c0bac3b
commit 626fcaa22a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2226,13 +2226,15 @@ class GenericIE(InfoExtractor):
else:
video_id = self._generic_id(url)
self.to_screen('%s: Requesting header' % video_id)
head_req = HEADRequest(url)
head_response = self._request_webpage(
head_req, video_id,
note=False, errnote='Could not send HEAD request to %s' % url,
fatal=False)
if self._downloader.params.get('skip_http_head') == None:
head_response = False
else:
self.to_screen('%s: Requesting header' % video_id)
head_req = HEADRequest(url)
head_response = self._request_webpage(
head_req, video_id,
note=False, errnote='Could not send HEAD request to %s' % url,
fatal=False)
if head_response is not False:
# Check for redirect