aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/comments.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2019-01-02 21:42:14 -0800
committerJames Taylor <user234683@users.noreply.github.com>2019-01-02 21:42:14 -0800
commitea0705a98d69343e0b3a81168dee3d68a711550f (patch)
tree8020823f57ce584c4e1b7689ac2ec4187ff65fa7 /youtube/comments.py
parent2550552b28669e60d7a03de02cd5a35469af9816 (diff)
downloadyt-local-ea0705a98d69343e0b3a81168dee3d68a711550f.tar.lz
yt-local-ea0705a98d69343e0b3a81168dee3d68a711550f.tar.xz
yt-local-ea0705a98d69343e0b3a81168dee3d68a711550f.zip
Add permalink to comment on timestamp
Diffstat (limited to 'youtube/comments.py')
-rw-r--r--youtube/comments.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/youtube/comments.py b/youtube/comments.py
index 1d96545..efa1b26 100644
--- a/youtube/comments.py
+++ b/youtube/comments.py
@@ -26,7 +26,9 @@ $avatar
<address>
<a class="author" href="$author_url" title="$author">$author</a>
</address>
- <time datetime="$datetime">$published</time>
+ <a class="permalink" href="$permalink" title="permalink">
+ <time datetime="$datetime">$published</time>
+ </a>
<span class="text">$text</span>
<span class="likes">$likes</span>
@@ -277,6 +279,8 @@ def get_comments_html(comments):
action_buttons = '''<a href="''' + delete_url + '''" target="_blank">Delete</a>'''
else:
action_buttons = ''
+
+ permalink = URL_ORIGIN + '/watch?v=' + comment['video_id'] + '&lc=' + comment['comment_id']
html_result += comment_template.substitute(
author=comment['author'],
author_url = URL_ORIGIN + comment['author_url'],
@@ -287,6 +291,7 @@ def get_comments_html(comments):
datetime = '', #TODO
replies = replies,
action_buttons = action_buttons,
+ permalink = permalink,
)
return html_result