diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-08-14 18:39:39 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-08-14 18:39:39 -0700 |
commit | 046d7226eaa3087159e64310bfa1b5e359cd2e93 (patch) | |
tree | 3df552f68bf843676d4ecafe8e9e7a59ed6f1a07 /youtube/channel.py | |
parent | e2c9081aee4730a36228998354d6568f1c206df9 (diff) | |
download | yt-local-046d7226eaa3087159e64310bfa1b5e359cd2e93.tar.lz yt-local-046d7226eaa3087159e64310bfa1b5e359cd2e93.tar.xz yt-local-046d7226eaa3087159e64310bfa1b5e359cd2e93.zip |
Subscriptions: improve checking messages, say how many new vids from channel
Diffstat (limited to 'youtube/channel.py')
-rw-r--r-- | youtube/channel.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/youtube/channel.py b/youtube/channel.py index 9d0532a..de75eaa 100644 --- a/youtube/channel.py +++ b/youtube/channel.py @@ -83,13 +83,15 @@ def channel_ctoken(channel_id, page, sort, tab, view=1): return base64.urlsafe_b64encode(pointless_nest).decode('ascii') -def get_channel_tab(channel_id, page="1", sort=3, tab='videos', view=1): +def get_channel_tab(channel_id, page="1", sort=3, tab='videos', view=1, print_status=True): ctoken = channel_ctoken(channel_id, page, sort, tab, view).replace('=', '%3D') url = "https://www.youtube.com/browse_ajax?ctoken=" + ctoken - print("Sending channel tab ajax request") + if print_status: + print("Sending channel tab ajax request") content = util.fetch_url(url, util.desktop_ua + headers_1, debug_name='channel_tab') - print("Finished recieving channel tab response") + if print_status: + print("Finished recieving channel tab response") return content |