aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2018-08-06 20:28:41 -0700
committerJames Taylor <user234683@users.noreply.github.com>2018-08-06 20:28:41 -0700
commit0f1cc4309768788c639249c8bf4028f1b231e5a5 (patch)
tree73d41f5eec74a380d3adf9cd8a6f56a0702026c2
parentb02b5b87b3bae22a9c2667c5b1652ddd7e5afbcb (diff)
downloadyt-local-0f1cc4309768788c639249c8bf4028f1b231e5a5.tar.lz
yt-local-0f1cc4309768788c639249c8bf4028f1b231e5a5.tar.xz
yt-local-0f1cc4309768788c639249c8bf4028f1b231e5a5.zip
fix shelves breaking channel videos page
-rw-r--r--youtube/channel.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube/channel.py b/youtube/channel.py
index 5751b95..9165b15 100644
--- a/youtube/channel.py
+++ b/youtube/channel.py
@@ -64,8 +64,10 @@ def channel_ctoken(channel_id, page, sort, tab, view=1):
tab = proto.string(2, tab )
sort = proto.uint(3, int(sort))
page = proto.string(15, str(page) )
+ # example with shelves in videos tab: https://www.youtube.com/channel/UCNL1ZadSjHpjm4q9j2sVtOA/videos
+ shelf_view = proto.uint(4, 0)
view = proto.uint(6, int(view))
- continuation_info = proto.string( 3, proto.percent_b64encode(tab + view + sort + page) )
+ continuation_info = proto.string( 3, proto.percent_b64encode(tab + view + sort + shelf_view + page) )
channel_id = proto.string(2, channel_id )
pointless_nest = proto.string(80226972, channel_id + continuation_info)
@@ -360,7 +362,7 @@ def get_user_page(url, query_string=''):
except IndexError:
page = 'videos'
if page == 'videos':
- polymer_json = common.fetch_url('https://www.youtube.com/user/' + username + '/videos?pbj=1', headers_1)
+ polymer_json = common.fetch_url('https://www.youtube.com/user/' + username + '/videos?pbj=1&view=0', headers_1)
polymer_json = json.loads(polymer_json)
return channel_videos_html(polymer_json)
elif page == 'about':