From cf9d6cfb0ccaf758be7cd21d247e05c0ed5dd839 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sat, 24 Apr 2021 17:52:33 +0530 Subject: [PATCH] [tubi] Raise "no video formats" error when video url is empty Related: #266 --- yt_dlp/extractor/tubitv.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/tubitv.py b/yt_dlp/extractor/tubitv.py index 6bc3234c6..4b3ab4088 100644 --- a/yt_dlp/extractor/tubitv.py +++ b/yt_dlp/extractor/tubitv.py @@ -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 = []