from zlib_dl import ZLibSession
import re
url = "https://zlib.li/book/mDJxkg7yO6/%E6%B5%AA%E6%BD%AE%E4%B9%8B%E5%B7%85%E7%AC%AC%E5%9B%9B%E7%89%88.html"
s = ZLibSession(verbose=True, proxy_url="socks5://127.0.0.1:10800")
print("Requesting clean detail URL:", url)
resp = s._request_download(url)
print("FINAL URL:", resp.url)
print("HTML Title:", re.search(r'<title>(.*?)</title>', resp.text).group(1))
match = re.search(r'href="(/dl/[^"]+)"', resp.text)
if match:
    print("DOWNLOAD LINK FOUND:", match.group(1))
else:
    print("NO DOWNLOAD LINK FOUND")
