]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/youtube.py
[docs] Improvements
[yt-dlp.git] / yt_dlp / extractor / youtube.py
index 4a5d6805e9dbf700f6ad1af91c617099b239d2cc..3ca189e44900440d0e523b209c1769359cd95ed9 100644 (file)
@@ -3336,10 +3336,15 @@ def _extract_formats_and_subtitles(self, streaming_data, video_id, player_url, i
                     if isinstance(e, JSInterpreter.Exception):
                         phantomjs_hint = (f'         Install {self._downloader._format_err("PhantomJS", self._downloader.Styles.EMPHASIS)} '
                                           f'to workaround the issue. {PhantomJSwrapper.INSTALL_HINT}\n')
-                    self.report_warning(
-                        f'nsig extraction failed: You may experience throttling for some formats\n{phantomjs_hint}'
-                        f'         n = {query["n"][0]} ; player = {player_url}', video_id=video_id, only_once=True)
-                    self.write_debug(e, only_once=True)
+                    if player_url:
+                        self.report_warning(
+                            f'nsig extraction failed: You may experience throttling for some formats\n{phantomjs_hint}'
+                            f'         n = {query["n"][0]} ; player = {player_url}', video_id=video_id, only_once=True)
+                        self.write_debug(e, only_once=True)
+                    else:
+                        self.report_warning(
+                            'Cannot decrypt nsig without player_url: You may experience throttling for some formats',
+                            video_id=video_id, only_once=True)
                     throttled = True
 
             if itag: