diff options
Diffstat (limited to 'youtube/comments.py')
-rw-r--r-- | youtube/comments.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/youtube/comments.py b/youtube/comments.py index 66b5353..a4a4f73 100644 --- a/youtube/comments.py +++ b/youtube/comments.py @@ -125,13 +125,22 @@ def post_process_comments_info(comments_info): comments_info['include_avatars'] = settings.enable_comment_avatars if comments_info['ctoken']: - replies_param = '&replies=1' if comments_info['is_replies'] else '' + ctoken = comments_info['ctoken'] + if comments_info['is_replies']: + replies_param = '&replies=1' + # change max_replies field to 250 in ctoken + new_ctoken, err = proto.set_protobuf_value( + ctoken, + 'base64p', 6, 3, 9, value=250) + if err: + print('Error setting ctoken value:') + print(err) + else: + ctoken = new_ctoken + else: + replies_param = '' comments_info['more_comments_url'] = concat_or_none( - util.URL_ORIGIN, - '/comments?ctoken=', - comments_info['ctoken'], - replies_param - ) + util.URL_ORIGIN, '/comments?ctoken=', ctoken, replies_param) comments_info['page_number'] = page_number = str(int(comments_info['offset']/20) + 1) |