[v2.1.14]: 适配GitHub Actions脚本

This commit is contained in:
hect0x7 2023-08-22 17:04:54 +08:00
parent fb609f9b01
commit 277bc6d6d9
5 changed files with 11 additions and 16 deletions

View File

@ -38,7 +38,7 @@ jmcomic.download_album('422866') # 传入要下载的album的id即可下载
## 项目特点
- **绕过Cloudflare的反爬虫**
- 支持使用**Github Actions**下载漫画,不会编程都能用([教程使用Github Actions下载禁漫本子](./assets/docs/教程使用Github%20Actions下载禁漫本子.md)
- 支持使用**GitHub Actions**下载漫画,不会编程都能用([教程使用GitHub Actions下载禁漫本子](./assets/docs/教程使用GitHub%20Actions下载禁漫本子.md)
- **可配置性强**
- 不配置也能使用,十分方便
- 配置可以从**配置文件**生成支持多种文件格式无需写Python代码

View File

@ -1,2 +1,2 @@
# Github Actions 测试用
# GitHub Actions 测试用
version: '2.0'

View File

@ -1,11 +1,6 @@
# Github Actions 下载脚本配置
# GitHub Actions 下载脚本配置
version: '2.0'
dir_rule:
base_dir: /home/runner/work/jmcomic/download/
rule: Bd_Aauthor_Atitle_Pindex
client:
domain:
- 18comic.vip
- 18comic.org

View File

@ -1,10 +1,10 @@
# 教程使用Github Actions下载禁漫本子
# 教程使用GitHub Actions下载禁漫本子
一共需要三步:
1. fork一份我的代码仓库。
2. 填写你需要下载的本子id。
3. 等待Github Actions下载完成下载成品zip文件。
3. 等待GitHub Actions下载完成下载成品zip文件。
下面截图解析这三步的详细过程。
@ -48,9 +48,9 @@
上面有注释把你要下载的本子的id填入一行一个id前面可以带`JM`。
填完点提交会自动触发Github Actions下载这些本子。
填完点提交会自动触发GitHub Actions下载这些本子。
## 3. 等待Github Actions下载完成下载成品zip文件
## 3. 等待GitHub Actions下载完成下载成品zip文件
来到Actions页面选择最新的一次记录等待它完成。
@ -60,7 +60,7 @@
![4](./images/4.png)
如果你发现Github Actions显示❌表明出现了问题运行失败。
如果你发现GitHub Actions显示❌表明出现了问题运行失败。
下面是问题的排查步骤:

View File

@ -41,7 +41,7 @@ def get_option():
# 检查环境变量中是否有禁漫的用户名和密码,如果有则登录
# 禁漫的大部分本子,下载是不需要登录的,少部分敏感题材需要登录
# 如果你希望以登录状态下载本子你需要自己配置一下Github Actions的 `secrets`
# 如果你希望以登录状态下载本子你需要自己配置一下GitHub Actions的 `secrets`
# 配置的方式很简单,网页上点一点就可以了
# 具体做法请去看官方教程https://docs.github.com/en/actions/security-guides/encrypted-secrets
@ -58,7 +58,7 @@ def get_option():
def hook_debug(option):
from jmcomic import JmHtmlClient, workspace, mkdir_if_not_exists
from jmcomic import JmHtmlClient, workspace, mkdir_if_not_exists, JmModuleConfig
jm_download_dir = get_env('JM_DOWNLOAD_DIR') or workspace()
mkdir_if_not_exists(jm_download_dir)
@ -75,7 +75,7 @@ def hook_debug(option):
return super().raise_request_error(resp, msg)
option.jm_client_impl_mapping['html'] = RaiseErrorAwareClient
JmModuleConfig.CLASS_CLIENT_IMPL['html'] = RaiseErrorAwareClient
def get_env(name):