[PeerTube] Refactor subtitles extractor
This commit is contained in:
parent
3d3b91554a
commit
37a15bc93b
@ -498,14 +498,11 @@ class PeerTubeIE(InfoExtractor):
|
|||||||
caption_path = str_or_none(entry.get('captionPath'))
|
caption_path = str_or_none(entry.get('captionPath'))
|
||||||
if language_id and caption_path:
|
if language_id and caption_path:
|
||||||
caption_url = 'https://%s%s' % (host, caption_path)
|
caption_url = 'https://%s%s' % (host, caption_path)
|
||||||
if language_id in subtitles:
|
caption_dict = {
|
||||||
subtitles[language_id].append({
|
|
||||||
'url': caption_url
|
'url': caption_url
|
||||||
})
|
}
|
||||||
else:
|
if subtitles.setdefault(language_id, [caption_dict]) != [caption_dict]:
|
||||||
subtitles[language_id] = [{
|
subtitles[language_id].append(caption_dict)
|
||||||
'url': caption_url
|
|
||||||
}]
|
|
||||||
return subtitles
|
return subtitles
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user