mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-17 15:25:49 +00:00
[voicerepublic] Fix fallback branch formats extraction
This commit is contained in:
parent
3da8038918
commit
370b39e8ec
@ -47,12 +47,10 @@ def _real_extract(self, url):
|
|||||||
raise ExtractorError(
|
raise ExtractorError(
|
||||||
'Audio is still queued for processing', expected=True)
|
'Audio is still queued for processing', expected=True)
|
||||||
|
|
||||||
data = self._parse_json(
|
config = self._search_regex(
|
||||||
self._search_regex(
|
r'(?s)return ({.+?});\s*\n', webpage,
|
||||||
r'(?s)return ({.+?});\s*\n', webpage,
|
'data', default=None)
|
||||||
'data', default=None),
|
data = self._parse_json(config, display_id, fatal=False) if config else None
|
||||||
display_id, fatal=False)
|
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
title = data['title']
|
title = data['title']
|
||||||
description = data.get('teaser')
|
description = data.get('teaser')
|
||||||
@ -74,12 +72,14 @@ def _real_extract(self, url):
|
|||||||
[r"id='jc-(\d+)'", r"data-shareable-id='(\d+)'"],
|
[r"id='jc-(\d+)'", r"data-shareable-id='(\d+)'"],
|
||||||
webpage, 'talk id', default=None) or display_id
|
webpage, 'talk id', default=None) or display_id
|
||||||
duration = None
|
duration = None
|
||||||
|
player = self._search_regex(
|
||||||
|
r"class='vr-player jp-jplayer'([^>]+)>", webpage, 'player')
|
||||||
formats = [{
|
formats = [{
|
||||||
'url': compat_urlparse.urljoin(url, talk_url),
|
'url': compat_urlparse.urljoin(url, talk_url),
|
||||||
'format_id': format_id,
|
'format_id': format_id,
|
||||||
'ext': determine_ext(talk_url) or format_id,
|
'ext': determine_ext(talk_url) or format_id,
|
||||||
'vcodec': 'none',
|
'vcodec': 'none',
|
||||||
} for format_id, talk_url in re.findall(r"data-([^=]+)='([^']+)'", webpage)]
|
} for format_id, talk_url in re.findall(r"data-([^=]+)='([^']+)'", player)]
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
thumbnail = self._og_search_thumbnail(webpage)
|
thumbnail = self._og_search_thumbnail(webpage)
|
||||||
|
Loading…
Reference in New Issue
Block a user