1
0
Fork 0
mirror of https://github.com/blackjack4494/yt-dlc.git synced 2024-12-27 02:09:06 +00:00

[dramafever] Streamline code

This commit is contained in:
ping 2015-05-20 15:15:28 +08:00
parent f670ef1c8e
commit 137597b0ea

View file

@ -80,12 +80,11 @@ class DramaFeverIE(InfoExtractor):
def _get_subtitles(self, video_id, consumer_secret): def _get_subtitles(self, video_id, consumer_secret):
def match_episode(ep):
return ep['guid'] == video_id
res = None res = None
info = self._get_episodes( 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'] != '': if len(info) == 1 and info[0]['subfile'] != '':
res = {'en': [{'url': info[0]['subfile'], 'ext': 'srt'}]} res = {'en': [{'url': info[0]['subfile'], 'ext': 'srt'}]}
return res return res