init
This commit is contained in:
commit
7177a07538
5 files changed
+159
No files matched your search
+29
@@ -0,0 +1,29 @@
|
||||
import http.client
|
||||
|
||||
import json
|
||||
|
||||
|
||||
def get_data(raw_data=[100, 101]):
|
||||
conn = http.client.HTTPSConnection("www.zhishuyao.com")
|
||||
payload = "type=jyzs"
|
||||
|
||||
for item in raw_data:
|
||||
payload += f"&val[]={item}"
|
||||
|
||||
headers = {
|
||||
"authority": "www.zhishuyao.com",
|
||||
"content-type": "application/x-www-form-urlencoded",
|
||||
"origin": "https://www.zhishuyao.com",
|
||||
}
|
||||
conn.request("POST", "/decode.php", payload, headers)
|
||||
res = conn.getresponse()
|
||||
data = res.read()
|
||||
return json.loads(data.decode("utf-8"))["data"]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raw_data = list(range(0, 1001, 20))
|
||||
|
||||
res = get_data(raw_data)
|
||||
for raw, new in zip(raw_data, res):
|
||||
print(raw, new)
|
||||
Reference in new issue
Block a user