ReaJason / xhs

基于小红书 Web 端进行的请求封装。https://reajason.github.io/xhs/
MIT License
946 stars 279 forks source link

get_user_info get_user_notes get_note_by_id 这几个貌似失效了 #81

Closed yslion closed 5 months ago

yslion commented 6 months ago

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 这三个 都不行

ReaJason commented 6 months ago

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

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

Gh-mean commented 3 months ago

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

ReaJason commented 3 months ago

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

https://github.com/ReaJason/xhs/blob/34a0ea3aeba2faa20d8a5b986b98dc1093b2d266/xhs/core.py#L170-L174

glorysaladin commented 3 months ago

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

https://github.com/ReaJason/xhs/blob/34a0ea3aeba2faa20d8a5b986b98dc1093b2d266/xhs/core.py#L170-L174

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