[extractor/youtube] Fix bug in b7c47b7438
Closes #3997 Authored by: coletdjnz
This commit is contained in:
parent
dec30912a7
commit
65141660ab
1 changed files with 2 additions and 7 deletions
|
@ -475,13 +475,8 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
||||||
data=json.dumps(data).encode('utf8'), headers=real_headers,
|
data=json.dumps(data).encode('utf8'), headers=real_headers,
|
||||||
query={'key': api_key or self._extract_api_key(), 'prettyPrint': 'false'})
|
query={'key': api_key or self._extract_api_key(), 'prettyPrint': 'false'})
|
||||||
|
|
||||||
def extract_yt_initial_data(self, item_id, webpage):
|
def extract_yt_initial_data(self, item_id, webpage, fatal=True):
|
||||||
return self._search_json(self._YT_INITIAL_DATA_RE, webpage, 'yt initial data', item_id, fatal=True)
|
return self._search_json(self._YT_INITIAL_DATA_RE, webpage, 'yt initial data', item_id, fatal=fatal)
|
||||||
|
|
||||||
def _extract_yt_initial_variable(self, webpage, regex, video_id, name):
|
|
||||||
return self._parse_json(self._search_regex(
|
|
||||||
(fr'{regex}\s*{self._YT_INITIAL_BOUNDARY_RE}',
|
|
||||||
regex), webpage, name, default='{}'), video_id, fatal=False, lenient=True)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _extract_session_index(*data):
|
def _extract_session_index(*data):
|
||||||
|
|
Loading…
Reference in a new issue