aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/post_comment.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2019-07-23 23:53:04 -0700
committerJames Taylor <user234683@users.noreply.github.com>2019-07-23 23:57:45 -0700
commite00c3cf99f06e6f0c097e019219760cf26d16cbe (patch)
tree3d722ffaf11760d811e8d4f26106d045d0c63126 /youtube/post_comment.py
parentcb1c899a4570e8644dad572c7f00a3d96c844a2f (diff)
downloadyt-local-e00c3cf99f06e6f0c097e019219760cf26d16cbe.tar.lz
yt-local-e00c3cf99f06e6f0c097e019219760cf26d16cbe.tar.xz
yt-local-e00c3cf99f06e6f0c097e019219760cf26d16cbe.zip
Remove ad-hoc response saving from code, create a debug setting for fetch_url
Diffstat (limited to 'youtube/post_comment.py')
-rw-r--r--youtube/post_comment.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/youtube/post_comment.py b/youtube/post_comment.py
index c4ffb9d..25d0e3a 100644
--- a/youtube/post_comment.py
+++ b/youtube/post_comment.py
@@ -35,13 +35,11 @@ def _post_comment(text, video_id, session_token, cookiejar):
data = urllib.parse.urlencode(data_dict).encode()
- content = util.fetch_url("https://m.youtube.com/service_ajax?name=createCommentEndpoint", headers=headers, data=data, cookiejar_send=cookiejar)
+ content = util.fetch_url("https://m.youtube.com/service_ajax?name=createCommentEndpoint", headers=headers, data=data, cookiejar_send=cookiejar, debug_name='post_comment')
code = json.loads(content)['code']
print("Comment posting code: " + code)
return code
- '''with open('debug/post_comment_response', 'wb') as f:
- f.write(content)'''
def _post_comment_reply(text, video_id, parent_comment_id, session_token, cookiejar):
@@ -66,13 +64,11 @@ def _post_comment_reply(text, video_id, parent_comment_id, session_token, cookie
}
data = urllib.parse.urlencode(data_dict).encode()
- content = util.fetch_url("https://m.youtube.com/service_ajax?name=createCommentReplyEndpoint", headers=headers, data=data, cookiejar_send=cookiejar)
+ content = util.fetch_url("https://m.youtube.com/service_ajax?name=createCommentReplyEndpoint", headers=headers, data=data, cookiejar_send=cookiejar, debug_name='post_reply')
code = json.loads(content)['code']
print("Comment posting code: " + code)
return code
- '''with open('debug/post_comment_response', 'wb') as f:
- f.write(content)'''
def _delete_comment(video_id, comment_id, author_id, session_token, cookiejar):
headers = {