This commit is contained in:
John Hawkinson 2020-09-27 00:53:26 +02:00 committed by GitHub
commit e43024adec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -2366,9 +2366,12 @@ class GenericIE(InfoExtractor):
self._sort_formats(info_dict['formats'])
return info_dict
# Maybe it's a direct link to a video?
# Be careful not to download the whole thing!
if not is_html(first_bytes):
if re.match(r'^\s+$', first_bytes.decode('utf-8', 'replace')):
self._downloader.report_warning(
'First block is just whitespace? Continuing...')
elif not is_html(first_bytes):
# Maybe it's a direct link to a video?
# Be careful not to download the whole thing!
self._downloader.report_warning(
'URL could be a direct video link, returning it as such.')
info_dict.update({