[cleanup] Minor improvements to error and debug messages

This commit is contained in:
pukkandan
2021-11-10 04:19:33 +05:30
parent d54c6003ab
commit aa9369a2d8
5 changed files with 98 additions and 39 deletions

View File

@@ -1864,7 +1864,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
self.write_debug(f'Decrypted nsig {s} => {self._player_cache[sig_id]}')
return self._player_cache[sig_id]
except Exception as e:
raise ExtractorError(traceback.format_exc(), cause=e)
raise ExtractorError(traceback.format_exc(), cause=e, video_id=video_id)
def _extract_n_function_name(self, jscode):
return self._search_regex(
@@ -2496,7 +2496,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
fmt_url = update_url_query(fmt_url, {
'n': self._decrypt_nsig(query['n'][0], video_id, player_url)})
except ExtractorError as e:
self.report_warning(f'nsig extraction failed: You may experience throttling for some formats\n{e}', only_once=True)
self.report_warning(
f'nsig extraction failed: You may experience throttling for some formats\n'
f'n = {query["n"][0]} ; player = {player_url}\n{e}', only_once=True)
throttled = True
if itag: