mirror of
https://github.com/hect0x7/JMComic-Crawler-Python.git
synced 2025-11-04 14:49:43 +08:00
优化GitHub Actions工作流 (#156)
This commit is contained in:
parent
f4493cb5cd
commit
f2c255e061
1
.github/workflows/download.yml
vendored
1
.github/workflows/download.yml
vendored
@ -41,7 +41,6 @@ jobs:
|
|||||||
pip install -e ./
|
pip install -e ./
|
||||||
|
|
||||||
- name: 运行下载脚本
|
- name: 运行下载脚本
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
run: |
|
||||||
cd ./usage/
|
cd ./usage/
|
||||||
python workflow_download.py
|
python workflow_download.py
|
||||||
|
|||||||
16
.github/workflows/download_dispatch.yml
vendored
16
.github/workflows/download_dispatch.yml
vendored
@ -13,15 +13,21 @@ on:
|
|||||||
description: 章节id(单独下载章节,多个id同上)
|
description: 章节id(单独下载章节,多个id同上)
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
DIR_RULE:
|
CLIENT_IMPL:
|
||||||
type: string
|
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: ''
|
default: ''
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
CLIENT_IMPL:
|
DIR_RULE:
|
||||||
type: string
|
type: string
|
||||||
description: 客户端类型(client.impl),[api]=移动端,[html]=网页端,此处可以不填,默认使用'html'。如果你发现默认的下载不了,可以填api试试。
|
description: 下载文件夹规则(dir_rule.rule)。此处可以不填,默认使用配置文件的'Bd_Aauthor_Atitle_Pindex'。
|
||||||
default: ''
|
default: ''
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
@ -61,6 +67,7 @@ jobs:
|
|||||||
CLIENT_IMPL: ${{ github.event.inputs.CLIENT_IMPL }}
|
CLIENT_IMPL: ${{ github.event.inputs.CLIENT_IMPL }}
|
||||||
ZIP_NAME: ${{ github.event.inputs.ZIP_NAME }}
|
ZIP_NAME: ${{ github.event.inputs.ZIP_NAME }}
|
||||||
UPLOAD_NAME: ${{ github.event.inputs.UPLOAD_NAME }}
|
UPLOAD_NAME: ${{ github.event.inputs.UPLOAD_NAME }}
|
||||||
|
IMAGE_SUFFIX: ${{ github.event.inputs.IMAGE_SUFFIX }}
|
||||||
# secrets
|
# secrets
|
||||||
JM_USERNAME: ${{ secrets.JM_USERNAME }}
|
JM_USERNAME: ${{ secrets.JM_USERNAME }}
|
||||||
JM_PASSWORD: ${{ secrets.JM_PASSWORD }}
|
JM_PASSWORD: ${{ secrets.JM_PASSWORD }}
|
||||||
@ -90,7 +97,6 @@ jobs:
|
|||||||
pip install -e ./
|
pip install -e ./
|
||||||
|
|
||||||
- name: 运行下载脚本
|
- name: 运行下载脚本
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
run: |
|
||||||
cd ./usage/
|
cd ./usage/
|
||||||
python workflow_download.py
|
python workflow_download.py
|
||||||
|
|||||||
@ -1,12 +1,7 @@
|
|||||||
from jmcomic import *
|
from jmcomic import *
|
||||||
from jmcomic.cl import get_env, JmcomicUI
|
from jmcomic.cl import get_env, JmcomicUI
|
||||||
|
|
||||||
# 下方填入你要下载的本子的id,一行一个。
|
# 下方填入你要下载的本子的id,一行一个,每行的首尾可以有空白字符
|
||||||
# 每行的首尾可以有空白字符
|
|
||||||
# 你也可以填入本子网址,程序会识别出本子id
|
|
||||||
# 例如:
|
|
||||||
# [https://18comic.vip/album/452859/mana-ディシア-1-原神-中国語-無修正] -> [452859]
|
|
||||||
#
|
|
||||||
jm_albums = '''
|
jm_albums = '''
|
||||||
|
|
||||||
|
|
||||||
@ -17,6 +12,7 @@ jm_albums = '''
|
|||||||
jm_photos = '''
|
jm_photos = '''
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
@ -68,11 +64,10 @@ def cover_option_config(option: JmOption):
|
|||||||
impl = get_env('CLIENT_IMPL', None)
|
impl = get_env('CLIENT_IMPL', None)
|
||||||
if impl is not None:
|
if impl is not None:
|
||||||
option.client.impl = impl
|
option.client.impl = impl
|
||||||
else:
|
|
||||||
impl = option.client.impl
|
|
||||||
|
|
||||||
if impl == 'api':
|
suffix = get_env('IMAGE_SUFFIX', None)
|
||||||
option.client.domain = JmModuleConfig.DOMAIN_API_LIST
|
if suffix is not None:
|
||||||
|
option.download.image.suffix = fix_suffix(suffix)
|
||||||
|
|
||||||
|
|
||||||
def login_if_configured(option):
|
def login_if_configured(option):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user