ReaJason / xhs

基于小红书 Web 端进行的请求封装。https://reajason.github.io/xhs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

get_user_info get_user_notes get_note_by_id 这几个貌似失效了

yslion opened this issue · comments

image

cookie填写后
get_self_info get_home_feed(xhs.FeedType.RECOMMEND) 这几个能正常打印
follow_user(user_id) 这个也可以
截图里的 get_user_info get_user_notes get_note_by_id 这三个 都不行

我这儿测试目前是没问题,你那儿返回的空数据,我猜测是和 cookie 有关,可以尝试换一个 cookie 试试。

CleanShot 2024-01-30 at 08 56 11@2x

我也遇到了相似的问题,返回的http_state是461
内容是'{"code":0,"success":true,"msg":"成功","data":{}}'

461 这个响应头里面有没有包含 verify 相关的字眼,目前写了一个 471 的响应码是被验证码给拦截了,我猜测 461 可能类似的

xhs/xhs/core.py

Lines 170 to 174 in 34a0ea3

elif response.status_code == 471:
# someday someone maybe will bypass captcha
raise NeedVerifyError(
f"出现验证码,请求失败,Verifytype: {response.headers['Verifytype']},Verifyuuid: {response.headers['Verifyuuid']}",
response=response)

461 这个响应头里面有没有包含 verify 相关的字眼,目前写了一个 471 的响应码是被验证码给拦截了,我猜测 461 可能类似的

xhs/xhs/core.py

Lines 170 to 174 in 34a0ea3

elif response.status_code == 471:
# someday someone maybe will bypass captcha
raise NeedVerifyError(
f"出现验证码,请求失败,Verifytype: {response.headers['Verifytype']},Verifyuuid: {response.headers['Verifyuuid']}",
response=response)

验证码拦截这种有办法解答吗? 目前调用get_note_by_id的接口会返回 461; 三个账号使用的同一个签名服务器,同一个a1; 有两个返回461, 一个正常