aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/comments.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2020-10-21 19:58:31 -0700
committerJames Taylor <user234683@users.noreply.github.com>2020-10-21 19:58:31 -0700
commitd3230e8daf6af80f397ec41df2b8a3872b5b9483 (patch)
tree22d1d3abb00a2cdbae1211192cd43915198fa443 /youtube/comments.py
parent8b54a5f3aa376651bf063baa6893fe9b7f0e2ca0 (diff)
downloadyt-local-d3230e8daf6af80f397ec41df2b8a3872b5b9483.tar.lz
yt-local-d3230e8daf6af80f397ec41df2b8a3872b5b9483.tar.xz
yt-local-d3230e8daf6af80f397ec41df2b8a3872b5b9483.zip
Remove commenting system. Because:
- Actually using it will result in comments being shadowbanned, even those posted from Youtube's interfacs, because your account gets downranked since no analytics are present so it looks like a bot posting the comment. - It's been broken for awhile
Diffstat (limited to 'youtube/comments.py')
-rw-r--r--youtube/comments.py25
1 files changed, 3 insertions, 22 deletions
diff --git a/youtube/comments.py b/youtube/comments.py
index b3f1a90..feaa912 100644
--- a/youtube/comments.py
+++ b/youtube/comments.py
@@ -1,4 +1,4 @@
-from youtube import proto, util, yt_data_extract, accounts
+from youtube import proto, util, yt_data_extract
from youtube.util import concat_or_none
from youtube import yt_app
import settings
@@ -97,17 +97,10 @@ def post_process_comments_info(comments_info):
comment['permalink'] = concat_or_none(util.URL_ORIGIN, '/watch?v=',
comments_info['video_id'], '&lc=', comment['id'])
- if comment['author_id'] in accounts.accounts:
- comment['delete_url'] = concat_or_none(util.URL_ORIGIN,
- '/delete_comment?video_id=', comments_info['video_id'],
- '&channel_id=', comment['author_id'],
- '&comment_id=', comment['id'])
reply_count = comment['reply_count']
if reply_count == 0:
- comment['replies_url'] = concat_or_none(util.URL_ORIGIN,
- '/post_comment?parent_id=', comment['id'],
- '&video_id=', comments_info['video_id'])
+ comment['replies_url'] = None
else:
comment['replies_url'] = concat_or_none(util.URL_ORIGIN,
'/comments?parent_id=', comment['id'],
@@ -148,10 +141,9 @@ def video_comments(video_id, sort=0, offset=0, lc='', secret_key=''):
comments_info = yt_data_extract.extract_comments_info(request_comments(make_comment_ctoken(video_id, sort, offset, lc, secret_key)))
post_process_comments_info(comments_info)
- post_comment_url = util.URL_ORIGIN + "/post_comment?video_id=" + video_id
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'] = [('Post comment', post_comment_url), (other_sort_text, other_sort_url)]
+ comments_info['comment_links'] = [(other_sort_text, other_sort_url)]
return comments_info
@@ -178,19 +170,8 @@ def get_comments_page():
other_sort_text = 'Sort by ' + ('newest' if comments_info['sort'] == 0 else 'top')
comments_info['comment_links'] = [(other_sort_text, other_sort_url)]
-
- comment_posting_box_info = {
- 'form_action': '' if replies else util.URL_ORIGIN + '/post_comment',
- 'video_id': comments_info['video_id'],
- 'accounts': accounts.account_list_data(),
- 'include_video_id_input': not replies,
- 'replying': replies,
- }
-
-
return flask.render_template('comments_page.html',
comments_info = comments_info,
- comment_posting_box_info = comment_posting_box_info,
slim = request.args.get('slim', False)
)