]> jfr.im git - yt-dlp.git/commitdiff
[HotStar] Set language field from tags (#1700)
authorAshish Gupta <redacted>
Thu, 18 Nov 2021 16:00:48 +0000 (21:30 +0530)
committerGitHub <redacted>
Thu, 18 Nov 2021 16:00:48 +0000 (21:30 +0530)
Authored by: Ashish0804

yt_dlp/extractor/hotstar.py

index 12e6c53d493edf70edf2af9978c7adbad89c7b81..0bdf772a19765f43f5c60bf8664e3207e30b3730 100644 (file)
@@ -230,6 +230,11 @@ def _real_extract(self, url):
             if tags and 'encryption:plain' not in tags:
                 for f in current_formats:
                     f['has_drm'] = True
+            if tags and 'language' in tags:
+                lang = re.search(r'language:(?P<lang>[a-z]+)', tags).group('lang')
+                for f in current_formats:
+                    if not f.get('langauge'):
+                        f['language'] = lang
             formats.extend(current_formats)
             subs = self._merge_subtitles(subs, current_subs)
         if not formats and geo_restricted: