{"id":19024471,"url":"https://github.com/hect0x7/jmcomic-crawler-python","last_synced_at":"2026-02-20T10:05:07.118Z","repository":{"id":150120271,"uuid":"622576337","full_name":"hect0x7/JMComic-Crawler-Python","owner":"hect0x7","description":"Python API for JMComic | 提供Python API访问禁漫天堂，同时支持网页端和移动端 | 禁漫天堂GitHub Actions下载器🚀","archived":false,"fork":false,"pushed_at":"2025-04-22T12:34:22.000Z","size":1571,"stargazers_count":2669,"open_issues_count":3,"forks_count":5616,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-22T14:59:14.969Z","etag":null,"topics":["18comic","crawler","downloader","github-actions","jmcomic","pypi","python","readthedocs"],"latest_commit_sha":null,"homepage":"https://jmcomic.readthedocs.io/zh-cn/latest/option_file_syntax/#","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hect0x7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-02T14:21:48.000Z","updated_at":"2025-04-22T13:27:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a7b0b01-a6a5-425b-8139-8b6cb3eeb80b","html_url":"https://github.com/hect0x7/JMComic-Crawler-Python","commit_stats":null,"previous_names":[],"tags_count":117,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hect0x7%2FJMComic-Crawler-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hect0x7%2FJMComic-Crawler-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hect0x7%2FJMComic-Crawler-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hect0x7%2FJMComic-Crawler-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hect0x7","download_url":"https://codeload.github.com/hect0x7/JMComic-Crawler-Python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252735815,"owners_count":21796271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["18comic","crawler","downloader","github-actions","jmcomic","pypi","python","readthedocs"],"created_at":"2024-11-08T20:36:52.953Z","updated_at":"2026-02-03T17:09:06.863Z","avatar_url":"https://github.com/hect0x7.png","language":"Python","readme":"\u003c!-- 顶部标题 \u0026 统计徽章 --\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ch1 style=\"margin-top: 0\" align=\"center\"\u003ePython API for JMComic\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n  \u003cstrong\u003e提供 Python API 访问禁漫天堂（网页端 \u0026 移动端），集成 GitHub Actions 下载器🚀\u003c/strong\u003e\n  \u003c/p\u003e\n\n[![GitHub](https://img.shields.io/badge/-GitHub-181717?logo=github)](https://github.com/hect0x7)\n[![Stars](https://img.shields.io/github/stars/hect0x7/JMComic-Crawler-Python?color=orange\u0026label=stars\u0026style=flat)](https://github.com/hect0x7/JMComic-Crawler-Python/stargazers)\n[![Forks](https://img.shields.io/github/forks/hect0x7/JMComic-Crawler-Python?color=green\u0026label=forks\u0026style=flat)](https://github.com/hect0x7/JMComic-Crawler-Python/forks)\n[![GitHub latest releases](https://img.shields.io/github/v/release/hect0x7/JMComic-Crawler-Python?color=blue\u0026label=version)](https://github.com/hect0x7/JMComic-Crawler-Python/releases/latest)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/jmcomic?style=flat\u0026color=hotpink)](https://pepy.tech/projects/jmcomic)\n[![Licence](https://img.shields.io/github/license/hect0x7/JMComic-Crawler-Python?color=red)](https://github.com/hect0x7/JMComic-Crawler-Python)\n\n\u003c/div\u003e\n\n\n\n\n\u003e 本项目封装了一套可用于爬取JM的Python API.\n\u003e \n\u003e 你可以通过简单的几行Python代码，实现下载JM上的本子到本地，并且是处理好的图片。\n\u003e \n\u003e **友情提示：珍爱JM，为了减轻JM的服务器压力，请不要一次性爬取太多本子，西门🙏🙏🙏**.\n\n[【指路】教程：使用GitHub Actions下载禁漫本子](./assets/docs/sources/tutorial/1_github_actions.md)\n\n[【指路】教程：导出并下载你的禁漫收藏夹数据](./assets/docs/sources/tutorial/10_export_favorites.md)\n\n\n![introduction.jpg](./assets/docs/sources/images/introduction.jpg)\n\n\n## 项目介绍\n\n本项目的核心功能是下载本子。\n\n基于此，设计了一套方便使用、便于扩展，能满足一些特殊下载需求的框架。\n\n目前核心功能实现较为稳定，项目也处于维护阶段。\n\n除了下载功能以外，也实现了其他的一些禁漫接口，按需实现。目前已有功能：\n\n- 登录\n- 搜索本子（支持所有搜索项）\n- 图片下载解码\n- 分类/排行榜\n- 本子/章节详情\n- 个人收藏夹\n- 接口加解密（APP的接口）\n\n## 安装教程\n\n\u003e ⚠如果你没有安装过Python，需要先安装Python再执行下面的步骤，且版本需要\u003e=3.7（[点我去python官网下载](https://www.python.org/downloads/)）\n\n* 通过pip官方源安装（推荐，并且更新也是这个命令）\n\n  ```shell\n  pip install jmcomic -i https://pypi.org/project -U\n  ```\n* 通过源代码安装\n\n  ```shell\n  pip install git+https://github.com/hect0x7/JMComic-Crawler-Python\n  ```\n\n## 快速上手\n\n### 1. 下载本子方法\n\n只需要使用如下代码，就可以下载本子`JM123`的所有章节的图片：\n\n```python\nimport jmcomic  # 导入此模块，需要先安装.\njmcomic.download_album('123')  # 传入要下载的album的id，即可下载整个album到本地.\n```\n\n上面的 `download_album`方法还有一个参数`option`，可用于控制下载配置，配置包括禁漫域名、网络代理、图片格式转换、插件等等。\n\n你可能需要这些配置项。推荐使用配置文件创建option，用option下载本子，见下章：\n\n### 2. 使用option配置来下载本子\n\n1. 首先，创建一个配置文件，假设文件名为 `option.yml`\n\n   该文件有特定的写法，你需要参考这个文档 → [配置文件指南](./assets/docs/sources/option_file_syntax.md)\n\n   下面做一个演示，假设你需要把下载的图片转为png格式，你应该把以下内容写进`option.yml`\n\n```yml\ndownload:\n  image:\n    suffix: .png # 该配置用于把下载的图片转为png格式\n```\n\n2. 第二步，运行下面的python代码\n\n```python\nimport jmcomic\n\n# 创建配置对象\noption = jmcomic.create_option_by_file('你的配置文件路径，例如 D:/option.yml')\n# 使用option对象来下载本子\njmcomic.download_album(123, option)\n# 等价写法: option.download_album(123)\n```\n\n### 3. 使用命令行\n\u003e 如果只想下载本子，使用命令行会比上述方式更加简单直接\n\u003e \n\u003e 例如，在windows上，直接按下win+r键，输入jmcomic xxx就可以下载本子。\n\n示例：\n\n下载本子123的命令\n\n```sh\njmcomic 123\n```\n同时下载本子123, 章节456的命令\n```sh\njmcomic 123 p456\n```\n\n命令行模式也支持自定义option，你可以使用环境变量或者命令行参数：\n\na. 通过命令行--option参数指定option文件路径\n\n```sh\njmcomic 123 --option=\"D:/a.yml\"\n```\n\nb. 配置环境变量 `JM_OPTION_PATH` 为option文件路径（推荐）\n\n\u003e 请自行google配置环境变量的方式，或使用powershell命令:  `setx JM_OPTION_PATH \"D:/a.yml\"` 重启后生效\n\n```sh\njmcomic 123\n```\n\n\n\n## 进阶使用\n\n请查阅文档首页→[jmcomic.readthedocs.io](https://jmcomic.readthedocs.io/zh-cn/latest)\n\n（提示：jmcomic提供了很多下载配置项，大部分的下载需求你都可以尝试寻找相关配置项或插件来实现。）\n\n## 项目特点\n\n- **绕过Cloudflare的反爬虫**\n- **实现禁漫APP接口最新的加解密算法 (1.6.3)**\n- 用法多样：\n\n  - GitHub\n    Actions：网页上直接输入本子id就能下载（[教程：使用GitHub Actions下载禁漫本子](./assets/docs/sources/tutorial/1_github_actions.md)）\n  - 命令行：无需写Python代码，简单易用（[教程：使用命令行下载禁漫本子](./assets/docs/sources/tutorial/2_command_line.md)）\n  - Python代码：最本质、最强大的使用方式，需要你有一定的python编程基础\n- 支持**网页端**和**移动端**两种客户端实现，可通过配置切换（**移动端不限ip兼容性好，网页端限制ip地区但效率高**）\n- 支持**自动重试和域名切换**机制\n- **多线程下载**（可细化到一图一线程，效率极高）\n- **可配置性强**\n\n  - 不配置也能使用，十分方便\n  - 配置可以从配置文件生成，支持多种文件格式\n  - 配置点有：`请求域名` `客户端实现` `是否使用磁盘缓存` `同时下载的章节/图片数量` `图片格式转换` `下载路径规则` `请求元信息（headers,cookies,proxies)` `中文繁/简转换` \n    等\n- **可扩展性强**\n\n  - 支持自定义本子/章节/图片下载前后的回调函数\n  - 支持自定义类：`Downloader（负责调度）` `Option（负责配置）` `Client（负责请求）` `实体类`等\n  - 支持自定义日志、异常监听器\n  - **支持Plugin插件，可以方便地扩展功能，以及使用别人的插件，目前内置插件有**：\n    - `登录插件`\n    - `硬件占用监控插件`\n    - `只下载新章插件`\n    - `压缩文件插件`\n    - `下载特定后缀图片插件`\n    - `发送QQ邮件插件`\n    - `自动使用浏览器cookies插件`\n    - `导出收藏夹为csv文件插件`\n    - `合并所有图片为pdf文件插件`\n    - `合并所有图片为长图png插件`\n    - `重复文件检测删除插件`\n    - `网页观看本地章节插件`\n\n## 使用小说明\n\n* Python \u003e= 3.7，建议3.9以上，因为jmcomic的依赖库可能会不支持3.9以下的版本。\n* 个人项目，文档和示例会有不及时之处，可以Issue提问\n\n## 项目文件夹介绍\n\n* .github：GitHub Actions配置文件\n* assets：存放一些非代码的资源文件\n\n  * docs：项目文档\n  * option：存放配置文件\n* src：存放源代码\n\n  * jmcomic：`jmcomic`模块\n* tests：测试目录，存放测试代码，使用unittest\n* usage：用法目录，存放示例/使用代码\n\n## 感谢以下项目\n\n### 图片分割算法代码+禁漫移动端API\n\n\u003ca href=\"https://github.com/tonquer/JMComic-qt\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github-readme-stats.vercel.app/api/pin/?username=tonquer\u0026repo=JMComic-qt\u0026theme=radical\" /\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://github-readme-stats.vercel.app/api/pin/?username=tonquer\u0026repo=JMComic-qt\" /\u003e\n    \u003cimg alt=\"Repo Card\" src=\"https://github-readme-stats.vercel.app/api/pin/?username=tonquer\u0026repo=JMComic-qt\" /\u003e\n  \u003c/picture\u003e\n\u003c/a\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhect0x7%2Fjmcomic-crawler-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhect0x7%2Fjmcomic-crawler-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhect0x7%2Fjmcomic-crawler-python/lists"}