From e78da5c4433316fe7d60c3905184ba0ed644c2da Mon Sep 17 00:00:00 2001 From: ytshen Date: Fri, 2 Feb 2024 19:58:36 +0800 Subject: [PATCH] use repo name if xpi parsed name not found --- main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index e174de8..db400b6 100644 --- a/main.py +++ b/main.py @@ -52,8 +52,6 @@ def download_xpi(xpi_url: str, download_dir: str, unique_name: str, force_downlo def parse(plugin, **kwargs): if repo not in plugin or len(plugin[repo].split('/')) != 2 or releases not in plugin or len(plugin[releases]) <= 0: return - if name not in plugin: - plugin[name] = plugin[repo].split('/')[-1] headers = github_api_headers(github_token=kwargs.get('github_token')) @@ -184,6 +182,9 @@ def parse(plugin, **kwargs): print(f'handle {plugin[repo]} request {release_url} failed: {e}') plugin[releases] = release_infos + + if name not in plugin: + plugin[name] = plugin[repo].split('/')[-1] return plugin