aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2020-11-29 15:54:04 -0800
committerJames Taylor <user234683@users.noreply.github.com>2020-11-29 15:54:04 -0800
commit2ac806f9eb4b95fe5038a8057a45e16aa7e597a3 (patch)
tree0d112989ee651764ecbc0263d8223c60b1e0633d
parentac54362f084e8a847b7a437ae6391383a317770b (diff)
downloadyt-local-2ac806f9eb4b95fe5038a8057a45e16aa7e597a3.tar.lz
yt-local-2ac806f9eb4b95fe5038a8057a45e16aa7e597a3.tar.xz
yt-local-2ac806f9eb4b95fe5038a8057a45e16aa7e597a3.zip
video comments: add link to open the comments page separately
for situations where the comments failed to load
-rw-r--r--youtube/comments.py8
1 files changed, 7 insertions, 1 deletions
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