Browse Source

Improve rate limit detection

pull/8/head
tech234a 3 years ago
parent
commit
aec980b78f
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      export.py
  2. +1
    -1
      tracker.py

+ 2
- 2
export.py View File

@@ -127,10 +127,10 @@ def subprrun(jobs, mysession, langcode, vid, mode):


page = mysession.get("https://www.youtube.com/timedtext_editor", params=pparams) page = mysession.get("https://www.youtube.com/timedtext_editor", params=pparams)


if not "accounts.google.com" in page.url:
if not "accounts.google.com" in page.url and page.status_code != 429:
break break
else: else:
print("[Retrying in 30 seconds] Please supply authentication cookie information in config.json or environment variables. See README.md for more information.")
print("[Retrying in 30 seconds for rate limit or login failure] Please supply authentication cookie information in config.json or environment variables. See README.md for more information.")
sleep(30) sleep(30)
except: except:
print("Error in request, retrying in 5 seconds...") print("Error in request, retrying in 5 seconds...")


+ 1
- 1
tracker.py View File

@@ -9,7 +9,7 @@ from os.path import isfile
from json import loads from json import loads


# https://github.com/ArchiveTeam/tencent-weibo-grab/blob/9bae5f9747e014db9227821a9c11557267967023/pipeline.py # https://github.com/ArchiveTeam/tencent-weibo-grab/blob/9bae5f9747e014db9227821a9c11557267967023/pipeline.py
VERSION = "20200924.01"
VERSION = "20200924.02"


TRACKER_ID = "ext-yt-communitycontribs" TRACKER_ID = "ext-yt-communitycontribs"
TRACKER_HOST = "trackerproxy.meo.ws" TRACKER_HOST = "trackerproxy.meo.ws"


Loading…
Cancel
Save