single comment retrieval function, remove left-over debug writing
This commit is contained in:
parent
e31fd60286
commit
5f4d4e0499
@ -128,10 +128,17 @@ def request_comments(ctoken, replies=False):
|
|||||||
print("got <!DOCTYPE>, retrying")
|
print("got <!DOCTYPE>, retrying")
|
||||||
continue
|
continue
|
||||||
break
|
break
|
||||||
with open('debug/comments_debug', 'wb') as f:
|
'''with open('debug/comments_debug', 'wb') as f:
|
||||||
f.write(content)
|
f.write(content)'''
|
||||||
return 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):
|
def parse_comments_ajax(content, replies=False):
|
||||||
try:
|
try:
|
||||||
content = json.loads(uppercase_escape(content.decode('utf-8')))
|
content = json.loads(uppercase_escape(content.decode('utf-8')))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user