47 lines
1.4 KiB
Python
47 lines
1.4 KiB
Python
import base64
|
|
import re
|
|
import requests
|
|
|
|
auth = "Basic 6ZmI5aSn5a6dOmNwMTIzNDU2"
|
|
print("auth decode", base64.b64decode("6ZmI5aSn5a6dOmNwMTIzNDU2"))
|
|
|
|
js = requests.get(
|
|
"https://www.gongzicp.com/assets/index.eef719ce.js",
|
|
timeout=90,
|
|
headers={"User-Agent": "Mozilla/5.0"},
|
|
).text
|
|
|
|
# find function Fg or getNovels definition area
|
|
for m in re.finditer(r"getNovels[^}]{0,500}", js):
|
|
s = m.group(0)
|
|
if "apiv2" in s or "novel" in s.lower():
|
|
print(s[:400])
|
|
print("---")
|
|
|
|
# search url patterns with apiv2
|
|
urls = sorted(set(re.findall(r"apiv2/[a-zA-Z0-9_/]+", js)))
|
|
print("apiv2 paths", urls[:50])
|
|
|
|
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,
|
|
}
|
|
tests = [
|
|
"/novel/info?novelid=429598",
|
|
"/novel/info?nid=429598",
|
|
"/novel/info?id=429598",
|
|
"/novel/getInfo?novelid=429598",
|
|
"/novel/chapterList?novelid=429598",
|
|
"/novel/chapterList?nid=429598",
|
|
"/chapter/content?chapterid=1&novelid=429598",
|
|
"/read/chapter?chapter_id=1&novel_id=429598",
|
|
"/searchNovel?keyword=天官&page=1",
|
|
"/novel/searchNovel?keyword=天官",
|
|
]
|
|
for p in tests:
|
|
r = requests.get(API + p, headers=headers, timeout=30)
|
|
print(p, r.status_code, r.text[:500])
|