From 2ac806f9eb4b95fe5038a8057a45e16aa7e597a3 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Sun, 29 Nov 2020 15:54:04 -0800 Subject: video comments: add link to open the comments page separately for situations where the comments failed to load --- youtube/comments.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'youtube') diff --git a/youtube/comments.py b/youtube/comments.py index feaa912..8dc9d86 100644 --- a/youtube/comments.py +++ b/youtube/comments.py @@ -143,7 +143,13 @@ def video_comments(video_id, sort=0, offset=0, lc='', secret_key=''): other_sort_url = util.URL_ORIGIN + '/comments?ctoken=' + make_comment_ctoken(video_id, sort=1 - sort, lc=lc) other_sort_text = 'Sort by ' + ('newest' if sort == 0 else 'top') - comments_info['comment_links'] = [(other_sort_text, other_sort_url)] + + this_sort_url = (util.URL_ORIGIN + + '/comments?ctoken=' + + make_comment_ctoken(video_id, sort=sort, lc=lc)) + + comments_info['comment_links'] = [(other_sort_text, other_sort_url), + ('Direct link', this_sort_url)] return comments_info -- cgit v1.2.3