aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/youtube.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2018-08-29 00:33:28 -0700
committerJames Taylor <user234683@users.noreply.github.com>2018-08-29 00:33:28 -0700
commitfee24d4f0a3ddcf877facfa9b22d470bee37ee79 (patch)
tree6c2084feca5596ec2bc239bbdca2d35c6066364b /youtube/youtube.py
parent6a6433619f82652d7943e29579fe6cf1bbf0cc11 (diff)
downloadyt-local-fee24d4f0a3ddcf877facfa9b22d470bee37ee79.tar.lz
yt-local-fee24d4f0a3ddcf877facfa9b22d470bee37ee79.tar.xz
yt-local-fee24d4f0a3ddcf877facfa9b22d470bee37ee79.zip
Ability to post comments (not reply yet)
Diffstat (limited to 'youtube/youtube.py')
-rw-r--r--youtube/youtube.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/youtube/youtube.py b/youtube/youtube.py
index 446de0d..3c31fa4 100644
--- a/youtube/youtube.py
+++ b/youtube/youtube.py
@@ -1,6 +1,6 @@
import mimetypes
import urllib.parse
-from youtube import local_playlist, watch, search, playlist, channel, comments, common
+from youtube import local_playlist, watch, search, playlist, channel, comments, common, account_functions
YOUTUBE_FILES = (
"/shared.css",
"/opensearch.xml",
@@ -52,6 +52,9 @@ def youtube(env, start_response):
result = common.fetch_url('https://www.youtube.com' + path + ('?' + query_string if query_string else ''))
result = result.replace(b"align:start position:0%", b"")
return result
+ elif path == "/post_comment":
+ start_response('200 OK', () )
+ return account_functions.get_post_comment_page(query_string).encode()
else:
start_response('404 Not Found', () )
return b'404 Not Found'
@@ -77,6 +80,10 @@ def youtube(env, start_response):
else:
start_response('400 Bad Request', ())
return b'400 Bad Request'
+ elif path == "/post_comment":
+ start_response('200 OK', () )
+ return account_functions.post_comment(query_string, fields).encode()
+
else:
start_response('404 Not Found', ())
return b'404 Not Found'