优化GitHub Actions工作流 (#156)

This commit is contained in:
hect0x7 2023-10-26 20:50:11 +08:00 committed by GitHub
parent f4493cb5cd
commit f2c255e061
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 16 deletions

View File

@ -41,7 +41,6 @@ jobs:
pip install -e ./
- name: 运行下载脚本
continue-on-error: true
run: |
cd ./usage/
python workflow_download.py

View File

@ -13,15 +13,21 @@ on:
description: 章节id单独下载章节多个id同上
required: false
DIR_RULE:
CLIENT_IMPL:
type: string
description: 下载文件夹规则dir_rule.rule。此处可以不填默认使用配置文件的'Bd_Aauthor_Atitle_Pindex'。
description: 客户端类型client.impl[api]=移动端,[html]=网页端。
default: 'api'
required: false
IMAGE_SUFFIX:
type: string
description: 图片后缀download.cache.suffix默认为空表示不做图片格式转换。可填入例如 "png" "jpg"。
default: ''
required: false
CLIENT_IMPL:
DIR_RULE:
type: string
description: 客户端类型client.impl[api]=移动端,[html]=网页端,此处可以不填,默认使用'html'。如果你发现默认的下载不了可以填api试试。
description: 下载文件夹规则dir_rule.rule。此处可以不填默认使用配置文件的'Bd_Aauthor_Atitle_Pindex'
default: ''
required: false
@ -61,6 +67,7 @@ jobs:
CLIENT_IMPL: ${{ github.event.inputs.CLIENT_IMPL }}
ZIP_NAME: ${{ github.event.inputs.ZIP_NAME }}
UPLOAD_NAME: ${{ github.event.inputs.UPLOAD_NAME }}
IMAGE_SUFFIX: ${{ github.event.inputs.IMAGE_SUFFIX }}
# secrets
JM_USERNAME: ${{ secrets.JM_USERNAME }}
JM_PASSWORD: ${{ secrets.JM_PASSWORD }}
@ -90,7 +97,6 @@ jobs:
pip install -e ./
- name: 运行下载脚本
continue-on-error: true
run: |
cd ./usage/
python workflow_download.py

View File

@ -1,12 +1,7 @@
from jmcomic import *
from jmcomic.cl import get_env, JmcomicUI
# 下方填入你要下载的本子的id一行一个。
# 每行的首尾可以有空白字符
# 你也可以填入本子网址程序会识别出本子id
# 例如:
# [https://18comic.vip/album/452859/mana-ディシア-1-原神-中国語-無修正] -> [452859]
#
# 下方填入你要下载的本子的id一行一个每行的首尾可以有空白字符
jm_albums = '''
@ -17,6 +12,7 @@ jm_albums = '''
jm_photos = '''
'''
@ -68,11 +64,10 @@ def cover_option_config(option: JmOption):
impl = get_env('CLIENT_IMPL', None)
if impl is not None:
option.client.impl = impl
else:
impl = option.client.impl
if impl == 'api':
option.client.domain = JmModuleConfig.DOMAIN_API_LIST
suffix = get_env('IMAGE_SUFFIX', None)
if suffix is not None:
option.download.image.suffix = fix_suffix(suffix)
def login_if_configured(option):