mirror of
https://github.com/JoeanAmier/XHS-Downloader.git
synced 2025-12-26 04:48:05 +08:00
parent
b63f546b3a
commit
e0fbd7916d
@ -74,11 +74,12 @@ class XHS:
|
||||
VERSION_MAJOR = VERSION_MAJOR
|
||||
VERSION_MINOR = VERSION_MINOR
|
||||
VERSION_BETA = VERSION_BETA
|
||||
LINK = compile(r"https?://www\.xiaohongshu\.com/explore/\S+")
|
||||
USER = compile(r"https?://www\.xiaohongshu\.com/user/profile/[a-z0-9]+/\S+")
|
||||
SHARE = compile(r"https?://www\.xiaohongshu\.com/discovery/item/\S+")
|
||||
SHORT = compile(r"https?://xhslink\.com/[^\s\"<>\\^`{|},。;!?、【】《》]+")
|
||||
LINK = compile(r"(?:https?://)?www\.xiaohongshu\.com/explore/\S+")
|
||||
USER = compile(r"(?:https?://)?www\.xiaohongshu\.com/user/profile/[a-z0-9]+/\S+")
|
||||
SHARE = compile(r"(?:https?://)?www\.xiaohongshu\.com/discovery/item/\S+")
|
||||
SHORT = compile(r"(?:https?://)?xhslink\.com/[^\s\"<>\\^`{|},。;!?、【】《》]+")
|
||||
ID = compile(r"(?:explore|item)/(\S+)?\?")
|
||||
ID_USER = compile(r"user/profile/[a-z0-9]+/(\S+)?\?")
|
||||
__INSTANCE = None
|
||||
CLEANER = Cleaner()
|
||||
|
||||
@ -286,6 +287,8 @@ class XHS:
|
||||
for i in links:
|
||||
if j := self.ID.search(i):
|
||||
ids.append(j.group(1))
|
||||
elif j := self.ID_USER.search(i):
|
||||
ids.append(j.group(1))
|
||||
return ids
|
||||
|
||||
async def __deal_extract(
|
||||
|
||||
@ -32,6 +32,8 @@ class Html:
|
||||
proxy: str = None,
|
||||
**kwargs,
|
||||
) -> str:
|
||||
if not url.startswith("http"):
|
||||
url = f"https://{url}"
|
||||
headers = self.update_cookie(
|
||||
cookie,
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user