]> jfr.im git - yt-dlp.git/commitdiff
[tubi] Raise "no video formats" error when video url is empty
authorpukkandan <redacted>
Sat, 24 Apr 2021 12:22:33 +0000 (17:52 +0530)
committerpukkandan <redacted>
Sat, 24 Apr 2021 12:22:33 +0000 (17:52 +0530)
Related: #266

yt_dlp/extractor/tubitv.py

index 6bc3234c6a30dc5fc5fcdb358003d8f2774afe54..4b3ab4088f7108bdcb93a0553c14f654e366fc15 100644 (file)
@@ -81,9 +81,13 @@ def _real_extract(self, url):
             'http://tubitv.com/oz/videos/%s/content' % video_id, video_id)
         title = video_data['title']
 
-        formats = self._extract_m3u8_formats(
-            self._proto_relative_url(video_data['url']),
-            video_id, 'mp4', 'm3u8_native')
+        formats = []
+        url = video_data['url']
+        # URL can be sometimes empty. Does this only happen when there is DRM?
+        if url:
+            formats = self._extract_m3u8_formats(
+                self._proto_relative_url(url),
+                video_id, 'mp4', 'm3u8_native')
         self._sort_formats(formats)
 
         thumbnails = []