]> jfr.im git - yt-dlp.git/commitdiff
[lbry] Fix `--ignore-no-formats-error`
authorpukkandan <redacted>
Fri, 4 Mar 2022 13:48:21 +0000 (19:18 +0530)
committerpukkandan <redacted>
Fri, 4 Mar 2022 13:54:52 +0000 (19:24 +0530)
Closes #2942

yt_dlp/extractor/lbry.py

index 1405ce0c724a4958f9d840c21e166f38653230d7..5d5457c53234f03dbe98f07c88dd1febdd483739 100644 (file)
@@ -17,6 +17,7 @@
     parse_qs,
     OnDemandPagedList,
     try_get,
+    UnsupportedError,
     urljoin,
 )
 
@@ -196,11 +197,11 @@ def _real_extract(self, url):
             live_data = self._download_json(
                 f'https://api.live.odysee.com/v1/odysee/live/{claim_id}', claim_id,
                 note='Downloading livestream JSON metadata')['data']
-            if not live_data['live']:
-                raise ExtractorError('This stream is not live', expected=True)
-            streaming_url = final_url = live_data['url']
+            streaming_url = final_url = live_data.get('url')
+            if not final_url and not live_data.get('live'):
+                self.raise_no_formats('This stream is not live', True, claim_id)
         else:
-            raise ExtractorError('Unsupported URL', expected=True)
+            raise UnsupportedError(url)
 
         info = self._parse_stream(result, url)
         if determine_ext(final_url) == 'm3u8':