Provide Python API to access JMComic (Web & Mobile), integrates GitHub Actions downloader🚀
This project encapsulates a Python API for crawling JM.
With a few simple lines of Python code, you can download albums from JM to your local machine, with properly processed images.
🧭 Quick Guide
- Tutorial: Downloading JM Albums using GitHub Actions
- Tutorial: Exporting and downloading your JM favorites data
- Tower Broadcast: Welcome captains to join and contribute code
Friendly Prompt: Cherish JM. In order to reduce the pressure on JM servers, please do not download too many albums at once 🙏🙏🙏.
The core function of this project is to download albums.
Based on this, an easy-to-use, highly extensible framework is designed to meet various download requirements.
Currently, the core functions are relatively stable, and the project is in the maintenance phase.
In addition to downloading, other JM interfaces are also implemented on demand. Existing features:
- Login
- Search albums (supports all search parameters)
- Image downloading and decoding
- Categories/Rankings
- Album/Chapter details
- Personal favorites
- Interface encryption and decryption (for the APP API)
⚠ If you have not installed Python, you must install Python before executing the following steps. Download from Python Official Site Version 3.12+ is recommended.
-
Install via official pip source (recommended, the update command is identical)
pip install jmcomic -U
-
Install from source code
pip install git+https://github.com/hect0x7/JMComic-Crawler-Python
All you need is the following code to download all chapter images of the album JM123:
import jmcomic # Import this module, you need to install it first.
jmcomic.download_album('123') # Pass the ID of the album to download the entire album locally.The download_album method above also accepts an option parameter to control the configuration, which includes JM domain names, network proxies, image format conversions, plugins, and more.
You might need these options. It is recommended to create an option instance from a configuration file and use it to download albums, as shown in the next section:
-
First, create a configuration file, let's say
option.ymlThis file uses a specific format, please refer to the documentation → Configuration File Guide
Here is a demonstration. Assuming you want to convert the downloaded images into
pngformat, you should write the following intooption.yml:
download:
image:
suffix: .png # This option converts the downloaded image to png format- Secondly, run the following Python code
import jmcomic
# Create configuration object
option = jmcomic.create_option_by_file('Path to your configuration file, e.g. D:/option.yml')
# Download the album using the option configured
jmcomic.download_album(123, option)
# Equivalent to: option.download_album(123)If your only goal is to download albums, using the command line is simpler and more straightforward.
For example, on Windows, press
Win + R, enterjmcomic xxx, and you can download the album.
Examples:
Command to download album 123:
jmcomic 123Command to download chapter 456 of album 123:
jmcomic 123 p456The command-line mode also supports custom options. You can use environment variables or command line arguments:
a. Specify the option file path via --option argument
jmcomic 123 --option="D:/a.yml"b. Set the environment variable JM_OPTION_PATH to the option file path (recommended)
Please Google how to configure environment variables. By using powershell:
setx JM_OPTION_PATH "D:/a.yml"(Requires a restart to take effect).
jmcomic 123Please check the documentation homepage → jmcomic.readthedocs.io (Chinese language)
(Tip: jmcomic provides many options. For most download requirements, you can find a corresponding configuration or plugin setup.)
-
Bypass Cloudflare anti-bot mechanisms
-
Implement the latest decryption logic for the JM APP API (1.6.3)
-
Multiple usages:
- GitHub Actions: Enter the album ID directly on the webpage to download (Tutorial: Download JM Albums using GitHub Actions)
- Command Line: No need to write Python code, easy to use (Tutorial: Download JM Albums by Command Line)
- Python Code: The most powerful usage, requiring basic Python programming knowledge
-
Supports both Web and Mobile implementations, switchable via configuration (Mobile is IP restriction-free and very compatible, Web restricts some IP regions but offers higher efficiency)
-
Built-in auto-retry and domain switching mechanisms
-
Multi-threaded downloading (can be fine-tuned to one-thread-per-image, greatly boosting speed)
-
Highly configurable
- Can work smoothly out of the box without configurations
- Supported formats to generate
Optioninstances - Configurable items include:
DomainsClientsDisk CachingConcurrent chapters/images downloadsFormat ConversionsPath rulesRequest Meta (headers, cookies, proxies)Simplified/Traditional Chinese Conversion, etc.
-
Highly Extensible
- Supports custom callbacks before/after downloading albums/chapters/images
- Customizable objects:
DownloaderOptionClientEntities, etc. - Supports custom logging and exception listener mechanics
- Embedded with powerful Plugins to easily extend features or inject others':
Login PluginHardware usage monitor pluginFilter-new-chapter pluginZip-files pluginClient proxy pluginSpecific image suffix format downloaderSend via QQ Mail pluginLog topic filter pluginAuto fetch browser cookies pluginExport favorites to CSV pluginMerge images into PDF pluginMerge images into Long png pluginLocal chapter web-viewer pluginSubscribe album update pluginSkip small chapters pluginDuplicate detection and deletion pluginPath string replacement pluginAdvanced retry pluginDownload cover plugin
-
Version 3.12+ is recommended, with a minimum compatible version of 3.9.
Note: Python 3.9 and earlier versions reached their End Of Life (EOL) in 2025. You may encounter third-party library incompatibilities at any time if you use version 3.9 or below.
-
Since this is a personal project, the documentation/examples may occasionally be out of sync. Please feel free to open an Issue for any clarifications.
.github: GitHub Actions configuration filesassets: Resources aside from pure codedocs: Documentationoption: Test/example configurations
src: Main code basejmcomic: Corejmcomicpackage
tests: Unit tests relying onunittestusage: Examples of usage implementations
