|
|
@ -1,5 +1,6 @@
|
|
|
|
import base64
|
|
|
|
import base64
|
|
|
|
import collections
|
|
|
|
import collections
|
|
|
|
|
|
|
|
import contextlib
|
|
|
|
import functools
|
|
|
|
import functools
|
|
|
|
import getpass
|
|
|
|
import getpass
|
|
|
|
import http.client
|
|
|
|
import http.client
|
|
|
@ -2129,21 +2130,33 @@ class InfoExtractor:
|
|
|
|
raise ExtractorError(errnote, video_id=video_id)
|
|
|
|
raise ExtractorError(errnote, video_id=video_id)
|
|
|
|
self.report_warning(f'{errnote}{bug_reports_message()}')
|
|
|
|
self.report_warning(f'{errnote}{bug_reports_message()}')
|
|
|
|
return [], {}
|
|
|
|
return [], {}
|
|
|
|
|
|
|
|
if note is None:
|
|
|
|
res = self._download_webpage_handle(
|
|
|
|
note = 'Downloading m3u8 information'
|
|
|
|
m3u8_url, video_id,
|
|
|
|
if errnote is None:
|
|
|
|
note='Downloading m3u8 information' if note is None else note,
|
|
|
|
errnote = 'Failed to download m3u8 information'
|
|
|
|
errnote='Failed to download m3u8 information' if errnote is None else errnote,
|
|
|
|
response = self._request_webpage(
|
|
|
|
|
|
|
|
m3u8_url, video_id, note=note, errnote=errnote,
|
|
|
|
fatal=fatal, data=data, headers=headers, query=query)
|
|
|
|
fatal=fatal, data=data, headers=headers, query=query)
|
|
|
|
|
|
|
|
if response is False:
|
|
|
|
|
|
|
|
return [], {}
|
|
|
|
|
|
|
|
|
|
|
|
if res is False:
|
|
|
|
with contextlib.closing(response):
|
|
|
|
|
|
|
|
prefix = response.read(512)
|
|
|
|
|
|
|
|
if not prefix.startswith(b'#EXTM3U'):
|
|
|
|
|
|
|
|
msg = 'Response data has no m3u header'
|
|
|
|
|
|
|
|
if fatal:
|
|
|
|
|
|
|
|
raise ExtractorError(msg, video_id=video_id)
|
|
|
|
|
|
|
|
self.report_warning(f'{msg}{bug_reports_message()}', video_id=video_id)
|
|
|
|
return [], {}
|
|
|
|
return [], {}
|
|
|
|
|
|
|
|
|
|
|
|
m3u8_doc, urlh = res
|
|
|
|
content = self._webpage_read_content(
|
|
|
|
m3u8_url = urlh.url
|
|
|
|
response, m3u8_url, video_id, note=note, errnote=errnote,
|
|
|
|
|
|
|
|
fatal=fatal, prefix=prefix, data=data)
|
|
|
|
|
|
|
|
if content is False:
|
|
|
|
|
|
|
|
return [], {}
|
|
|
|
|
|
|
|
|
|
|
|
return self._parse_m3u8_formats_and_subtitles(
|
|
|
|
return self._parse_m3u8_formats_and_subtitles(
|
|
|
|
m3u8_doc, m3u8_url, ext=ext, entry_protocol=entry_protocol,
|
|
|
|
content, response.url, ext=ext, entry_protocol=entry_protocol,
|
|
|
|
preference=preference, quality=quality, m3u8_id=m3u8_id,
|
|
|
|
preference=preference, quality=quality, m3u8_id=m3u8_id,
|
|
|
|
note=note, errnote=errnote, fatal=fatal, live=live, data=data,
|
|
|
|
note=note, errnote=errnote, fatal=fatal, live=live, data=data,
|
|
|
|
headers=headers, query=query, video_id=video_id)
|
|
|
|
headers=headers, query=query, video_id=video_id)
|
|
|
|