aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/youtube.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2018-12-31 02:52:27 -0800
committerJames Taylor <user234683@users.noreply.github.com>2018-12-31 02:52:27 -0800
commite3fac7da54356c448bd244b578da244b62f44e9e (patch)
treef87f95460fc89e312c76b0636fe65776112eaf12 /youtube/youtube.py
parent005c1239a654ef4f3594c028ae68ddac4fb30676 (diff)
downloadyt-local-e3fac7da54356c448bd244b578da244b62f44e9e.tar.lz
yt-local-e3fac7da54356c448bd244b578da244b62f44e9e.tar.xz
yt-local-e3fac7da54356c448bd244b578da244b62f44e9e.zip
Ability to delete comments
Diffstat (limited to 'youtube/youtube.py')
-rw-r--r--youtube/youtube.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/youtube/youtube.py b/youtube/youtube.py
index 8260faf..c4a0e5b 100644
--- a/youtube/youtube.py
+++ b/youtube/youtube.py
@@ -78,6 +78,18 @@ def youtube(env, start_response):
start_response('200 OK', (('Content-type','text/html'),) )
return accounts.get_account_login_page(query_string=query_string).encode()
+ elif path == "/delete_comment":
+ start_response('200 OK', (('Content-type','text/html'),) )
+ return post_comment.get_delete_comment_page(query_string).encode()
+
+ elif path == "/comment_delete_success":
+ start_response('200 OK', () )
+ return b'Successfully deleted comment'
+
+ elif path == "/comment_delete_fail":
+ start_response('200 OK', () )
+ return b'Failed to deleted comment'
+
else:
start_response('200 OK', (('Content-type','text/html'),) )
return channel.get_channel_page_general_url(path, query_string=query_string).encode()
@@ -116,6 +128,14 @@ def youtube(env, start_response):
start_response('303 See Other', (('Location', common.URL_ORIGIN + '/comments?ctoken=' + comments.make_comment_ctoken(video_id, sort=1)),) )
return ''
+ elif path == "/delete_comment":
+ parameters = urllib.parse.parse_qs(query_string)
+ code = post_comment.delete_comment(parameters, fields)
+ if code == "SUCCESS":
+ start_response('303 See Other', (('Location', common.URL_ORIGIN + '/comment_delete_success'),) )
+ else:
+ start_response('303 See Other', (('Location', common.URL_ORIGIN + '/comment_delete_fail'),) )
+
elif path == "/login":
if 'save' in fields and fields['save'][0] == "on":
save_account = True