mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-18 05:19:59 +00:00
[dramafever] Improve subtitles extraction (Closes #8136)
This commit is contained in:
parent
fff79f1867
commit
1dcc38b233
1 changed files with 10 additions and 7 deletions
|
@ -105,13 +105,16 @@ def _real_extract(self, url):
|
||||||
video_id, 'Downloading episode info JSON', fatal=False)
|
video_id, 'Downloading episode info JSON', fatal=False)
|
||||||
if episode_info:
|
if episode_info:
|
||||||
value = episode_info.get('value')
|
value = episode_info.get('value')
|
||||||
if value:
|
if isinstance(value, list):
|
||||||
subfile = value[0].get('subfile') or value[0].get('new_subfile')
|
for v in value:
|
||||||
if subfile and subfile != 'http://www.dramafever.com/st/':
|
if v.get('type') == 'Episode':
|
||||||
info.setdefault('subtitles', {}).setdefault('English', []).append({
|
subfile = v.get('subfile') or v.get('new_subfile')
|
||||||
'ext': 'srt',
|
if subfile and subfile != 'http://www.dramafever.com/st/':
|
||||||
'url': subfile,
|
info.setdefault('subtitles', {}).setdefault('English', []).append({
|
||||||
})
|
'ext': 'srt',
|
||||||
|
'url': subfile,
|
||||||
|
})
|
||||||
|
break
|
||||||
|
|
||||||
return info
|
return info
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue