mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-01 17:23:48 +01:00
[dramafever] Streamline code
This commit is contained in:
parent
f670ef1c8e
commit
137597b0ea
@ -80,12 +80,11 @@ def _get_episodes(self, series_id, consumer_secret, episode_filter=None):
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user