mirror of
https://github.com/JoeanAmier/XHS-Downloader.git
synced 2026-03-22 06:57:16 +08:00
@@ -75,6 +75,7 @@ class XHS:
|
||||
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\"<>\\^`{|},。;!?、【】《》]+")
|
||||
ID = compile(r"(?:explore|item)/(\S+)?\?")
|
||||
@@ -276,6 +277,8 @@ class XHS:
|
||||
urls.append(u.group())
|
||||
elif u := self.LINK.search(i):
|
||||
urls.append(u.group())
|
||||
elif u := self.USER.search(i):
|
||||
urls.append(u.group())
|
||||
return urls
|
||||
|
||||
def extract_id(self, links: list[str]) -> list[str]:
|
||||
|
||||
Reference in New Issue
Block a user