aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/playlist.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2019-09-18 21:39:53 -0700
committerJames Taylor <user234683@users.noreply.github.com>2019-09-19 11:06:34 -0700
commitdc6c370152d063ad4198c747fc12eb06fc1ec0e4 (patch)
treeaf8fe44dd7440fde043040f2f2485aa31e22a6d9 /youtube/playlist.py
parent89e5761f8d9ae4221c4a97eca3c0fce3405a5bc4 (diff)
downloadyt-local-dc6c370152d063ad4198c747fc12eb06fc1ec0e4.tar.lz
yt-local-dc6c370152d063ad4198c747fc12eb06fc1ec0e4.tar.xz
yt-local-dc6c370152d063ad4198c747fc12eb06fc1ec0e4.zip
Extraction: refactor response extraction to work with both mobile & desktop respones, also improve errors
Diffstat (limited to 'youtube/playlist.py')
-rw-r--r--youtube/playlist.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/youtube/playlist.py b/youtube/playlist.py
index 2f7abdc..bc2c417 100644
--- a/youtube/playlist.py
+++ b/youtube/playlist.py
@@ -91,6 +91,9 @@ def get_playlist_page():
first_page_json, this_page_json = tasks[0].value, tasks[1].value
info = yt_data_extract.extract_playlist_info(this_page_json)
+ if info['error']:
+ return flask.render_template('error.html', error_message = info['error'])
+
if page != '1':
info['metadata'] = yt_data_extract.extract_playlist_metadata(first_page_json)