diff options
author | James Taylor <28744867+user234683@users.noreply.github.com> | 2020-10-11 18:52:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-11 18:52:34 -0700 |
commit | 2cfc6dec39ccdcc0c5fe2eea73f47b7040e51833 (patch) | |
tree | 7bad2fcf78184195bab8472acace235377ef7eed /youtube/comments.py | |
parent | e182cf82839c7de137b05ba347fed7767d554020 (diff) | |
parent | 643a0e8659b7358bb2c06cc707e36b82b949c912 (diff) | |
download | yt-local-2cfc6dec39ccdcc0c5fe2eea73f47b7040e51833.tar.lz yt-local-2cfc6dec39ccdcc0c5fe2eea73f47b7040e51833.tar.xz yt-local-2cfc6dec39ccdcc0c5fe2eea73f47b7040e51833.zip |
Merge pull request #23 from zrose584/comments_js
add comments.js for comment replies
Diffstat (limited to 'youtube/comments.py')
-rw-r--r-- | youtube/comments.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/youtube/comments.py b/youtube/comments.py index 07d4b89..032ce8a 100644 --- a/youtube/comments.py +++ b/youtube/comments.py @@ -27,7 +27,7 @@ from flask import request def make_comment_ctoken(video_id, sort=0, offset=0, lc='', secret_key=''): video_id = proto.as_bytes(video_id) secret_key = proto.as_bytes(secret_key) - + page_info = proto.string(4,video_id) + proto.uint(6, sort) offset_information = proto.nested(4, page_info) + proto.uint(5, offset) @@ -41,11 +41,11 @@ def make_comment_ctoken(video_id, sort=0, offset=0, lc='', secret_key=''): result = proto.nested(2, page_params) + proto.uint(3,6) + proto.nested(6, offset_information) return base64.urlsafe_b64encode(result).decode('ascii') -def comment_replies_ctoken(video_id, comment_id, max_results=500): +def comment_replies_ctoken(video_id, comment_id, max_results=500): params = proto.string(2, comment_id) + proto.uint(9, max_results) params = proto.nested(3, params) - + result = proto.nested(2, proto.string(2, video_id)) + proto.uint(3,6) + proto.nested(6, params) return base64.urlsafe_b64encode(result).decode('ascii') @@ -187,8 +187,10 @@ def get_comments_page(): 'replying': replies, } + return flask.render_template('comments_page.html', comments_info = comments_info, comment_posting_box_info = comment_posting_box_info, + slim = request.args.get('slim', False) ) |