## DoubanInfo
抓取豆瓣信息并生成简介文本, 目前支持电影类(电影/剧集/动漫/综艺)和书籍类。
Get douabn information to a summary text.
## Functions(功能介绍)
- 输出简介文本
- 输出Json格式信息
- 自动将输出信息复制到前剪切板
- 支持适用cookie抓取部分只有登录豆瓣才能看到的资源信息
- 支持Python调用
## Usage Scenario(适用场景)
- 抓取到只有登录豆瓣才能看到的资源信息
- 在Python等脚本中获取豆瓣简介/Json格式豆瓣信息
- 在命令行/Shell中获取豆瓣简介/Json格式豆瓣信息
## 更新日志
- 20221029 修复了抓取imdb分数超时的bug
- 20221007 更改了获取书籍内容的算法
- 20221007 去掉无法识别的字符
- 20221007 修复豆瓣链接中id后必须有/的bug
## Useage(使用方法)
### 1.命令行直接使用
#### 参数说明
-h, --help show this help message and exit
-u URL, --url URL Input your douban-url(豆瓣链接)
-c COOKIE, --cookie COOKIE
Input your douban-cookie(豆瓣cookie,用于抓取部分只有登录才能看到的资源)
-j, --json Output as json format(输出json格式的结果)
-cp, --copy Copy the output to the clipboard(将结果添加到剪切板)
#### 示例
```bash
doubaninfo -u douban-url -c douban-cookie(不强制)
```
示例1:
```bash
doubaninfo -u https://movie.douban.com/subject/26353671/
```
示例2:
```bash
doubaninfo -u https://movie.douban.com/subject/26353671/ -c 'your cookie'
```
示例3:
```bash
di -u https://movie.douban.com/subject/26353671/ -c 'your cookie'
```
### 2.Python接口使用
```python
from doubaninfo.doubaninfo import getdoubaninfo
res_douban=getdoubaninfo(url=url,cookie=cookie,ret_val=True)
douban_dict=res_douban.parse() # get the douban information dict
douban_text=res_douban.info() # get the douban information str
```
## Install 安装方法
1.安装Python环境
2.在PowerShell(Windows)/ Terminal.app(MacOS)/ command-line interface(Linux)下输入
```shell
pip3 install doubaninfo
```
Or
```shell
pip install doubaninfo
```
## Upgrade 更新方法
```shell
pip3 install --upgrade doubaninfo
```
Or
```shell
pip install --upgrade doubaninfo
```
## Reference
[1] [DouBan-Spider](https://github.com/weizhixiaoyi/DouBan-Spider)
[2] [电影信息查询脚本](https://greasyfork.org/zh-CN/scripts/38878-%E7%94%B5%E5%BD%B1%E4%BF%A1%E6%81%AF%E6%9F%A5%E8%AF%A2%E8%84%9A%E6%9C%AC)
Raw data
{
"_id": null,
"home_page": "https://github.com/dongshuyan/doubaninfo",
"name": "doubaninfo",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7.0",
"maintainer_email": "",
"keywords": "pip,doubaninfo,douban,movie,book,PTGen,private tracker,PT",
"author": "sauterne",
"author_email": "ssauterne@qq.com",
"download_url": "https://files.pythonhosted.org/packages/9e/0b/1ac6c7fdf4aee19dc59712304aad0eeba1a14da2488277b12bc5c44f99ad/doubaninfo-0.0.13.tar.gz",
"platform": "any",
"description": "## DoubanInfo\n\n\u6293\u53d6\u8c46\u74e3\u4fe1\u606f\u5e76\u751f\u6210\u7b80\u4ecb\u6587\u672c, \u76ee\u524d\u652f\u6301\u7535\u5f71\u7c7b\uff08\u7535\u5f71/\u5267\u96c6/\u52a8\u6f2b/\u7efc\u827a\uff09\u548c\u4e66\u7c4d\u7c7b\u3002\n\nGet douabn information to a summary text.\n\n## Functions\uff08\u529f\u80fd\u4ecb\u7ecd\uff09\n\n- \u8f93\u51fa\u7b80\u4ecb\u6587\u672c\n- \u8f93\u51faJson\u683c\u5f0f\u4fe1\u606f\n- \u81ea\u52a8\u5c06\u8f93\u51fa\u4fe1\u606f\u590d\u5236\u5230\u524d\u526a\u5207\u677f\n- \u652f\u6301\u9002\u7528cookie\u6293\u53d6\u90e8\u5206\u53ea\u6709\u767b\u5f55\u8c46\u74e3\u624d\u80fd\u770b\u5230\u7684\u8d44\u6e90\u4fe1\u606f\n- \u652f\u6301Python\u8c03\u7528\n\n## Usage Scenario\uff08\u9002\u7528\u573a\u666f\uff09\n\n- \u6293\u53d6\u5230\u53ea\u6709\u767b\u5f55\u8c46\u74e3\u624d\u80fd\u770b\u5230\u7684\u8d44\u6e90\u4fe1\u606f\n- \u5728Python\u7b49\u811a\u672c\u4e2d\u83b7\u53d6\u8c46\u74e3\u7b80\u4ecb/Json\u683c\u5f0f\u8c46\u74e3\u4fe1\u606f\n- \u5728\u547d\u4ee4\u884c/Shell\u4e2d\u83b7\u53d6\u8c46\u74e3\u7b80\u4ecb/Json\u683c\u5f0f\u8c46\u74e3\u4fe1\u606f\n\n## \u66f4\u65b0\u65e5\u5fd7 \n- 20221029 \u4fee\u590d\u4e86\u6293\u53d6imdb\u5206\u6570\u8d85\u65f6\u7684bug\n- 20221007 \u66f4\u6539\u4e86\u83b7\u53d6\u4e66\u7c4d\u5185\u5bb9\u7684\u7b97\u6cd5\n- 20221007 \u53bb\u6389\u65e0\u6cd5\u8bc6\u522b\u7684\u5b57\u7b26 \n- 20221007 \u4fee\u590d\u8c46\u74e3\u94fe\u63a5\u4e2did\u540e\u5fc5\u987b\u6709/\u7684bug \n\n\n## Useage(\u4f7f\u7528\u65b9\u6cd5)\n\n### 1.\u547d\u4ee4\u884c\u76f4\u63a5\u4f7f\u7528\n\n#### \u53c2\u6570\u8bf4\u660e\n\n-h, --help show this help message and exit\n-u URL, --url URL Input your douban-url\uff08\u8c46\u74e3\u94fe\u63a5\uff09\n-c COOKIE, --cookie COOKIE\n Input your douban-cookie\uff08\u8c46\u74e3cookie\uff0c\u7528\u4e8e\u6293\u53d6\u90e8\u5206\u53ea\u6709\u767b\u5f55\u624d\u80fd\u770b\u5230\u7684\u8d44\u6e90\uff09\n-j, --json Output as json format\uff08\u8f93\u51fajson\u683c\u5f0f\u7684\u7ed3\u679c\uff09\n-cp, --copy Copy the output to the clipboard(\u5c06\u7ed3\u679c\u6dfb\u52a0\u5230\u526a\u5207\u677f)\n\n#### \u793a\u4f8b\n\n```bash\ndoubaninfo -u douban-url -c douban-cookie(\u4e0d\u5f3a\u5236)\n```\n\n\u793a\u4f8b1:\n\n```bash\ndoubaninfo -u https://movie.douban.com/subject/26353671/\n```\n\n\u793a\u4f8b2:\n\n```bash\ndoubaninfo -u https://movie.douban.com/subject/26353671/ -c 'your cookie'\n```\n\n\u793a\u4f8b3:\n\n```bash\ndi -u https://movie.douban.com/subject/26353671/ -c 'your cookie'\n```\n\n### 2.Python\u63a5\u53e3\u4f7f\u7528\n\n```python\nfrom doubaninfo.doubaninfo import getdoubaninfo\nres_douban=getdoubaninfo(url=url,cookie=cookie,ret_val=True)\ndouban_dict=res_douban.parse() # get the douban information dict\ndouban_text=res_douban.info() # get the douban information str\n```\n\n## Install \u5b89\u88c5\u65b9\u6cd5\n\n1.\u5b89\u88c5Python\u73af\u5883\n\n2.\u5728PowerShell\uff08Windows\uff09/ Terminal.app\uff08MacOS\uff09/ command-line interface\uff08Linux\uff09\u4e0b\u8f93\u5165\n\n```shell\npip3 install doubaninfo\n```\n\nOr\n\n```shell\npip install doubaninfo\n```\n\n## Upgrade \u66f4\u65b0\u65b9\u6cd5\n\n```shell\npip3 install --upgrade doubaninfo\n```\n\nOr\n\n```shell\npip install --upgrade doubaninfo\n```\n\n## Reference\n\n[1] [DouBan-Spider](https://github.com/weizhixiaoyi/DouBan-Spider)\n\n[2] [\u7535\u5f71\u4fe1\u606f\u67e5\u8be2\u811a\u672c](https://greasyfork.org/zh-CN/scripts/38878-%E7%94%B5%E5%BD%B1%E4%BF%A1%E6%81%AF%E6%9F%A5%E8%AF%A2%E8%84%9A%E6%9C%AC)",
"bugtrack_url": null,
"license": "MIT Licence",
"summary": "Get douabn information to a summary text.",
"version": "0.0.13",
"split_keywords": [
"pip",
"doubaninfo",
"douban",
"movie",
"book",
"ptgen",
"private tracker",
"pt"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9e0b1ac6c7fdf4aee19dc59712304aad0eeba1a14da2488277b12bc5c44f99ad",
"md5": "00152e2bab4ea2979176dbe48c3a1a36",
"sha256": "5edd87bba5f97985d4422304461395a580a19c2c30bafaeb5b081d5a840e62ae"
},
"downloads": -1,
"filename": "doubaninfo-0.0.13.tar.gz",
"has_sig": false,
"md5_digest": "00152e2bab4ea2979176dbe48c3a1a36",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7.0",
"size": 12572,
"upload_time": "2023-01-07T05:42:40",
"upload_time_iso_8601": "2023-01-07T05:42:40.366252Z",
"url": "https://files.pythonhosted.org/packages/9e/0b/1ac6c7fdf4aee19dc59712304aad0eeba1a14da2488277b12bc5c44f99ad/doubaninfo-0.0.13.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-07 05:42:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "dongshuyan",
"github_project": "doubaninfo",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "doubaninfo"
}