Skip to content

Commit

Permalink
fix: login phone error (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReaJason committed Apr 29, 2024
1 parent ca530f2 commit 112242e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions xhs/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ = "[email protected]"
__license__ = "MIT"
Expand Down
3 changes: 2 additions & 1 deletion xhs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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']
Expand Down

0 comments on commit 112242e

Please sign in to comment.