Skip to content
Closed

sync #563

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/download_dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
description: 章节id(单独下载章节,多个id同上)
required: false

JM_SEARCH:
type: string
description: 搜索关键字
required: false

CLIENT_IMPL:
type: string
description: 客户端类型(client.impl),下载失败时,你可以尝试填入此项重试。'api' 表示移动端,'html' 表示网页端。
Expand Down Expand Up @@ -72,6 +77,7 @@ jobs:
# 工作流输入
JM_ALBUM_IDS: ${{ github.event.inputs.JM_ALBUM_IDS }}
JM_PHOTO_IDS: ${{ github.event.inputs.JM_PHOTO_IDS }}
JM_SEARCH: ${{ github.event.inputs.JM_SEARCH }}
DIR_RULE: ${{ github.event.inputs.DIR_RULE }}
CLIENT_IMPL: ${{ github.event.inputs.CLIENT_IMPL }}
ZIP_NAME: ${{ github.event.inputs.ZIP_NAME }}
Expand Down
19 changes: 18 additions & 1 deletion usage/workflow_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,29 @@ def get_id_set(env_name, given):
return aid_set


def get_id_search():
ids = []
search = env('JM_SEARCH', '')
if search is None:
return ids
client = JmOption.default().new_jm_client()
page = client.search_site(search_query=search, page=1)
for i in range(0, len(page.content)):
album = page.getindex(i)
album_id, album_name = album
ids.append(album_id)
return ids


def main():
album_id_set = get_id_set('JM_ALBUM_IDS', jm_albums)
photo_id_set = get_id_set('JM_PHOTO_IDS', jm_photos)

ids = get_id_search()
ids.extend(list(album_id_set))

helper = JmcomicUI()
helper.album_id_list = list(album_id_set)
helper.album_id_list = ids
helper.photo_id_list = list(photo_id_set)

option = get_option()
Expand Down
Loading