├── README.md ├── docs ├── requirements.txt ├── source │ ├── _static │ │ └── image │ │ │ ├── wx-shouqianma.jpg │ │ │ └── zhifubao-shouqianma.jpg │ ├── index.rst │ ├── onecomic-config.md │ ├── conf.py │ ├── onecomic-project.md │ ├── onecomic.md │ └── onecomic-api.md ├── Makefile ├── make.bat └── .gitignore └── .readthedocs.yml /README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | Sphinx==2.2.0 2 | sphinx-markdown-tables==0.0.17 3 | sphinx-rtd-theme==0.5.1 4 | recommonmark==0.7.1 5 | Jinja2<3.1 6 | -------------------------------------------------------------------------------- /docs/source/_static/image/wx-shouqianma.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardwarecode/onecomic-doc/HEAD/docs/source/_static/image/wx-shouqianma.jpg -------------------------------------------------------------------------------- /docs/source/_static/image/zhifubao-shouqianma.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hardwarecode/onecomic-doc/HEAD/docs/source/_static/image/zhifubao-shouqianma.jpg -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. onecomic-doc documentation master file, created by 2 | sphinx-quickstart on Sun Jan 31 01:25:01 2021. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to onecomic-doc's documentation! 7 | ======================================== 8 | 9 | .. toctree:: 10 | 11 | onecomic 12 | onecomic-config.md 13 | onecomic-api 14 | onecomic-project 15 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Build documentation in the docs/ directory with Sphinx 9 | sphinx: 10 | configuration: docs/source/conf.py 11 | 12 | # Set the OS, Python version and other tools you might need 13 | build: 14 | os: ubuntu-22.04 15 | tools: 16 | python: "3.7" 17 | 18 | 19 | # Optionally set the version of Python and requirements required to build your docs 20 | python: 21 | install: 22 | - requirements: docs/requirements.txt 23 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # Environments 83 | .env 84 | .venv 85 | env/ 86 | venv/ 87 | ENV/ 88 | env.bak/ 89 | venv.bak/ 90 | 91 | # Spyder project settings 92 | .spyderproject 93 | .spyproject 94 | 95 | # Rope project settings 96 | .ropeproject 97 | 98 | # mkdocs documentation 99 | /site 100 | 101 | # mypy 102 | .mypy_cache/ 103 | -------------------------------------------------------------------------------- /docs/source/onecomic-config.md: -------------------------------------------------------------------------------- 1 | # 配置文件 2 | 3 | 根据示例创建配置文件 4 | 5 | ### 配置文件示例 6 | ``` 7 | [mail] 8 | 9 | # SMTP主机 发送账户是163邮箱则设置为 smtp.163.com 10 | smtp_server=smtp.qq.com 11 | 12 | # SMTP服务端口(SSL) 13 | smtp_port=465 14 | 15 | # 发送者账户 16 | sender=xx.qq.com 17 | 18 | # 登录失败可能需要使用授权码登录 https://service.mail.qq.com/cgi-bin/help?subtype=1&&id=28&&no=1001256 19 | # 发送者账户密码或者授权码 20 | sender_passwd=密码或授权码 21 | 22 | # 邮件接收者列表,多个则以半角逗号隔开。如 xxx@qq.com,yyy@qq.com 23 | receivers=11111@qq.com,22222@qq.com 24 | 25 | 26 | [crawler] 27 | # 默认的下载目录 28 | # download_dir=/home/xxx/MyComicBook 29 | 30 | # 配置指定站点代理地址 31 | # proxy_18comic=socks5://127.0.0.1:1080 32 | # proxy_manhuagui=socks5://127.0.0.1:1080 33 | # proxy_nhentai=socks5://127.0.0.1:1080 34 | # proxy_wnacg=socks5://127.0.0.1:1080 35 | # proxy_acg456=socks5://127.0.0.1:1080 36 | # proxy_mh1234=socks5://127.0.0.1:1080 37 | # proxy_177pic=socks5://127.0.0.1:1080 38 | # proxy_18hmmcg=socks5://127.0.0.1:1080 39 | # proxy_xiuren=socks5://127.0.0.1:1080 40 | # proxy_twhentai=socks5://127.0.0.1:1080 41 | # proxy_copymanga=socks5://127.0.0.1:1080 42 | # proxy_toomics=socks5://127.0.0.1:1080 43 | # proxy_webtoons=socks5://127.0.0.1:1080 44 | 45 | 46 | # 若站点域名变更,页面样式不变,可通过参数修改域名 47 | # site_index_gufengmh=https://www.gufengmh9.com/ 48 | # site_index_mh160=https://mh160.cc/ 49 | 50 | 51 | # webdriver 配置 52 | # driver_type=Chrome 53 | # driver_path=/home/xxx/chromedriver_win32/chromedriver.exe 54 | 55 | 56 | # node模块位置 57 | # node_modules=/home/xxx/js/node_modules 58 | 59 | # cookies存放目录(自动读取该目录下的cookeis文件),文件名命名规范: 如 toomics.json qq.json {site}.json 60 | # cookies_dir=/home/xxx/cookies 61 | 62 | # 长图质量 最大100 63 | # quality=95 64 | # 长图最大高度 最大65500 65 | # max_height=20000 66 | 67 | # 图片下载超时时间 单位秒 68 | image_timeout=30 69 | 70 | # 站点访问超时时间 单位秒 71 | crawler_timeout=30 72 | 73 | # 每个章节下载时间间隔 单位秒 74 | crawler_delay=0 75 | 76 | # User-Agent 配置 77 | # user_agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36 78 | 79 | # 将下载的webp格式的图片自动转换成jpg 80 | transfer_webp=1 81 | 82 | 83 | # 日志输出文件路径 84 | log_file=/home/xxx/MyComicBook/xxx.log 85 | ``` 86 | 87 | 将上述配置保存为`config.ini` 88 | 89 | 如`onecomic -s u17 -id 195 -c 1`会默认读取当前目录下的`config.ini`配置文件 90 | 91 | 或者通过环境变量配置默认的配置文件 92 | ```sh 93 | # 将以下命令添加到 ~/.bashrc 或 ~/.zshrc 文件末尾 94 | export ONECOMIC_CONFIG_FILE="/home/xxx/MyConfig/config.ini" 95 | ``` 96 | 97 | 也可以通过参数指定配置文件`onecomic -s u17 -id 195 -c 1 --config config.ini` 98 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # This file only contains a selection of the most common options. For a full 4 | # list see the documentation: 5 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 6 | 7 | # -- Path setup -------------------------------------------------------------- 8 | 9 | # If extensions (or modules to document with autodoc) are in another directory, 10 | # add these directories to sys.path here. If the directory is relative to the 11 | # documentation root, use os.path.abspath to make it absolute, like shown here. 12 | # 13 | # import os 14 | # import sys 15 | # sys.path.insert(0, os.path.abspath('.')) 16 | 17 | import sphinx_rtd_theme 18 | from recommonmark.parser import CommonMarkParser 19 | 20 | # -- Project information ----------------------------------------------------- 21 | 22 | project = 'onecomic-doc' 23 | copyright = '2021, hardwarecode' 24 | author = 'hardwarecode' 25 | 26 | 27 | # -- General configuration --------------------------------------------------- 28 | 29 | # Add any Sphinx extension module names here, as strings. They can be 30 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 31 | # ones. 32 | extensions = [ 33 | 'sphinx_markdown_tables', 34 | ] 35 | 36 | # Add any paths that contain templates here, relative to this directory. 37 | templates_path = ['_templates'] 38 | 39 | # The language for content autogenerated by Sphinx. Refer to documentation 40 | # for a list of supported languages. 41 | # 42 | # This is also used if you do content translation via gettext catalogs. 43 | # Usually you set "language" from the command line for these cases. 44 | language = 'zh_CN' 45 | 46 | # List of patterns, relative to source directory, that match files and 47 | # directories to ignore when looking for source files. 48 | # This pattern also affects html_static_path and html_extra_path. 49 | exclude_patterns = [] 50 | 51 | 52 | # -- Options for HTML output ------------------------------------------------- 53 | 54 | # The theme to use for HTML and HTML Help pages. See the documentation for 55 | # a list of builtin themes. 56 | # 57 | # html_theme = 'alabaster' 58 | html_theme = "sphinx_rtd_theme" 59 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] 60 | 61 | 62 | # Add any paths that contain custom static files (such as style sheets) here, 63 | # relative to this directory. They are copied after the builtin static files, 64 | # so a file named "default.css" will overwrite the builtin "default.css". 65 | html_static_path = ['_static'] 66 | 67 | source_parsers = { 68 | '.md': CommonMarkParser, 69 | } 70 | source_suffix = ['.rst', '.md'] 71 | -------------------------------------------------------------------------------- /docs/source/onecomic-project.md: -------------------------------------------------------------------------------- 1 | # 站点收录情况 2 | 3 | ## 漫画站点 4 | 5 | | 站点 | site | 站点主页 | 最近更新 | 关键词搜索 | 标签搜索 | 6 | | --- | --- | --- | --- | --- | --- | 7 | | 拷贝漫画 | copymanga | [https://copymanga.com/](https://copymanga.com/) | ✓ | ✓ | ✓ | 8 | | 熱辣漫畫 | 2024manga | [https://www.2024manga.com/](https://www.2024manga.com/) | ✓ | ✓ | ✓ | 9 | | 二次元动漫 | 2animx | [https://www.2animx.com/](https://www.2animx.com/) | ✓ | ✓ | ✓ | 10 | | 古风漫画网 | gufengmh | [https://www.gufengmh9.com/](https://www.gufengmh9.com/) | ✓ | - | ✓ | 11 | | 36漫画网 | 36mh | [https://www.36mh.com/](https://www.36mh.com/) | ✓ | - | ✓ | 12 | | 土豪漫画网 | tuhao456 | [https://www.tuhao456.com/](https://www.tuhao456.com/) | ✓ | ✓ | ✓ | 13 | | 漫画DB | manhuadb | [https://www.manhuadb.com/](https://www.manhuadb.com/) | ✓ | ✓ | ✓ | 14 | | DM5 | dm5 | [https://www.dm5.com/](https://www.dm5.com/) | ✓ | ✓ | ✓ | 15 | | bilibili漫画 | bilibili | [https://manga.bilibili.com/](https://manga.bilibili.com/) | ✓ | ✓ | ✓ | 16 | | 腾讯漫画 | qq | [https://ac.qq.com/](https://ac.qq.com/) | ✓ | ✓ | ✓ | 17 | | 有妖气漫画 | u17 | [https://www.u17.com/](https://www.u17.com/) | ✓ | ✓ | ✓ | 18 | | 动漫之家 | dmzj | [https://www.dmzj.com/](https://www.dmzj.com/) | ✓ | ✓ | ✓ | 19 | | 快看漫画 | kuaikan | [https://www.kuaikanmanhua.com/](https://www.kuaikanmanhua.com/) | ✓ | ✓ | ✓ | 20 | | 漫画柜 | manhuagui | [https://www.manhuagui.com/](https://www.manhuagui.com/) | ✓ | ✓ | ✓ | 21 | | 漫画柜 | mhgui | [https://www.mhgui.com/](https://www.mhgui.com/) | ✓ | ✓ | ✓ | 22 | | 漫画1234 | mh1234 | [https://www.mh1234.com/](https://www.mh1234.com/) | ✓ | ✓ | ✓ | 23 | | 新新漫画 | 77mh | [https://www.77mh.cc/](https://www.77mh.cc/) | ✓ | ✓ | ✓ | 24 | | 漫画台 | manhuatai | [https://www.manhuatai.com/](https://www.manhuatai.com/) | ✓ | - | - | 25 | | ACG肆伍陆 | acg456 | [http://www.acg456.com/](http://www.acg456.com/) | ✓ | - | ✓ | 26 | | WEBTOON | webtoons | [https://www.webtoons.com/](https://www.webtoons.com/) | ✓ | - | - | 27 | | qootoon | qootoon | [https://www.qootoon.net/](https://www.qootoon.net/) | ✓ | - | - | 28 | | 扑飞漫画 | pufei8 | [http://www.pufei8.com/](http://www.pufei8.com/) | - | - | ✓ | 29 | | 歪漫屋 | yymh889 | [http://yymh889.com/](http://yymh889.com/) | ✓ | ✓ | - | 30 | | 爱飞漫画 | 2feimh | [https://www.2feimh.com/](https://www.2feimh.com/) | - | - | - | 31 | | 优酷漫画 | ykmh | [https://www.ykmh.com/](https://www.ykmh.com/) | ✓ | ✓ | - | 32 | | 来漫画 | laimanhua | [https://www.laimanhua.net/](https://www.laimanhua.net/) | ✓ | ✓ | ✓ | 33 | | 漫画160 | mh160 | [https://www.mh160.cc/](https://www.mh160.cc/) | ✓ | ✓ | ✓ | 34 | | 奇漫屋 | qiman6 | [http://www.qiman6.com/](http://www.qiman6.com/) | ✓ | ✓ | ✓ | 35 | | 奇妙漫画 | qimiaomh | [https://www.qimiaomh.com/](https://www.qimiaomh.com/) | ✓ | ✓ | ✓ | 36 | | 6漫画 | sixmh6 | [http://www.sixmh6.com/](http://www.sixmh6.com/) | ✓ | ✓ | ✓ | 37 | | 波动boodo | boodo | [https://boodo.qq.com/](https://boodo.qq.com/) | ✓ | ✓ | ✓ | 38 | | 3250漫画(已失效) | 3250mh | [https://www.3250mh.com/](https://www.3250mh.com/) | ✓ | ✓ | ✓ | 39 | | 漫番漫画 | myfcomic | [http://www.myfcomic.com/](http://www.myfcomic.com/) | ✓ | ✓ | ✓ | 40 | | 包子漫画 | baozimh | [https://www.baozimh.com/](https://www.baozimh.com/) | ✓ | ✓ | ✓ | 41 | | BoyLove | boylove | [https://boylove.cc/](https://boylove.cc/) | ✓ | ✓ | ✓ | 42 | | 酷爱漫画 | kuimh | [https://www.kuimh.com/](https://www.kuimh.com/) | ✓ | ✓ | ✓ | 43 | | 漫画飞 | manhuafei | [https://www.manhuafei.com/](https://www.manhuafei.com/) | ✓ | ✓ | ✓ | 44 | | 漫蛙漫画 | manwa | [https://manwa.site/](https://manwa.site/) | ✓ | - | ✓ | 45 | 46 | 47 | ## R18 48 | 49 | | 站点 | site | 站点主页 | 最近更新 | 关键词搜索 | 标签搜索 | 50 | | --- | --- | --- | --- | --- | --- | 51 | | 18H漫画区 | 18hmmcg | [http://18h.mm-cg.com/](http://18h.mm-cg.com/) | ✓ | ✓ | ✓ | 52 | | 177漫畫 | 177pic | [http://177pic.info/](http://177pic.info/) | ✓ | ✓ | ✓ | 53 | | 绅士漫画 | wnacg | [http://www.wnacg.org/](http://www.wnacg.org/) | ✓ | ✓ | ✓ | 54 | | 禁漫天堂 | 18comic | [https://18comic.org/](https://18comic.org/) | ✓ | ✓ | ✓ | 55 | | NHentai | nhentai | [https://nhentai.net/](https://nhentai.net/) | ✓ | ✓ | ✓ | 56 | | 禁漫之家 | jmzj | [http://jmzj.xyz/](http://jmzj.xyz/) | ✓ | ✓ | ✓ | 57 | | 污污漫画 | 55comic | [https://www.55comic.com/](https://www.55comic.com/) | ✓ | ✓ | ✓ | 58 | | TwHentai | twhentai | [http://twhentai.com/](http://twhentai.com/) | ✓ | ✓ | ✓ | 59 | 60 | ## 图集 61 | 62 | | 站点 | site | 站点主页 | 最近更新 | 关键词搜索 | 标签搜索 | 63 | | --- | --- | --- | --- | --- | --- | 64 | | 秀人网 | xiuren | [http://www.xiuren.org/](http://www.xiuren.org/) | ✓ | - | ✓ | 65 | | MMKK | mmkk | [https://www.mmkk.me/](https://www.mmkk.me/) | ✓ | - | ✓ | 66 | 67 | 68 | ## 其它站点(未收录) 69 | 70 | | 站点 | 说明 | 站点主页 | 71 | | --- | --- | --- | 72 | | e-hentai | 配合 Ehviewer 食用 | [https://e-hentai.org/](https://e-hentai.org/) | 73 | | exhenta | 配合 Ehviewer 食用 | [https://exhentai.org/](https://exhentai.org/) | 74 | | Nsfwpicx | NSFW图集(看看就好,别爬了) | [http://picxxxxx.top/](http://picxxxxx.top/) | 75 | | Toomics | 之前适配过,现在不能用了 | [https://toomics.com/](https://toomics.com/) | 76 | | COCO漫画 | 之前适配过,现在不能用了 | [https://www.cocomanhua.com/](https://www.cocomanhua.com/) | 77 | -------------------------------------------------------------------------------- /docs/source/onecomic.md: -------------------------------------------------------------------------------- 1 | # 一本漫画 2 | 3 | **尊重版权,请支持正版** 4 | 5 | **该项目仅供技术研究使用,请勿用于非法用途,否则后果自负** 6 | 7 | **通过本工具下载或生成的资源禁止传播分享!禁止利用该项目从事营利性活动!** 8 | 9 | 项目地址: [https://github.com/hardwarecode/onecomic](https://github.com/hardwarecode/onecomic) 10 | 11 | ## 安装/升级步骤 12 | 13 | 自己找安装Python的教程(Python版本大于等于3.6,小于3.10) 14 | 15 | 安装nodejs环境,自己找教程安装 16 | 17 | ```sh 18 | # 检查python版本 19 | python --version 20 | # 检查pip版本 21 | pip --version 22 | ``` 23 | 24 | ```sh 25 | # 在线安装/升级(最新版本) 26 | pip install -U onecomic 27 | 28 | # 查看帮助 29 | onecomic --help 30 | ``` 31 | 32 | [更新日志](https://github.com/hardwarecode/onecomic/blob/main/CHANGELOG.md) 33 | 34 | ## 常规使用 35 | 36 | **Windows下,以下所有示例命令需要添加`python -m`前缀** 37 | 38 | 如: `python -m onecomic --url "http://ac.qq.com/Comic/ComicInfo/id/505430"` 39 | 40 | ```sh 41 | # 注意参数里的 - 和 -- 的区别 42 | # 从章节列表页面的URL 下载漫画的最新一集 43 | onecomic --url "http://ac.qq.com/Comic/ComicInfo/id/505430" 44 | 45 | # 下载漫画 id=505430 最新一集 注意不同站点的漫画id区别 46 | onecomic -s qq -id=505430 47 | 48 | # 下载所有章节 49 | onecomic -s qq -id 505430 --all 50 | 51 | # 下载第800集 52 | onecomic -s qq -id 505430 -c 800 53 | 54 | # 下载倒数第2集 55 | onecomic -s qq -id 505430 -c r2 56 | 57 | # 下载倒数第1集至倒数第5集 58 | onecomic -s qq -id 505430 -c r1-5 59 | 60 | 61 | # 下载1到5集,7集,9到10集 62 | onecomic -s qq -id 505430 -c 1-5,7,9-10 63 | 64 | # 拼接成长图 65 | onecomic -s qq -id 505430 --single-image --quality 95 --max-height 20000 66 | 67 | # 压缩成zip文件 68 | onecomic -s qq -id=505430 --zip 69 | 70 | # 设置代理 71 | onecomic -s qq -id 505430 --proxy "socks5://127.0.0.1:1080" 72 | 73 | # 自定义保存目录 74 | onecomic -s qq -id=505430 --output MyComicBook 75 | 76 | # 将多话合并到单个文件夹和zip文件 77 | onecomic -s manhuagui -id 1128 -c 320-322 --merge --merge-zip 78 | 79 | # 下载单行本 番外篇 xxx 80 | onecomic -s manhuagui -id 1128 --ext-name 单行本 -c -1 81 | onecomic -s xxx -id xxx --ext-name 番外篇 -c -1 82 | onecomic -s xxx -id xxx --ext-name xxx -c -1 83 | 84 | 85 | # 跟据名字搜索漫画comicid 打印搜索结果 86 | onecomic -s qq --name 海贼 87 | 88 | # 生成pdf文件 89 | # 注意: 生成pdf文件需要额外安装依赖,需要先执行 pip install img2pdf 或 pip install reportlab 90 | onecomic -s qq -id 505430 --pdf 91 | 92 | # 推送到邮箱 93 | # 注意: 发送到邮箱需预先配置好信息(详情请看配置文件部分) 94 | onecomic -s qq -id 505430 --pdf --mail --config config.ini 95 | ``` 96 | 97 | 从其它站点下载,注意不同站点的comicid区别 98 | ```sh 99 | # 从哔哩哔哩漫画下载 100 | onecomic -s bilibili -id mc24742 -c 1 101 | 102 | # 从有妖气漫画下载 103 | onecomic -s u17 -id 195 -c 1 104 | 105 | # 从章节列表页面的URL下载 106 | onecomic --url "https://manga.bilibili.com/detail/mc28603" -c 1 107 | ``` 108 | 109 | 110 | ## 高级批量下载 111 | 112 | ```sh 113 | # 通过指定的URL文件列表批量下载 114 | onecomic --url-file test/test-url-file.txt 115 | ``` 116 | 117 | 文件示例`test/test-url-file.txt` 118 | ``` 119 | # 海贼王 120 | http://ac.qq.com/Comic/ComicInfo/id/505430 121 | # 雏蜂 122 | https://www.u17.com/comic/195.html 123 | ``` 124 | ------ 125 | 126 | ```sh 127 | # 有些站点不一定支持,其它的通用参数也适用,可自行组合 128 | # 下载最近更新页面的1到10页 所有漫画的最新一集 129 | onecomic -s nvshens --latest --page 1-10 130 | 131 | # 展示支持的标签 132 | onecomic -s nvshens --show-tags 133 | 134 | # 下载标签搜索结果页面的1到10页 所有漫画的全集 135 | onecomic -s nvshens --tag 女神 --page 1-10 --all 136 | 137 | 138 | # 跟据名字搜索漫画comicid 打印搜索结果 139 | onecomic -s nhentai --name 汉化 140 | 141 | # 下载搜索结果的所有漫画的全集 142 | onecomic -s nhentai --search 汉化 --page 1 --all 143 | ``` 144 | 145 | 146 | ## 常见问题 147 | 148 | ### 怎么下载有登陆限制/需要付费漫画 149 | 150 | 下载付费漫画的前提是,你的账号要**先购买**漫画 151 | 152 | 1. [安装EditThisCookie插件](https://chrome.google.com/webstore/detail/editthiscookie/fngmhnnpilhplaeedifhccceomclgfbg) 153 | 2. 在浏览器上登录某个站点,然后通过插件导出某个站点的cookie,并保存到本地文件 如`qq.json` 154 | 3. 最好保证运行的脚本与在浏览器导出的cookie在同一个网络环境(如果浏览器使用代理,脚本也要使用同样的代理环境) 155 | 156 | ```sh 157 | onecomic -s qq -id=505430 -c -1 --cookies-path="qq.json" 158 | ``` 159 | 160 | 若使用了cookie还是下载不了,需检查账号在站点浏览是否正常,若正常浏览则重新导出一份新的cookies文件再做尝试 161 | 162 | 若还是下载不了,请加群反馈,随缘修复 163 | 164 | ### Toomics、qootoon站点下载R18内容需要配置cookie 165 | 166 | ### 站点域名修改了,样式没有变化 167 | 168 | 可以通过`--site-index`参数指定新域名,或参考配置文件修改 169 | 170 | ```sh 171 | onecomic -s gufengmh --site-index="https://www.gufengmh9.com/" 172 | ``` 173 | 174 | ### 运行报错 175 | 176 | 运行的时候报错 177 | 178 | ``` 179 | Traceback (most recent call last): 180 | File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main 181 | return _run_code(code, main_globals, None, 182 | File "/usr/lib/python3.10/runpy.py", line 86, in _run_code 183 | exec(code, run_globals) 184 | File "/home/xxxx/.local/lib/python3.10/site-packages/onecomic/__main__.py", line 3, in 185 | from .cli import main 186 | File "/home/xxxx/.local/lib/python3.10/site-packages/onecomic/cli.py", line 6, in 187 | from .comicbook import ComicBook 188 | File "/home/xxxx/.local/ 189 | lib/python3.10/site-packages/onecomic/comicbook.py", line 19, in 190 | from .crawlerbase import CrawlerBase 191 | File "/home/xxxx/.local/lib/python3.10/site-packages/onecomic/crawlerbase.py", line 12, in 192 | from .session import CrawlerSession 193 | File "/home/xxxx/.local/lib/python3.10/site-packages/onecomic/session.py", line 4, in 194 | import httpx 195 | File "/home/xxxx/.local/lib/python3.10/site-packages/httpx/__init__.py", line 2, in 196 | from ._api import delete, get, head, options, patch, post, put, request, stream 197 | File "/home/xxxx/.local/lib/python3.10/site-packages/httpx/_api.py", line 4, in 198 | from ._client import Client 199 | File "/home/xxxx/.local/lib/python3.10/site-packages/httpx/_client.py", line 29, in 200 | from ._transports.default import AsyncHTTPTransport, HTTPTransport 201 | File "/home/xxxx/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 30, in 202 | import httpcore 203 | File "/home/xxxx/.local/lib/python3.10/site-packages/httpcore/__init__.py", line 1, in 204 | from ._api import request, stream 205 | File "/home/xxxx/.local/lib/python3.10/site-packages/httpcore/_api.py", line 5, in 206 | from ._sync.connection_pool import ConnectionPool 207 | File "/home/xxxx/.local/lib/python3.10/site-packages/httpcore/_sync/__init__.py", line 8, in 208 | from .http2 import HTTP2Connection 209 | File "/home/xxxx/.local/lib/python3.10/site-packages/httpcore/_sync/http2.py", line 7, in 210 | import h2.connection 211 | File "/home/xxxx/.local/lib/python3.10/site-packages/h2/connection.py", line 13, in 212 | from hyperframe.frame import ( 213 | File "/home/xxxx/.local/lib/python3.10/site-packages/hyperframe/frame.py", line 17, in 214 | from .flags import Flag, Flags 215 | File "/home/xxxx/.local/lib/python3.10/site-packages/hyperframe/flags.py", line 14, in 216 | class Flags(collections.MutableSet): 217 | AttributeError: module 'collections' has no attribute 'MutableSet' 218 | ``` 219 | 或者 220 | ``` 221 | Traceback (most recent call last): 222 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/onecomic/crawlerbase.py", line 257, in send_request 223 | response = session.request(method=method, url=url, **kwargs) 224 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_client.py", line 827, in request 225 | return self.send(request, auth=auth, follow_redirects=follow_redirects) 226 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_client.py", line 914, in send 227 | response = self._send_handling_auth( 228 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_client.py", line 942, in _send_handling_auth 229 | response = self._send_handling_redirects( 230 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_client.py", line 979, in _send_handling_redirects 231 | response = self._send_single_request(request) 232 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_client.py", line 1015, in _send_single_request 233 | response = transport.handle_request(request) 234 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_transports/default.py", line 233, in handle_request 235 | resp = self._pool.handle_request(req) 236 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request 237 | raise exc from None 238 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request 239 | response = connection.handle_request( 240 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/httpcore/_sync/connection.py", line 101, in handle_request 241 | return self._connection.handle_request(request) 242 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/httpcore/_sync/http2.py", line 113, in handle_request 243 | raise exc 244 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/httpcore/_sync/http2.py", line 109, in handle_request 245 | self._send_connection_init(**kwargs) 246 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/httpcore/_sync/http2.py", line 211, in _send_connection_init 247 | h2.settings.SettingCodes.ENABLE_CONNECT_PROTOCOL 248 | File "/home/xxxx/anaconda3/lib/python3.11/enum.py", line 784, in __getattr__ 249 | raise AttributeError(name) from None 250 | AttributeError: ENABLE_CONNECT_PROTOCOL 251 | 252 | The above exception was the direct cause of the following exception: 253 | 254 | Traceback (most recent call last): 255 | File "/home/xxxx/anaconda3/bin/onecomic", line 4, in 256 | main() 257 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/onecomic/cli.py", line 446, in main 258 | comicbook.start_crawler() 259 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/onecomic/comicbook.py", line 97, in start_crawler 260 | self.refresh() 261 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/onecomic/comicbook.py", line 100, in refresh 262 | self.comicbook_item = self.crawler.get_comicbook_item() 263 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/onecomic/site/bilibili.py", line 124, in get_comicbook_item 264 | api_data = self.get_api_data() 265 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/onecomic/site/bilibili.py", line 115, in get_api_data 266 | response = self.send_request("POST", url=self.COMICBOOK_API, data=data) 267 | File "/home/xxxx/anaconda3/lib/python3.11/site-packages/onecomic/crawlerbase.py", line 267, in send_request 268 | raise URLException(msg) from e 269 | onecomic.exceptions.URLException: NETWORK ERROR. can not open url: https://manga.bilibili.com/twirp/comic.v1.Comic/ComicDetail?device=pc&platform=web 270 | ``` 271 | 272 | 如遇到以上报错,可以尝试升级一下这个依赖包解决 273 | ``` 274 | python3 -m pip install -U h2 275 | ``` 276 | -------------------------------------------------------------------------------- /docs/source/onecomic-api.md: -------------------------------------------------------------------------------- 1 | # 一本漫画API 2 | 3 | **尊重版权,请支持正版** 4 | 5 | **该项目仅供技术研究使用,请勿用于非法用途,否则后果自负** 6 | 7 | **通过本工具下载或生成的资源禁止传播分享!禁止利用该项目从事营利性活动!** 8 | 9 | 项目地址: [https://github.com/hardwarecode/onecomic-api](https://github.com/hardwarecode/onecomic-api) 10 | 11 | ## 接口部署 12 | 13 | 自己找安装Python的教程(Python版本大于等于3.6) 14 | 15 | 安装nodejs环境 16 | 17 | ```sh 18 | git clone git@github.com:hardwarecode/onecomic-api.git 19 | 20 | # 切换工作目录 21 | cd onecomic-api 22 | 23 | # 安装依赖 24 | pip install -r requirements.txt 25 | 26 | # 复制`api/config.py.example`并命名为`api/config.py` 并根据实际情况修改`api/config.py`的参数 27 | # 注意配置 api/config.py NODE_MODULES 28 | cp api/config.py.example api/config.py 29 | 30 | # 启动接口 31 | gunicorn 'api:create_app()' -b "127.0.0.1:8000" --workers=2 --timeout=10 32 | 33 | # 查看可选的配置选项 gunicorn --help 34 | # 文档 http://docs.gunicorn.org/en/latest/settings.html 35 | ``` 36 | 37 | 更新 38 | ```sh 39 | # 只更新onecomic(修复bug、添加更多的源等) 40 | pip install -U onecomic 41 | 42 | # 更新项目。注意`api/config.py.example`有无新增的配置,如果有的话需要重新配置`api/config.py` 43 | git pull 44 | pip install -U onecomic 45 | pip install -r requirements.txt 46 | ``` 47 | 48 | ## 接口文档 49 | 50 | ### 1.1 获取漫画概要信息 51 | 52 | `GET /api//comic/` 53 | 54 | 请求示例 55 | ```sh 56 | curl "http://127.0.0.1:8000/api/bilibili/comic/24742" 57 | ``` 58 | 59 | ```json 60 | { 61 | "author": "尾田荣一郎 集英社", 62 | "chapters": [ 63 | { 64 | "chapter_number": 1, 65 | "source_url": "https://manga.bilibili.com/m/mc24742/218087", 66 | "title": "ROMANCE DAWN冒险的序幕" 67 | }, 68 | { 69 | "chapter_number": 2, 70 | "source_url": "https://manga.bilibili.com/m/mc24742/218093", 71 | "title": "戴草帽的路飞" 72 | } 73 | ], 74 | "cover_image_url": "http://i0.hdslb.com/bfs/manga-static/8cfad691e8717f8c189f2b5e93a39d272708f91a.jpg", 75 | "crawl_time": "2020-08-16 15:06:29", 76 | "desc": "【此漫画的翻译由版权方提供】拥有财富、名声、权力、这世界上的一切的男人 “海盗王”高路德·罗杰,在临死之前说了一句话,让全世界的人都涌向了大海。“想要我的财宝吗?想要的话,就去拿吧,我把世界上的一切都放在了那里!”,这个世界迎来了“大海盗时代”。", 77 | "name": "航海王", 78 | "source_name": "哔哩哔哩漫画", 79 | "site": "bilibili", 80 | "source_url": "https://manga.bilibili.com/m/detail/mc24742", 81 | "tag": "奇幻,热血,冒险", 82 | "ext_chapters": [ 83 | { 84 | "ext_name": "番外篇", 85 | "chapters": [] 86 | } 87 | ], 88 | "comicid": "24742", 89 | "tags": [ 90 | { 91 | "name":"奇幻", 92 | "tag":"style_id_998" 93 | }, 94 | { 95 | "name":"热血", 96 | "tag":"style_id_999" 97 | }, 98 | { 99 | "name":"冒险", 100 | "tag":"style_id_1013" 101 | } 102 | ] 103 | } 104 | ``` 105 | 106 | - `tags`: 可用于标签搜索,如 `http://127.0.0.1:8000/api/bilibili/list?tag=style_id_998&page=1` 107 | 108 | ------ 109 | 110 | ### 1.2 获取章节详情 111 | 112 | `GET /api//comic//` 113 | 114 | 请求示例 115 | ```sh 116 | curl "http://127.0.0.1:8000/api/bilibili/comic/24742/1" 117 | 118 | # 获取单行本第一卷 119 | curl "http://127.0.0.1:8000/api/manhuagui/comic/1128/1?ext_name=单行本" 120 | ``` 121 | 122 | ```json 123 | { 124 | "chapter_number": 1, 125 | "image_urls": [ 126 | "https://i0.hdslb.com/bfs/manga/a978a1834b3ad58fad020e56aaac9faaa0aa941a.jpg?token=73441250b03e3f16%3ANyuRMmMH4QSq3VoxAtaxG5yw%2Bd0%3D%3A1597561590", 127 | "https://i0.hdslb.com/bfs/manga/535548cebdd5d96cfa87247f07171ccebfa1efa7.jpg?token=73441250b03e3f16%3Awk76wOeUd7daRpAfc%2FHSs1Qkql0%3D%3A1597561590", 128 | "https://i0.hdslb.com/bfs/manga/f6e50a5bdd38af33c152f7929ee63325b519bfdc.jpg?token=73441250b03e3f16%3Ad57MJZIADxnHC%2FG9TkOIvlK1pLU%3D%3A1597561590" 129 | ], 130 | "source_url": "https://manga.bilibili.com/m/mc24742/218087", 131 | "title": "ROMANCE DAWN冒险的序幕", 132 | "source_name": "哔哩哔哩漫画", 133 | "site": "bilibili", 134 | "comicid": "24742", 135 | } 136 | ``` 137 | 138 | ------ 139 | 140 | ### 1.3 搜索接口 141 | 142 | `GET /api//search?name={name}&page={page}` 143 | 144 | 请求示例 145 | 146 | ```sh 147 | curl "http://127.0.0.1:8000/api/qq/search?name=海贼&page=1" 148 | ``` 149 | 150 | ```json 151 | { 152 | "search_result":[ 153 | { 154 | "comicid":"505430", 155 | "cover_image_url":"https://manhua.qpic.cn/vertical/0/17_16_48_0e28c8aabf48e91d395689b5f6a7689f.jpg/420", 156 | "name":"航海王", 157 | "source_url":"https://ac.qq.com/Comic/ComicInfo/id/505430", 158 | "source_name": "腾讯漫画", 159 | "site": "qq", 160 | }, 161 | { 162 | "comicid":"531616", 163 | "cover_image_url":"https://manhua.qpic.cn/vertical/0/17_17_06_cb4ba7f7af603a3380bb1e5ed415804b.jpg/420", 164 | "name":"航海王(番外篇)", 165 | "source_url":"https://ac.qq.com/Comic/ComicInfo/id/531616", 166 | "source_name": "腾讯漫画", 167 | "site": "qq", 168 | } 169 | ] 170 | } 171 | ``` 172 | 173 | ------ 174 | 175 | ### 1.4 获取最近更新 176 | 177 | 178 | `GET /api//latest?page={page}` 179 | 180 | 请求示例 181 | 182 | ```sh 183 | curl "http://127.0.0.1:8000/api/qq/latest?page=1" 184 | ``` 185 | 186 | ```json 187 | { 188 | "latest":[ 189 | { 190 | "comicid":"505430", 191 | "cover_image_url":"https://manhua.qpic.cn/vertical/0/17_16_48_0e28c8aabf48e91d395689b5f6a7689f.jpg/420", 192 | "name":"航海王", 193 | "source_url":"https://ac.qq.com/Comic/ComicInfo/id/505430", 194 | "source_name": "腾讯漫画", 195 | "site": "qq", 196 | } 197 | ] 198 | } 199 | ``` 200 | 201 | ### 1.5 获取所有tag 202 | 203 | `GET /api//tags` 204 | 205 | 请求示例 206 | 207 | ```sh 208 | curl "http://127.0.0.1:8000/api/qq/tags" 209 | ``` 210 | 211 | ```json 212 | { 213 | "tags":[ 214 | { 215 | "category":"属性", 216 | "tags":[ 217 | { 218 | "name":"全部", 219 | "tag":"" 220 | }, 221 | { 222 | "name":"付费", 223 | "tag":"vip_2" 224 | }, 225 | { 226 | "name":"免费", 227 | "tag":"vip_1" 228 | } 229 | ] 230 | }, 231 | { 232 | "category":"进度", 233 | "tags":[ 234 | { 235 | "name":"全部", 236 | "tag":"" 237 | }, 238 | { 239 | "name":"连载", 240 | "tag":"finish_1" 241 | }, 242 | { 243 | "name":"完结", 244 | "tag":"finish_2" 245 | } 246 | ] 247 | }, 248 | { 249 | "category":"标签", 250 | "tags":[ 251 | { 252 | "name":"恋爱", 253 | "tag":"theme_105" 254 | }, 255 | { 256 | "name":"玄幻", 257 | "tag":"theme_101" 258 | } 259 | ] 260 | } 261 | ] 262 | } 263 | ``` 264 | 265 | ### 1.6 根据tag搜索 266 | 267 | `GET /api//list?tag={tag}&page={page}` 268 | 269 | 请求示例 270 | 271 | ```sh 272 | # 多个标签搜索不一定支持 273 | curl "http://127.0.0.1:8000/api/qq/list?tag=theme_105,finish_2&page=1" 274 | ``` 275 | 276 | ```json 277 | { 278 | "list":[ 279 | { 280 | "comicid":"623251", 281 | "cover_image_url":"https://manhua.qpic.cn/vertical/0/12_20_16_eefe809e406d5076dd13012d48869f89_1499861764052.jpg/420", 282 | "name":"出柜通告", 283 | "site":"qq", 284 | "source_name":"腾讯漫画", 285 | "source_url":"https://ac.qq.com/Comic/ComicInfo/id/623251", 286 | "status":"" 287 | }, 288 | { 289 | "comicid":"642093", 290 | "cover_image_url":"https://manhua.qpic.cn/vertical/0/27_15_21_78309f29cd87c7cc377394e7eff7451a_1558941691349.jpg/420", 291 | "name":"早安,亿万萌妻", 292 | "site":"qq", 293 | "source_name":"腾讯漫画", 294 | "source_url":"https://ac.qq.com/Comic/ComicInfo/id/642093", 295 | "status":"" 296 | } 297 | ] 298 | } 299 | ``` 300 | 301 | ### 1.7 聚合搜索 302 | 303 | `GET /aggregate/search?name={name}&site={site}` 304 | 305 | 请求示例 306 | 307 | ```sh 308 | curl "http://127.0.0.1:8000/aggregate/search?name=海贼&site=bilibili,u17" 309 | ``` 310 | 311 | ```json 312 | { 313 | "list":[ 314 | { 315 | "comicid":24742, 316 | "cover_image_url":"http://i0.hdslb.com/bfs/manga-static/7bcf22ed4904a4346c7aa33887be0e6540d5908f.png", 317 | "name":"航海王", 318 | "site":"bilibili", 319 | "source_name":"哔哩哔哩漫画", 320 | "source_url":"https://manga.bilibili.com/m/detail/mc24742", 321 | "status":"连载" 322 | }, 323 | { 324 | "comicid":"53210", 325 | "cover_image_url":"https://cover.u17i.com/2016/06/3531898_1465634794_j1xJ1WwX0zh3.small.jpg", 326 | "name":"当火影遇上海贼", 327 | "site":"u17", 328 | "source_name":"有妖气", 329 | "source_url":"https://www.u17.com/comic/53210.html", 330 | "status":"" 331 | } 332 | ] 333 | } 334 | ``` 335 | ### 1.8 根据url获取comicid 336 | 337 | `GET /tools/urlinfo` 338 | 339 | 请求示例 340 | 341 | ```sh 342 | curl "http://127.0.0.1:8000/tools/urlinfo?url=https://www.u17.com/comic/53210.html" 343 | ``` 344 | 345 | ```json 346 | { 347 | "comicid": "53210", 348 | "site": "u17", 349 | "url": "https://www.u17.com/comic/53210.html" 350 | } 351 | ``` 352 | ### 1.9 获取所有可用的站点配置 353 | 354 | `GET /crawler/config` 355 | 356 | ```sh 357 | curl "http://127.0.0.1:8000/crawler/config" 358 | ``` 359 | 360 | ```json 361 | { 362 | "configs": [ 363 | { 364 | "r18": false, 365 | "site": "acg456", 366 | "source_index": "http://www.acg456.com/", 367 | "source_name": "ACG肆伍陆" 368 | }, 369 | { 370 | "r18": false, 371 | "site": "bilibili", 372 | "source_index": "https://manga.bilibili.com/", 373 | "source_name": "哔哩哔哩漫画" 374 | }, 375 | ... 376 | ] 377 | } 378 | ``` 379 | 380 | ### 2.0 API管理相关 381 | 382 | **2.x 下的接口,只是实验功能,只能用于单点,多点部署的话不适用** 383 | 384 | **2.x 下面的接口,需要登录校验,用户名和密码可以在`config.py`中的`USERS`配置,若留空则不用验证** 385 | 386 | **登录**: `POST /user/login?next=` 387 | 388 | - username: 用户名 389 | - password: 密码 390 | 391 | **登出**: `GET /user/logout?next=` 392 | 393 | **获取用户信息**: `GET /user/info` 394 | 395 | 396 | ### 2.1 添加到异步任务 397 | 398 | `GET /manage/task/add` 399 | 400 | - site: 站点 401 | - comicid: 漫画id 402 | - params: json字符串 403 | ```json 404 | { 405 | "chapters": "1,2,3", 406 | "is_download_all": true, 407 | "is_gen_pdf": true, 408 | "is_gen_zip": true, 409 | "is_single_image": true, 410 | "quality": 95, 411 | "is_send_mail": true, 412 | "receivers": "123@qq.com,456@qq.com" 413 | } 414 | ``` 415 | - chapters: 下载的章节数 默认下载最新一集 416 | - is_download_all: 是否下载全部 默认否 417 | - is_gen_pdf: 是否生成pdf文件 默认否 418 | - is_gen_zip: 是否生成zip文件 默认否 419 | - is_single_image: 是否生成单图文件 默认否 420 | - quality: 生成的单图图片质量 默认95 421 | - is_send_mail: 是否发送邮件 默认否 422 | - receivers: 邮件接收者,多个以逗号隔开,不传默认发送到配置文件里的收件人 423 | 424 | **注意**: 生成PDF需要安装额外依赖,`pip install img2pdf 或 pip install reportlab` 425 | 426 | 请求示例 427 | 428 | ```sh 429 | curl 'http://127.0.0.1:8000/manage/task/add?site=qq&comicid=505430¶ms={"chapters": "1","is_download_all":false}' 430 | ``` 431 | 432 | ```json 433 | { 434 | "data": { 435 | "comicid": "505430", 436 | "cost_time": 0, 437 | "create_time": "2020-11-27 21:17:18", 438 | "id": 1, 439 | "name": "航海王", 440 | "params": {}, 441 | "reason": "", 442 | "site": "qq", 443 | "start_time": "2020-11-27 21:17:18", 444 | "status": "运行中", 445 | "update_time": "2020-11-27 21:17:18" 446 | } 447 | } 448 | 449 | ``` 450 | 451 | 452 | ### 2.2 查看任务列表 453 | 454 | `GET /manage/task/list?page={page}` 455 | 456 | 若任务超过10min,任务状态还没变成完成/失败,可能需重新添加异步任务 457 | 458 | 请求示例 459 | 460 | ```sh 461 | curl "http://127.0.0.1:8000/manage/task/list?page=1" 462 | ``` 463 | 464 | 465 | ### 2.3 查看站点cookies 466 | `GET /manage/cookies/{site}` 467 | 468 | 请求示例 469 | 470 | ```sh 471 | curl "http://127.0.0.1:8000/manage/cookies/qq" 472 | ``` 473 | 474 | ### 2.4 更新站点cookies 475 | 476 | `POST /manage/cookies/{site}` 477 | 478 | 479 | 请求示例 480 | 481 | ```sh 482 | curl -XPOST "http://127.0.0.1:8000/manage/cookies/qq" \ 483 | -H "Content-Type: application/json" -d \ 484 | '{ 485 | "cookies": [ 486 | { 487 | "domain": ".ac.qq.com", 488 | "name": "xxx", 489 | "path": "/", 490 | "secure": false, 491 | "value": "1604080000" 492 | } 493 | ], 494 | "cover": false 495 | }' 496 | ``` 497 | 498 | - `cover`: 可选参数,是否覆盖,默认不覆盖 499 | 500 | 501 | ### 2.5 查看站点代理配置 502 | 503 | `GET /manage/proxy/{site}` 504 | 505 | 请求示例 506 | 507 | ```sh 508 | curl "http://127.0.0.1:8000/manage/proxy/qq" 509 | ``` 510 | 511 | 512 | ### 2.6 设置站点代理 513 | 514 | `GET /manage/proxy/{site}?proxy={proxy}` 515 | 516 | 请求示例 517 | 518 | ```sh 519 | curl "http://127.0.0.1:8000/manage/proxy/wnacg?proxy=socks5://127.0.0.1:1080" 520 | ``` 521 | --------------------------------------------------------------------------------