diff --git a/.github/workflows/download_dispatch.yml b/.github/workflows/download_dispatch.yml index c45f94f49..c5496235f 100644 --- a/.github/workflows/download_dispatch.yml +++ b/.github/workflows/download_dispatch.yml @@ -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' 表示网页端。 @@ -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 }} diff --git a/usage/workflow_download.py b/usage/workflow_download.py index dea02af81..8ac106332 100644 --- a/usage/workflow_download.py +++ b/usage/workflow_download.py @@ -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()