From 112242eeaeb0e2a3ee0261edd75e5dbd9d1f9edf Mon Sep 17 00:00:00 2001 From: ReaJason Date: Mon, 29 Apr 2024 22:46:25 +0800 Subject: [PATCH] fix: login phone error (#96) --- CHANGELOG.md | 6 ++++++ xhs/__version__.py | 4 ++-- xhs/core.py | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45c03bb..8a14c9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ - Improve documentation - Add more test function +## 0.2.13 + +### Fixed + +- fix login phone and logon qrcode error + ## 0.2.12 ### Fixed diff --git a/xhs/__version__.py b/xhs/__version__.py index de77ce6..42920be 100644 --- a/xhs/__version__.py +++ b/xhs/__version__.py @@ -8,8 +8,8 @@ __title__ = "xhs" __description__ = "xiaohongshu crawl sdk." __url__ = "https://github.com/ReaJason/xhs" -__version__ = "0.2.12" -__build__ = 0x000212 +__version__ = "0.2.13" +__build__ = 0x000213 __author__ = "ReaJason" __author_email__ = "reajason1225@gmail.com" __license__ = "MIT" diff --git a/xhs/core.py b/xhs/core.py index 4661d47..a5a2cf0 100644 --- a/xhs/core.py +++ b/xhs/core.py @@ -110,7 +110,7 @@ def __init__( "Chrome/111.0.0.0 Safari/537.36" ) self.__session.headers = { - "user-agent": user_agent, + "user-agent": self.user_agent, "Content-Type": "application/json", } self.cookie = cookie @@ -157,6 +157,7 @@ def request(self, method, url, **kwargs): data = response.json() except json.decoder.JSONDecodeError: return response + print(data) if response.status_code == 471 or response.status_code == 461: # someday someone maybe will bypass captcha verify_type = response.headers['Verifytype']