Comments (6)
我尝试过
(1) 在后端做一个 session_id: playwright 的映射, 但是由于 playwright 的内部机制,导致全局只能实例化一次(https://crifan.github.io/web_automation_tool_playwright/website/issues_summary/sync_inside_asyncio.html)
(2) 用 selenium 代替 playwright 的作用
(3) 每请求一次就重启一次 flask
目前我紧急使用的是第三种办法。想请教下第(2) 种办法是否可替换。
from xhs.
管理多个账号时建议以下两个操作:
- 由于其实只有 a1 参与到签名中,你可以手动将所有的 cookie 设置为同一个 a1 值应该是都可以正确签名的
- 建议修改签名函数,就不要传 web_session cookie 字段到浏览器了,防止浏览器由于频繁切换会话可能会导致容易出现验证码。
from xhs.
可以的,太感谢了!
from xhs.
使用 Flask 签名的流程,是这样的吗?
- 跑docker 服务:
docker run -it -d -p 5005:5005 reajason/xhs-api:latest
- 跑server.py:
py example/basic_sign_server.py
,会log出一个a1的值; - 将a1值替换usage 的cookie中的a1,然后跑usage:
py example/basic_sign_usage.py
from xhs.
使用 Flask 签名的流程,是这样的吗?
from xhs.
使用 Flask 签名的流程,是这样的吗?
你是不是把小红书前端的cookie和创作者的cookie搞混了
from xhs.
Related Issues (20)
- 出现requests.exceptions.ConnectionError HOT 2
- 笔记发布接口提示TypeError
- 请求发布图片笔记接口报406 HOT 1
- ubuntu22.04版本的openssl3.0出现这个问题
- get_note_by_id 返回461错误 HOT 1
- 获取话题的发布问题 HOT 2
- [get_note_by_id] 现在总是 return {} HOT 14
- report_note_metrics方法时好时坏 HOT 1
- 获取笔记评论 提示 超时 HOT 3
- 有获取创作者cookie的api吗 HOT 3
- 可以支持回复私信的功能吗? HOT 6
- 为什么这里可以不传 a1 参数 HOT 1
- xhs 发布图文提示“技术升级中”,请教这是什么原因导致的呢?
- 刚注册的新号,调用二维码接口获取到二维码之后,手机上扫码成功,但是获取二维码扫描状态的接口 返回 461 或者 471 ,怎么解决。。。
- 赞 成功了,对面收不到,这种这么办?
- 拉不了吗
- 是验证码。就是那个横着滑动的。edith.xiaohongshu.com/api/redcaptcha/v2/captcha/register 申请2张图,提交一个角度和触摸轨迹,就能继续了。验证码挺简单的,github上有开源的代码。
- 获取主页推荐 报错 HOT 1
- 调用 xhs_client.activate() 方法报错, 返回 code = -1 应该是加密错误 但是使用 pip install xhs 下载下来的包 调用 xhs_client.activate() 返回正常
- Ubuntu环境下运行basic_usage.py卡在context.new_page()的环节
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xhs.