0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-12-22 06:00:00 +00:00

[extractor/MangoTV] Fix subtitle languages

Closes #4315
This commit is contained in:
pukkandan 2022-07-18 05:02:30 +05:30
parent fbb888a3d5
commit 1765c6039e
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39

View file

@ -137,14 +137,15 @@ def _get_subtitles(self, video_id, domain):
url_sub = sub.get('url')
if not url_sub:
continue
locale = sub.get('captionCountrySimpleName')
locale = sub.get('captionSimpleName') or 'en'
sub = self._download_json(f'{domain}{url_sub}', video_id, fatal=False,
note=f'Download subtitle for locale {sub.get("name")} ({locale})') or {}
sub_url = url_or_none(sub.get('info'))
if not sub_url:
continue
subtitles.setdefault(locale or 'en', []).append({
subtitles.setdefault(locale.lower(), []).append({
'url': sub_url,
'name': sub.get('name'),
'ext': 'srt'
})
return subtitles