0
0
Fork 0

[funnyordie] Simplify subtitles

main
Sergey M․ 2015-03-11 21:56:22 +06:00
parent c6052b8c14
commit a3fbd18824
1 changed files with 6 additions and 8 deletions

View File

@ -58,14 +58,12 @@ class FunnyOrDieIE(InfoExtractor):
'vbr': bitrate, 'vbr': bitrate,
}) })
subtitles={} subtitles = {}
subtitle_matches=re.findall(r'<track kind="captions" src="([^"]+)" srclang="([^"]+)"', webpage) for src, src_lang in re.findall(r'<track kind="captions" src="([^"]+)" srclang="([^"]+)"', webpage):
for match in subtitle_matches: subtitles[src_lang] = [{
(suburl,sublang)=match 'ext': src.split('/')[-1],
if not sublang in subtitles.keys(): 'url': 'http://www.funnyordie.com%s' % src,
subtitles[sublang]=[] }]
subext=suburl.split('/')[-1]
subtitles[sublang].append({'url': 'http://www.funnyordie.com'+suburl,'ext': subext})
post_json = self._search_regex( post_json = self._search_regex(
r'fb_post\s*=\s*(\{.*?\});', webpage, 'post details') r'fb_post\s*=\s*(\{.*?\});', webpage, 'post details')