aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-03-11 21:56:22 +0600
committerSergey M․ <dstftw@gmail.com>2015-03-11 21:56:22 +0600
commita3fbd188241b6151b024f6e3ea21c0edc60fae09 (patch)
treec52440f0489bcdef8772639226f6a5a90403e41e
parentc6052b8c14db35258b5bb8fcb66b7216615083f5 (diff)
[funnyordie] Simplify subtitles
-rw-r--r--youtube_dl/extractor/funnyordie.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/youtube_dl/extractor/funnyordie.py b/youtube_dl/extractor/funnyordie.py
index 0a22d99d2..dd87257c4 100644
--- a/youtube_dl/extractor/funnyordie.py
+++ b/youtube_dl/extractor/funnyordie.py
@@ -58,14 +58,12 @@ class FunnyOrDieIE(InfoExtractor):
'vbr': bitrate,
})
- subtitles={}
- subtitle_matches=re.findall(r'<track kind="captions" src="([^"]+)" srclang="([^"]+)"', webpage)
- for match in subtitle_matches:
- (suburl,sublang)=match
- if not sublang in subtitles.keys():
- subtitles[sublang]=[]
- subext=suburl.split('/')[-1]
- subtitles[sublang].append({'url': 'http://www.funnyordie.com'+suburl,'ext': subext})
+ subtitles = {}
+ for src, src_lang in re.findall(r'<track kind="captions" src="([^"]+)" srclang="([^"]+)"', webpage):
+ subtitles[src_lang] = [{
+ 'ext': src.split('/')[-1],
+ 'url': 'http://www.funnyordie.com%s' % src,
+ }]
post_json = self._search_regex(
r'fb_post\s*=\s*(\{.*?\});', webpage, 'post details')