aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/comments.py
diff options
context:
space:
mode:
authorJames Taylor <28744867+user234683@users.noreply.github.com>2020-10-12 09:37:13 -0700
committerGitHub <noreply@github.com>2020-10-12 09:37:13 -0700
commitfd253d9e07fa34e2a22d28d445839147daca9ee0 (patch)
tree7dfecaadce3cc58ddcc86e2cd9d5ef762563e9ce /youtube/comments.py
parent37d286fc7ce8feec72d9ecf5d238a42c873de1d0 (diff)
parent2cfc6dec39ccdcc0c5fe2eea73f47b7040e51833 (diff)
downloadyt-local-fd253d9e07fa34e2a22d28d445839147daca9ee0.tar.lz
yt-local-fd253d9e07fa34e2a22d28d445839147daca9ee0.tar.xz
yt-local-fd253d9e07fa34e2a22d28d445839147daca9ee0.zip
Merge branch 'master' into optional_proxy_images
Diffstat (limited to 'youtube/comments.py')
-rw-r--r--youtube/comments.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/youtube/comments.py b/youtube/comments.py
index 1d0e92a..a7a93cc 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)
)