From b5f1f859ea26a8ded1c5c36c0fea3a99a626f240 Mon Sep 17 00:00:00 2001 From: JoeamAmier Date: Sat, 19 Aug 2023 13:02:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/Html.py | 2 +- source/Image.py | 4 ++-- source/Params.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/Html.py b/source/Html.py index cca66ae..e2aa558 100644 --- a/source/Html.py +++ b/source/Html.py @@ -4,7 +4,7 @@ from .Params import HEADERS def get_html( - url, + url: str, cookie=None, params=None, proxies=None, diff --git a/source/Image.py b/source/Image.py index 334a339..9b113da 100644 --- a/source/Image.py +++ b/source/Image.py @@ -1,6 +1,6 @@ # from .Params import HEADERS -from .Params import API from .Params import ID +from .Params import IMAGE_API def get_id(html: str): @@ -8,7 +8,7 @@ def get_id(html: str): def generate_url(ids: list): - return [API + i for i in ids] + return [IMAGE_API + i for i in ids] def download(url, path): diff --git a/source/Params.py b/source/Params.py index ee1295b..d918242 100644 --- a/source/Params.py +++ b/source/Params.py @@ -8,5 +8,5 @@ HEADERS = { "Cache-Control": "no-cache", "Cookie": "abRequestId=fd245483-beed-57b0-abfc-440b6a6be2aa; webBuild=3.4.1; xsecappid=xhs-pc-web; a1=189fe37918ezx1jqcbe9fin95cnxqj2ewcbc250yp50000234538; webId=9fff21309cfd3e4f380a6c75ed463803; websectiga=f47eda31ec99545da40c2f731f0630efd2b0959e1dd10d5fedac3dce0bd1e04d; sec_poison_id=003395d3-6520-4a02-851a-17d093203251; web_session=030037a3efee2e602d5d16fca4234a8a44466c; gid=yYjidqWi2KE4yYjidqWjyS28YduCyVASDdjiDvU3Ij2SIS28CAVJdJ888Jq42qY88J44DyjS", } -API = "https://sns-img-qc.xhscdn.com/" +IMAGE_API = "https://sns-img-qc.xhscdn.com/" ID = compile(r'"traceId":"(.*?)"')