checking headers for filesize was bad idea

This commit is contained in:
bato3 2018-07-27 17:42:48 +02:00
parent 32064a0b72
commit bebcd6691a

View File

@ -2643,14 +2643,10 @@ class InfoExtractor(object):
formats.extend(self._extract_f4m_formats( formats.extend(self._extract_f4m_formats(
source_url, video_id, m3u8_id=m3u8_id, fatal=False)) source_url, video_id, m3u8_id=m3u8_id, fatal=False))
else: else:
urlh = self._request_webpage(source_url, video_id, note='Checking format %d information' % format_id, fatal=False)
size = int(urlh.headers.get('Content-Length'))
formats.append({ formats.append({
'url': source_url, 'url': source_url,
'ext': ext, 'ext': ext,
'format_id': '%d' % format_id, 'format_id': '%d' % format_id,
'filesize': size,
'preference': int(size / 1024 / 1024 / 10),
}) })
if len(formats) == 0: if len(formats) == 0:
raise ExtractorError('Source not found', expected=True, video_id=video_id) raise ExtractorError('Source not found', expected=True, video_id=video_id)