diff options
author | Jesusaves <cpntb1@ymail.com> | 2024-01-21 01:17:10 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2024-01-21 01:17:10 -0300 |
commit | b412a5c4dc293c2561c7c38d89e6bbfb20065e96 (patch) | |
tree | 7e5fc00881dc5ffbcb46ada368d0e4c7afeb1f03 /wiki/tmw_deploy.py | |
parent | a2ce6f3e5ba608052cac4d635340f26b1b98192a (diff) | |
download | tools-b412a5c4dc293c2561c7c38d89e6bbfb20065e96.tar.gz tools-b412a5c4dc293c2561c7c38d89e6bbfb20065e96.tar.bz2 tools-b412a5c4dc293c2561c7c38d89e6bbfb20065e96.tar.xz tools-b412a5c4dc293c2561c7c38d89e6bbfb20065e96.zip |
Updates for cooked food
Diffstat (limited to 'wiki/tmw_deploy.py')
-rwxr-xr-x | wiki/tmw_deploy.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/wiki/tmw_deploy.py b/wiki/tmw_deploy.py index 2f497d9..fc34904 100755 --- a/wiki/tmw_deploy.py +++ b/wiki/tmw_deploy.py @@ -11,6 +11,7 @@ with open("password.txt") as f: ## Setup (also handles cookies on its own due to Session) url = "https://wiki.themanaworld.org/api.php" S = requests.Session() +S.proxies={'https': "socks5://localhost:2121"} # <- Proxy mandatory #r=S.post("%s?action=edit&format=json" % url) @@ -28,9 +29,16 @@ login["lgtoken"]=token login["format"]="json" ## *Actual* Login -r=S.post("%s" % url, data=login) -assert r.status_code == 200 -assert r.json()['login']['result'] == "Success" +try: + r=S.post("%s" % url, data=login) + assert r.status_code == 200 + assert r.json()['login']['result'] == "Success" +except: + traceback.print_exc() + print(repr(r)) + print(r.text) + print("Also, make sure the IP you have used is allowed.") + exit(1) ## Retrieve CSRF Token r=S.get("%s?action=query&meta=tokens&format=json" % url) |