diff --git a/source/Download.py b/source/Download.py index 5a4f1bf..ffeba86 100644 --- a/source/Download.py +++ b/source/Download.py @@ -14,3 +14,9 @@ class Download: "https": proxies, "ftp": proxies, } + + def run(self, urls: list): + pass + + def download(self, url: str): + pass diff --git a/source/__init__.py b/source/__init__.py index 7ef3a64..a97be84 100644 --- a/source/__init__.py +++ b/source/__init__.py @@ -10,7 +10,13 @@ class XHS: "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", } - def __init__(self, path="./", headers=None, proxies=None, timeout=10, cookie=None): + def __init__( + self, + path="./", + headers=None, + proxies=None, + timeout=10, + cookie=None): self.set_cookie(cookie) self.html = Html(headers or self.headers, proxies, timeout) self.image = Image(self.html) @@ -24,11 +30,11 @@ class XHS: def get_image(self, url: str, download=False): urls = self.image.get_image_link(url) if download: - pass + self.download.run(urls) return urls def get_video(self, url: str, download=False): url = self.video.get_video_link(url) if download: - pass + self.download.run([url]) return url