From 79d9a18f815a03498e21dd5769a2e70c7ae7afa5 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Fri, 22 Nov 2019 14:56:53 -0800 Subject: Extraction: return and display any errors preventing video playback --- youtube/watch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'youtube/watch.py') diff --git a/youtube/watch.py b/youtube/watch.py index 959dca2..8a396a7 100644 --- a/youtube/watch.py +++ b/youtube/watch.py @@ -123,7 +123,7 @@ decrypt_function_re = re.compile(r'function\(a\)\{(a=a\.split\(""\)[^\}]+)\}') op_with_arg_re = re.compile(r'[^\.]+\.([^\(]+)\(a,(\d+)\)') def decrypt_signatures(info): '''return error string, or False if no errors''' - if not info['formats'] or not info['formats'][0]['s']: + if ('formats' not in info) or (not info['formats']) or (not info['formats'][0]['s']): return False # No decryption needed if not info['base_js']: return 'Failed to find base.js' @@ -356,6 +356,7 @@ def get_watch_page(): uploader = info['author'], description = info['description'], unlisted = info['unlisted'], + playability_error = info['playability_error'], ) -- cgit v1.2.3