diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-01-05 02:22:12 -0800 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-01-05 02:22:12 -0800 |
commit | a98f94b1ec153a28691cb2d90a757869821465f7 (patch) | |
tree | daff8d77d2f618cbb1fda2f6ab118dbeb2e48326 /youtube/youtube.py | |
parent | 28270a9ce83c4cf53a950de913e3e635c9ac1139 (diff) | |
download | yt-local-a98f94b1ec153a28691cb2d90a757869821465f7.tar.lz yt-local-a98f94b1ec153a28691cb2d90a757869821465f7.tar.xz yt-local-a98f94b1ec153a28691cb2d90a757869821465f7.zip |
WSGI for /post_comment (POST request)
Diffstat (limited to 'youtube/youtube.py')
-rw-r--r-- | youtube/youtube.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/youtube/youtube.py b/youtube/youtube.py index d5a64ab..c00d9c5 100644 --- a/youtube/youtube.py +++ b/youtube/youtube.py @@ -21,6 +21,8 @@ get_handlers = { post_handlers = { 'edit_playlist': local_playlist.edit_playlist, 'login': accounts.add_account, + 'comments': post_comment.post_comment, + 'post_comment': post_comment.post_comment, 'delete_comment': post_comment.delete_comment, } @@ -111,19 +113,6 @@ def youtube(env, start_response): start_response('400 Bad Request', ()) return b'400 Bad Request' - elif path in ("/post_comment", "/comments"): - parameters = urllib.parse.parse_qs(query_string) - post_comment.post_comment(parameters, fields) - if 'parent_id' in parameters: - start_response('303 See Other', (('Location', common.URL_ORIGIN + '/comments?' + query_string),) ) - else: - try: - video_id = fields['video_id'][0] - except KeyError: - video_id = parameters['video_id'][0] - start_response('303 See Other', (('Location', common.URL_ORIGIN + '/comments?ctoken=' + comments.make_comment_ctoken(video_id, sort=1)),) ) - return '' - else: start_response('404 Not Found', ()) return b'404 Not Found' |