]> jfr.im git - yt-dlp.git/commitdiff
[ie/hotstar] Make metadata extraction non-fatal
authorbashonly <redacted>
Thu, 31 Aug 2023 20:45:11 +0000 (15:45 -0500)
committerbashonly <redacted>
Thu, 31 Aug 2023 20:45:11 +0000 (15:45 -0500)
Authored by: bashonly

yt_dlp/extractor/hotstar.py

index cdd93794161c5ff0e873e4c799eda7bcb1f2e290..6cadfb5b7d9e2cd206fe1eefc571e0c71f940b35 100644 (file)
@@ -200,8 +200,10 @@ def _real_extract(self, url):
         video_type = self._TYPE.get(video_type, video_type)
         cookies = self._get_cookies(url)  # Cookies before any request
 
-        video_data = self._call_api_v1(f'{video_type}/detail', video_id,
-                                       query={'tas': 10000, 'contentId': video_id})['body']['results']['item']
+        video_data = traverse_obj(
+            self._call_api_v1(
+                f'{video_type}/detail', video_id, fatal=False, query={'tas': 10000, 'contentId': video_id}),
+            ('body', 'results', 'item', {dict})) or {}
         if not self.get_param('allow_unplayable_formats') and video_data.get('drmProtected'):
             self.report_drm(video_id)