[PeerTube] Improve code quality of captions extractor
This commit is contained in:
parent
f224507548
commit
28dea4b638
@ -500,12 +500,10 @@ class PeerTubeIE(InfoExtractor):
|
||||
language_id = try_get(entry, lambda x: x['language']['id'], compat_str)
|
||||
caption_path = str_or_none(entry.get('captionPath'))
|
||||
if language_id and caption_path:
|
||||
caption_url = 'https://%s%s' % (host, caption_path)
|
||||
caption_dict = {
|
||||
'url': caption_url
|
||||
}
|
||||
if subtitles.setdefault(language_id, [caption_dict]) != [caption_dict]:
|
||||
subtitles[language_id].append(caption_dict)
|
||||
caption_url = urljoin('https://%s' % host, entry.get('captionPath'))
|
||||
subtitles.setdefault(language_id, []).append({
|
||||
'url': caption_url,
|
||||
})
|
||||
return subtitles
|
||||
|
||||
def _real_extract(self, url):
|
||||
|
Loading…
x
Reference in New Issue
Block a user