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 post(path, body): r = requests.post(API + path, headers=headers, json=body, timeout=30) print(path, body, r.status_code, r.text[:600]) post("/novel/novelInfo", {"novelid": 429598}) post("/novel/novelInfo", {"novelId": 429598}) post("/novel/novelInfo", {"nid": 429598}) post("/novel/novelInfo", {"id": 429598}) post("/novel/chapterGetList", {"novelid": 429598}) post("/novel/chapterGetList", {"nid": 429598}) post("/novel/chapterGetInfo", {"novelid": 429598, "chapterid": 1}) post("/novel/chapterGetInfo", {"nid": 429598, "cid": 1}) # search from SearchH5 chunk = requests.get( "https://www.gongzicp.com/assets/SearchH5.1c778303.js", timeout=60, headers={"User-Agent": "Mozilla/5.0"}, ).text import re paths = sorted(set(re.findall(r"/novel/[a-zA-Z]+", chunk))) print("search paths", paths) post("/novel/searchNovel", {"keyword": "天官", "page": 1, "tab": "all"}) post("/novel/searchNovel", {"word": "天官", "module": "all"})