33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
import json
|
|||
|
|
import requests
|
||
|
|
|
||
|
|
AUTH = "Basic 6ZmI5aSn5a6dOmNwMTIzNDU2"
|
||
|
|
API = "https://api1.gongzicp.com/apiv2"
|
||
|
|
headers = {
|
||
|
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/124.0.0.0",
|
||
|
|
"Referer": "https://www.gongzicp.com/",
|
||
|
|
"Origin": "https://www.gongzicp.com",
|
||
|
|
"Authorization": AUTH,
|
||
|
|
"Content-Type": "application/json",
|
||
|
|
}
|
||
|
|
|
||
|
|
def call(path, params):
|
||
|
|
body = {"url": path, "params": params}
|
||
|
|
r = requests.post(API + path, headers=headers, json=params, timeout=30)
|
||
|
|
print("POST path", path, params, r.status_code, r.text[:500])
|
||
|
|
r2 = requests.post(API, headers=headers, json=body, timeout=30)
|
||
|
|
print("POST root wrap", body, r2.status_code, r2.text[:500])
|
||
|
|
|
||
|
|
|
||
|
|
call("/novel/chapterGetList", {"nid": 429598})
|
||
|
|
call("/novel/chapterGetInfo", {"nid": 429598, "cid": "1"})
|
||
|
|
call("/novel/novelInfo", {"nid": 429598})
|
||
|
|
|
||
|
|
# try webapi gateway
|
||
|
|
WEB = "https://www.gongzicp.com/webapi"
|
||
|
|
for body in [
|
||
|
|
{"url": "/novel/chapterGetList", "params": {"nid": 429598}},
|
||
|
|
{"nid": 429598},
|
||
|
|
]:
|
||
|
|
r = requests.post(WEB, headers=headers, json=body, timeout=30)
|
||
|
|
print("webapi", body, r.status_code, r.text[:500])
|