aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/comments.py
diff options
context:
space:
mode:
Diffstat (limited to 'youtube/comments.py')
-rw-r--r--youtube/comments.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/youtube/comments.py b/youtube/comments.py
index 16c90a4..5bfcdbd 100644
--- a/youtube/comments.py
+++ b/youtube/comments.py
@@ -128,10 +128,17 @@ def request_comments(ctoken, replies=False):
print("got <!DOCTYPE>, retrying")
continue
break
- with open('debug/comments_debug', 'wb') as f:
- f.write(content)
+ '''with open('debug/comments_debug', 'wb') as f:
+ f.write(content)'''
return content
+def single_comment_ctoken(video_id, comment_id):
+ page_params = proto.string(2, video_id) + proto.string(6, proto.percent_b64encode(proto.string(15, comment_id)))
+
+ result = proto.nested(2, page_params) + proto.uint(3,6)
+ return base64.urlsafe_b64encode(result).decode('ascii')
+
+
def parse_comments_ajax(content, replies=False):
try:
content = json.loads(uppercase_escape(content.decode('utf-8')))