From 137597b0ea88a92d174341b44b8f395b8897a2bf Mon Sep 17 00:00:00 2001 From: ping Date: Wed, 20 May 2015 15:15:28 +0800 Subject: [PATCH] [dramafever] Streamline code --- youtube_dl/extractor/dramafever.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/dramafever.py b/youtube_dl/extractor/dramafever.py index 8fac99cc54..40787ffcd2 100644 --- a/youtube_dl/extractor/dramafever.py +++ b/youtube_dl/extractor/dramafever.py @@ -80,12 +80,11 @@ class DramaFeverIE(InfoExtractor): def _get_subtitles(self, video_id, consumer_secret): - def match_episode(ep): - return ep['guid'] == video_id - res = None info = self._get_episodes( - video_id.split(".")[0], consumer_secret, episode_filter=match_episode) + video_id.split(".")[0], consumer_secret, + episode_filter=lambda x: x['guid'] == video_id) + if len(info) == 1 and info[0]['subfile'] != '': res = {'en': [{'url': info[0]['subfile'], 'ext': 'srt'}]} return res