diff options
author | James Taylor <user234683@users.noreply.github.com> | 2021-08-07 17:05:58 -0700 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-08-09 12:10:42 -0500 |
commit | 3dee7ea0d1156642d02f504b9229676b287ddf0a (patch) | |
tree | 76770d1aacfac266613ed32b18bee8329d413d71 /youtube/util.py | |
parent | bee14ea9ea2a3e78f70b1a68c965d15297a6ede8 (diff) | |
download | yt-local-3dee7ea0d1156642d02f504b9229676b287ddf0a.tar.lz yt-local-3dee7ea0d1156642d02f504b9229676b287ddf0a.tar.xz yt-local-3dee7ea0d1156642d02f504b9229676b287ddf0a.zip |
Switch to new comments api now that old one is being disabled
watch_comment api periodically gives the error "Top level
comments mweb servlet is turned down."
The continuation items for the new api are in a different
arrangement in the json, so changes were necessary to the
extract_items function.
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'youtube/util.py')
-rw-r--r-- | youtube/util.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/youtube/util.py b/youtube/util.py index daec2df..462d371 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -387,6 +387,19 @@ mobile_user_agent = 'Mozilla/5.0 (Linux; Android 7.0; Redmi Note 4 Build/NRD90M) mobile_ua = (('User-Agent', mobile_user_agent),) desktop_user_agent = 'Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0' desktop_ua = (('User-Agent', desktop_user_agent),) +json_header = (('Content-Type', 'application/json'),) +desktop_xhr_headers = ( + ('Accept', '*/*'), + ('Accept-Language', 'en-US,en;q=0.5'), + ('X-YouTube-Client-Name', '1'), + ('X-YouTube-Client-Version', '2.20180830'), +) + desktop_ua +mobile_xhr_headers = ( + ('Accept', '*/*'), + ('Accept-Language', 'en-US,en;q=0.5'), + ('X-YouTube-Client-Name', '2'), + ('X-YouTube-Client-Version', '2.20180830'), +) + mobile_ua class RateLimitedQueue(gevent.queue.Queue): |