aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/comments.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/comments.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/comments.py')
-rw-r--r--youtube/comments.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/youtube/comments.py b/youtube/comments.py
index ba82154..4485ad2 100644
--- a/youtube/comments.py
+++ b/youtube/comments.py
@@ -83,7 +83,7 @@ def request_comments(ctoken, replies=False):
url = base_url + ctoken.replace("=", "%3D") + "&pbj=1"
for i in range(0,8): # don't retry more than 8 times
- content = util.fetch_url(url, headers=mobile_headers, report_text="Retrieved comments")
+ content = util.fetch_url(url, headers=mobile_headers, report_text="Retrieved comments", debug_name='request_comments')
if content[0:4] == b")]}'": # random closing characters included at beginning of response for some reason
content = content[4:]
elif content[0:10] == b'\n<!DOCTYPE': # occasionally returns html instead of json for no reason
@@ -91,8 +91,6 @@ def request_comments(ctoken, replies=False):
print("got <!DOCTYPE>, retrying")
continue
break
- '''with open('debug/comments_debug', 'wb') as f:
- f.write(content)'''
return content