aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/dramafever.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-01-05 01:11:07 +0600
committerSergey M․ <dstftw@gmail.com>2016-01-05 01:11:07 +0600
commit1dcc38b233f33112e00e1ddf0de6eb8ba1ef028e (patch)
treea7cf36eae6acbece37711655380370f17f69140f /youtube_dl/extractor/dramafever.py
parentfff79f1867c5ac50eb7f88201dd3f728996d52a4 (diff)
[dramafever] Improve subtitles extraction (Closes #8136)
Diffstat (limited to 'youtube_dl/extractor/dramafever.py')
-rw-r--r--youtube_dl/extractor/dramafever.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/youtube_dl/extractor/dramafever.py b/youtube_dl/extractor/dramafever.py
index b3b21d65f..0e9e6f7ba 100644
--- a/youtube_dl/extractor/dramafever.py
+++ b/youtube_dl/extractor/dramafever.py
@@ -105,13 +105,16 @@ class DramaFeverIE(DramaFeverBaseIE):
video_id, 'Downloading episode info JSON', fatal=False)
if episode_info:
value = episode_info.get('value')
- if value:
- subfile = value[0].get('subfile') or value[0].get('new_subfile')
- if subfile and subfile != 'http://www.dramafever.com/st/':
- info.setdefault('subtitles', {}).setdefault('English', []).append({
- 'ext': 'srt',
- 'url': subfile,
- })
+ if isinstance(value, list):
+ for v in value:
+ if v.get('type') == 'Episode':
+ subfile = v.get('subfile') or v.get('new_subfile')
+ if subfile and subfile != 'http://www.dramafever.com/st/':
+ info.setdefault('subtitles', {}).setdefault('English', []).append({
+ 'ext': 'srt',
+ 'url': subfile,
+ })
+ break
return info