# redbookweb
基于小红书 Web 端进行的请求封装
# 快速入门
由于 x-s 签名较复杂,因此使用 playwright 进行模拟浏览器行为进行 js 函数调用获取签名算法, 并且其中存在大量的环境检测的行为,因此需要使用到 stealth.min.js 进行绕过。
环境安装(本地调试)
```bash
pip3 install redbookweb # 下载 redbookweb 客户端包
pip3 install playwright # 下载 playwright
playwright install # 安装浏览器环境
curl -O https://cdn.jsdelivr.net/gh/requireCool/stealth.min.js/stealth.min.js # 下载 stealth.min.js
```
如果在本机启动 Flask 需要安装如下依赖
```bash
pip3 install flask
pip3 install gevent
pip3 install requests
```
redbookweb 客户端打包
```bash
pip3 install twine # 使用 twine 来上传你的包。首先需要安装 twine
python3 setup.py sdist
twine upload dist/* # 使用 twine 上传生成的包文件
```
Raw data
{
"_id": null,
"home_page": "https://github.com:liusuxian/redbookweb",
"name": "redbookweb",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "redbookweb crawl",
"author": "liusuxian",
"author_email": "liusuxian89@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/4c/ad/d096a39512636a2136a14357c9ff61ee73e521bb6972406ffb35f639fba0/redbookweb-1.0.1.tar.gz",
"platform": null,
"description": "# redbookweb\n\u57fa\u4e8e\u5c0f\u7ea2\u4e66 Web \u7aef\u8fdb\u884c\u7684\u8bf7\u6c42\u5c01\u88c5\n\n# \u5feb\u901f\u5165\u95e8\n\u7531\u4e8e x-s \u7b7e\u540d\u8f83\u590d\u6742\uff0c\u56e0\u6b64\u4f7f\u7528 playwright \u8fdb\u884c\u6a21\u62df\u6d4f\u89c8\u5668\u884c\u4e3a\u8fdb\u884c js \u51fd\u6570\u8c03\u7528\u83b7\u53d6\u7b7e\u540d\u7b97\u6cd5\uff0c \u5e76\u4e14\u5176\u4e2d\u5b58\u5728\u5927\u91cf\u7684\u73af\u5883\u68c0\u6d4b\u7684\u884c\u4e3a\uff0c\u56e0\u6b64\u9700\u8981\u4f7f\u7528\u5230 stealth.min.js \u8fdb\u884c\u7ed5\u8fc7\u3002\n\n\u73af\u5883\u5b89\u88c5\uff08\u672c\u5730\u8c03\u8bd5\uff09\n```bash\npip3 install redbookweb # \u4e0b\u8f7d redbookweb \u5ba2\u6237\u7aef\u5305\npip3 install playwright # \u4e0b\u8f7d playwright\nplaywright install # \u5b89\u88c5\u6d4f\u89c8\u5668\u73af\u5883\ncurl -O https://cdn.jsdelivr.net/gh/requireCool/stealth.min.js/stealth.min.js # \u4e0b\u8f7d stealth.min.js\n```\n\n\u5982\u679c\u5728\u672c\u673a\u542f\u52a8 Flask \u9700\u8981\u5b89\u88c5\u5982\u4e0b\u4f9d\u8d56\n```bash\npip3 install flask\npip3 install gevent\npip3 install requests\n```\n\nredbookweb \u5ba2\u6237\u7aef\u6253\u5305\n```bash\npip3 install twine # \u4f7f\u7528 twine \u6765\u4e0a\u4f20\u4f60\u7684\u5305\u3002\u9996\u5148\u9700\u8981\u5b89\u88c5 twine\npython3 setup.py sdist\ntwine upload dist/* # \u4f7f\u7528 twine \u4e0a\u4f20\u751f\u6210\u7684\u5305\u6587\u4ef6\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "redbook web crawl sdk.",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com:liusuxian/redbookweb"
},
"split_keywords": [
"redbookweb",
"crawl"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4cadd096a39512636a2136a14357c9ff61ee73e521bb6972406ffb35f639fba0",
"md5": "74e0e6267cf0fe36abd873163058a5c1",
"sha256": "3ef117df47c5db3903def055856119178f5b2165a1eb587e5ffe953ee6418c7d"
},
"downloads": -1,
"filename": "redbookweb-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "74e0e6267cf0fe36abd873163058a5c1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 21346,
"upload_time": "2024-12-17T11:44:40",
"upload_time_iso_8601": "2024-12-17T11:44:40.749128Z",
"url": "https://files.pythonhosted.org/packages/4c/ad/d096a39512636a2136a14357c9ff61ee73e521bb6972406ffb35f639fba0/redbookweb-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-17 11:44:40",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "redbookweb"
}