summaryrefslogtreecommitdiff
path: root/wiki/tmw_deploy.py
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2024-01-21 01:17:10 -0300
committerJesusaves <cpntb1@ymail.com>2024-01-21 01:17:10 -0300
commitb412a5c4dc293c2561c7c38d89e6bbfb20065e96 (patch)
tree7e5fc00881dc5ffbcb46ada368d0e4c7afeb1f03 /wiki/tmw_deploy.py
parenta2ce6f3e5ba608052cac4d635340f26b1b98192a (diff)
downloadtools-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-xwiki/tmw_deploy.py14
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)