mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-03 08:19:57 +01:00
[funnyordie] Simplify subtitles
This commit is contained in:
parent
c6052b8c14
commit
a3fbd18824
@ -59,13 +59,11 @@ def _real_extract(self, url):
|
||||
})
|
||||
|
||||
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})
|
||||
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')
|
||||
|
Loading…
Reference in New Issue
Block a user