使用python脚本自动化刷新缓存

pull/406/head
hyzaw 2021-08-20 09:07:44 +08:00 committed by GitHub
parent dc58b15913
commit acef2ceab3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 0 deletions

27
refresher.py Normal file
View File

@ -0,0 +1,27 @@
import requests
import time
import hashlib
proxies = {
"http": None,
"https": None,
}
s = requests.session()
url = "https://你的域名/?admin"
t = str(int(time.time()))
temp = t + "你的密码"
s1 = hashlib.sha1(temp.encode("utf-8")).hexdigest()
data = "password1=" + str(s1) + "&timestamp=" + t
r = s.post(url=url, data=data, proxies=proxies)
if "Login Success!" in r.text:
print("登录成功!")
else:
print("登录失败~")
url = "https://你的域名/?RefreshCache"
r = s.get(url)
if "<h1>RefreshCache</h1>" in r.text:
print("刷新成功!")
else:
print("刷新失败~")