diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-11-22 14:56:53 -0800 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-11-22 14:56:53 -0800 |
commit | 79d9a18f815a03498e21dd5769a2e70c7ae7afa5 (patch) | |
tree | 693376dc5e091f94b5348f1fe51063b1ddc1fc82 /youtube/watch.py | |
parent | 70b56d6eef4fd9d6c46c8fbf48dfec3ae7a2937e (diff) | |
download | yt-local-79d9a18f815a03498e21dd5769a2e70c7ae7afa5.tar.lz yt-local-79d9a18f815a03498e21dd5769a2e70c7ae7afa5.tar.xz yt-local-79d9a18f815a03498e21dd5769a2e70c7ae7afa5.zip |
Extraction: return and display any errors preventing video playback
Diffstat (limited to 'youtube/watch.py')
-rw-r--r-- | youtube/watch.py | 3 |
1 files changed, 2 insertions, 1 deletions
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'], ) |