diff --git a/README.md b/README.md index 5d2381f569a47d296dccac6e2b382fb573f0f50d..95e95479f4f3e9546b5891502fd13974b13cca33 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,25 @@ -本仓库为星火商店自动更新来自 Github Releases 的软件包提供配置,需要配合同组织的 github-downloader 下载工具使用。 +本仓库为星火商店自动更新来自 Github Releases 的软件包。 + +# Github Releases 更新下载 + +一个 Github Releases 更新下载器,依据 `github.json` 里预先定义的内容,自动检查 Github Releases 的更新情况,并按需下载指定文件。 + +此版本专用于星火商店 SBS(Spark Building Service),用于其他用途可以查看 [Github](https://github.com/wcbing/github-downloader) 版本。 + +## 用法 +``` +用法: github-downloader [-h] [-c CATEGORY] [-d DATA] [-o OUTPUT] [-p PROXY] [-t THREAD] [--dry-run] + +选项: + -h, --help 显示帮助信息 + -c, --category + 分类,用于包的保存路径 + -d, --data 读取仓库配置 + -o, --output 将文件保存到 ,默认为当前文件夹 + -p, --proxy Github 代理, 必须以 / 结尾 + -t, --thread 并发下载线程数量,默认为 5 + --dry-run 运行但不下载文件 +``` 运行样例: ```sh @@ -7,7 +28,7 @@ github-downloader ``` 或 ```sh -github-downloader -d store/tools/data -o store/tools +github-downloader -d store/tools/ -c tools ``` ## 配置说明 @@ -18,7 +39,9 @@ github-downloader -d store/tools/data -o store/tools { "软件包名1": { "repo": "<用户>/<仓库>", - "file_template": "文件名", + "file_list": { + "arch": "文件名" + }, "app.json": { "Name": "软件名称", "Author": "软件作者", @@ -33,8 +56,8 @@ github-downloader -d store/tools/data -o store/tools } ``` -- `file_template` -文件名模板,可包含以下变量。 +- `file_list` +各架构文件名模板列表。文件名可包含以下变量。 - `{version_tag}` 用于代替文件名中和 Releases Tag 相同的部分。 - `{stripped_version}` diff --git a/aarch64-store/chat/github.json b/aarch64-store/chat/github.json deleted file mode 100644 index 16cbe67e2d22a55f66495923bfab11f55dad69e6..0000000000000000000000000000000000000000 --- a/aarch64-store/chat/github.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "icalingua": { - "repo": "Icalingua-plus-plus/Icalingua-plus-plus", - "file_template": "icalingua_{stripped_version}_arm64.deb", - "app.json": { - "Name": "Icalingua++(第三方QQ)", - "Pkgname": "icalingua", - "Author": "The Icalingua++ Authors ", - "Website": "https://github.com/Icalingua-plus-plus/Icalingua-plus-plus", - "More": "Icalingua++ 是 Icalingua 的分支,為已經刪除的 Icalingua 提供有限的更新,同時歡迎社區提交PR。\nIcalingua 这个名字是日语中「光」和拉丁语中「语言」的组合。\n本项目希望为 Linux 打造一个会话前端框架,通过实现 Adapter 后端接口来适配各种聊天平台。目前已经拥有基于 oicq 以及 Icalingua 自有协议的后端。\n\n----------------------------------------\n此应用存在已知的不稳定问题, 如出现会自动崩溃现象,可使用 'Icalingua++ 用户服务'", - "Tags": "a2d;community;debian;deepin;ubuntu;uos", - "img_urls": "[\"https://spk-json.spark-app.store/images/2024/12/31/48feff5701294f6db8f6cac33b6a4864.png\",\"https://spk-json.spark-app.store/images/2024/12/31/ad69192d8f8c4d50b3ca93179b2dcd77.png\"]", - "icons": "https://spk-json.spark-app.store/icons/2024/12/31/92aaa646b10746ada98c8e699db9ff74.png" - } - } -} diff --git a/aarch64-store/development/data/github.json b/aarch64-store/development/data/github.json deleted file mode 100644 index 0b0c60248aaa1ae0b5ec6f5d1464d80c8d069697..0000000000000000000000000000000000000000 --- a/aarch64-store/development/data/github.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "tabby-terminal": { - "repo": "Eugeny/tabby", - "file_template": "tabby-{stripped_version}-linux-arm64.deb", - "app.json": { - "Name": "Tabby", - "Author": "Eugene Pankov ", - "Website": "https://github.com/Eugeny/tabby#readme", - "More": "A terminal for a modern age", - "Tags": "debian;community;ubuntu;deepin", - "img_urls": "[\"https://spk-json.spark-app.store/store/development/tabby-terminal/screen_1.png\",\"https://spk-json.spark-app.store/store/development/tabby-terminal/screen_2.png\",\"https://spk-json.spark-app.store/store/development/tabby-terminal/screen_3.png\"]", - "icons": "https://spk-json.spark-app.store/store/development/tabby-terminal/icon.png" - } - }, - "lazydocker": { - "repo": "wcbing-build/lazydocker-debs", - "file_template": "lazydocker_{stripped_version}-1_arm64.deb", - "app.json": { - "Name": "Lazydocker", - "Author": "wcbing ", - "Website": "https://github.com/jesseduffield/lazydocker", - "More": "一个简单的终端 UI 程序,用于 docker 和 docker-compose,用 Go 语言编写,使用 gocui 库。", - "Tags": "debian;community;ubuntu;deepin" - } - }, - "lazygit": { - "repo": "wcbing-build/lazygit-debs", - "file_template": "lazygit_{stripped_version}-1_arm64.deb", - "app.json": { - "Name": "Lazygit", - "Author": "wcbing ", - "Website": "https://github.com/jesseduffield/lazygit", - "More": "用于 git 命令的简单终端 UI 程序", - "Tags": "debian;community;ubuntu;deepin" - } - } -} \ No newline at end of file diff --git a/aarch64-store/image_graphics/data/github.json b/aarch64-store/image_graphics/data/github.json deleted file mode 100644 index b7e6f4ff08b3c938906b1943f19792aa29b0d157..0000000000000000000000000000000000000000 --- a/aarch64-store/image_graphics/data/github.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "draw.io": { - "repo": "jgraph/drawio-desktop", - "file_template": "drawio-arm64-{stripped_version}.deb", - "app.json": { - "Name": "draw.io", - "Author": "JGraph ", - "Website": "https://github.com/jgraph/drawio", - "More": "draw.io 是一个强大简洁的绘图软件,支持流程图,UML图,架构图,原型图等图标。支持Github,Google Drive, One drive等网盘同步,并且永久免费。", - "Tags": "debian;ubuntu;deepin;uos", - "img_urls": "[\"https://spk-json.spark-app.store/store/image_graphics/draw.io/screen_1.png\"]", - "icons": "https://spk-json.spark-app.store/store/image_graphics/draw.io/icon.png" - } - } -} \ No newline at end of file diff --git a/aarch64-store/music/data/github.json b/aarch64-store/music/data/github.json deleted file mode 100644 index 93029fe14700086acd4e59a92f171f3e1c621830..0000000000000000000000000000000000000000 --- a/aarch64-store/music/data/github.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "lx-music-desktop": { - "repo": "lyswhut/lx-music-desktop", - "file_template": "lx-music-desktop_{stripped_version}_arm64.deb", - "app.json": { - "Name": "洛雪音乐助手", - "Author": "lyswhut ", - "Website": "https://github.com/lyswhut/lx-music-desktop", - "More": "一个基于electron的音乐软件,全网搜音乐", - "Tags": "debian;community;ubuntu;deepin;uos", - "img_urls": "[\"https://spk-json.spark-app.store/store/music/lx-music-desktop/screen_1.png\",\"https://spk-json.spark-app.store/store/music/lx-music-desktop/screen_2.png\",\"https://spk-json.spark-app.store/store/music/lx-music-desktop/screen_3.png\",\"https://spk-json.spark-app.store/store/music/lx-music-desktop/screen_4.png\",\"https://spk-json.spark-app.store/store/music/lx-music-desktop/screen_5.png\"]", - "icons": "https://spk-json.spark-app.store/store/music/lx-music-desktop/icon.png" - } - } -} diff --git a/aarch64-store/network/data/github.json b/aarch64-store/network/data/github.json deleted file mode 100644 index eefe328f152fe890ec4a8acb40e774571f44a92d..0000000000000000000000000000000000000000 --- a/aarch64-store/network/data/github.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "motrix": { - "repo": "agalwood/Motrix", - "file_template": "Motrix_{stripped_version}_arm64.deb", - "app.json": { - "Name": "Motrix", - "Author": "Dr_rOot ", - "Website": "https://motrix.app", - "More": "Motrix 是一款全能的下载工具,支持下载 HTTP、FTP、BT、磁力链等资源。", - "Tags": "debian;community;ubuntu;deepin;uos", - "img_urls": "[\"https://spk-json.spark-app.store/store/network/motrix/screen_1.png\",\"https://spk-json.spark-app.store/store/network/motrix/screen_2.png\",\"https://spk-json.spark-app.store/store/network/motrix/screen_3.png\"]", - "icons": "https://spk-json.spark-app.store/store/network/motrix/icon.png" - } - }, - "dufs": { - "repo": "wcbing-build/dufs-debs", - "file_template": "dufs_{stripped_version}-1_arm64.deb", - "app.json": { - "Name": "Dufs", - "Author": "wcbing ", - "Website": "https://github.com/sigoden/dufs", - "More": "Dufs 是一款独特的实用文件服务器,支持静态服务、上传、搜索、访问控制、webdav。", - "Tags": "debian;community;ubuntu;deepin" - } - }, - "downkyi": { - "repo": "yaobiao131/downkyicore", - "file_template": "downkyi_{stripped_version}_linux_self-contained_arm64.deb", - "app.json": { - "Name": "哔哩下载姬(跨平台版)", - "Author": "28655758+yaobiao131@users.noreply.github.com", - "Website": "https://github.com/yaobiao131/downkyicore", - "More": "基于哔哩下载姬Windows版和AvaloniaUI制作的跨平台版本", - "Tags": "debian;ubuntu;deepin;uos", - "img_urls": "[\"https://spk-json.spark-app.store/images/2025/01/01/7359ae967f0c4545a838d373e310588c.png\",\"https://spk-json.spark-app.store/images/2025/01/01/e682ac754e6d47a893d7b00ef48e20b1.png\",\"https://spk-json.spark-app.store/images/2025/01/01/f184269c37e548cbb101b3e1a811bcf9.png\"]", - "icons": "https://spk-json.spark-app.store/icons/2025/01/01/5c598e4d3a4f43be8f240b9ed130fe53.png" - } - } -} \ No newline at end of file diff --git a/aarch64-store/office/data/github.json b/aarch64-store/office/data/github.json deleted file mode 100644 index a51ed0f8daf9e0130427fa3943f0d19aa2c895d6..0000000000000000000000000000000000000000 --- a/aarch64-store/office/data/github.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "hugo": { - "repo": "gohugoio/hugo", - "file_template": "hugo_extended_{stripped_version}_linux-arm64.deb", - "app.json": { - "Name": "hugo-extended 博客程序", - "Author": "Bjørn Erik Pedersen ", - "Website": "https://github.com/gohugoio/hugo", - "More": "The world’s fastest framework for building websites", - "Tags": "debian;ubuntu;deepin", - "img_urls": "[\"https://spk-json.spark-app.store/store/office/hugo/screen_1.png\"]", - "icons": "https://spk-json.spark-app.store/store/office/hugo/icon.png" - } - }, - "pandoc": { - "repo": "jgm/pandoc", - "file_template": "pandoc-{version_tag}-1-arm64.deb", - "app.json": { - "Name": "Pandoc", - "Author": "John MacFarlane ", - "Website": "https://github.com/jgm/pandoc", - "More": " Universal markup converter. 通用标记转换器\nPandoc是一个用于将一种标记格式转换为另一种标记格式的Haskell库,以及使用该库的命令行工具。", - "Tags": "debian;ubuntu;deepin;uos", - "img_urls": "[]", - "icons": "" - } - }, - "siyuan": { - "repo": "siyuan-note/siyuan", - "file_template": "siyuan-{stripped_version}-linux-arm64.deb", - "app.json": { - "Name": "思源笔记", - "Author": "云南链滴科技有限公司 <845765@qq.com>", - "Website": "https://b3log.org/siyuan/", - "More": "思源笔记是一款本地优先的个人知识管理系统,支持完全离线使用,同时也支持端到端加密同步。", - "Tags": "debian;ubuntu;deepin;uos", - "img_urls": "[\"https://spk-json.spark-app.store/store/office/siyuan/screen_1.png\",\"https://spk-json.spark-app.store/store/office/siyuan/screen_2.png\",\"https://spk-json.spark-app.store/store/office/siyuan/screen_3.png\",\"https://spk-json.spark-app.store/store/office/siyuan/screen_4.png\"]", - "icons": "https://spk-json.spark-app.store/store/office/siyuan/icon.png" - } - } -} \ No newline at end of file diff --git a/aarch64-store/tools/data/github.json b/aarch64-store/tools/data/github.json deleted file mode 100644 index 7a2dda3c8283b4d4f8652f7398e155554ab734cb..0000000000000000000000000000000000000000 --- a/aarch64-store/tools/data/github.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "rustdesk": { - "repo": "rustdesk/rustdesk", - "file_template": "rustdesk-{version_tag}-aarch64.deb", - "app.json": { - "Name": "RustDesk", - "Author": "rustdesk ", - "Website": "https://rustdesk.com", - "More": "RustDesk是开源远程桌面软件,开箱即用,无需任何配置,而且有实验性Wayland支持(但是高度依赖XWayland)。", - "Tags": "debian;community;ubuntu;deepin;uos", - "img_urls": "[\"https://spk-json.spark-app.store/store/tools/rustdesk/screen_1.png\",\"https://spk-json.spark-app.store/store/tools/rustdesk/screen_2.png\",\"https://spk-json.spark-app.store/store/tools/rustdesk/screen_3.png\"]", - "icons": "https://spk-json.spark-app.store/store/tools/rustdesk/icon.png" - } - }, - "localsend": { - "repo": "localsend/localsend", - "file_template": "LocalSend-{stripped_version}-linux-arm-64.deb", - "app.json": { - "Name": "LocalSend", - "Author": "Tienisto ", - "Website": "https://localsend.org/", - "More": "LocalSend是一个跨平台的应用程序,可以使用REST API和HTTPS加密实现设备之间的安全通信。与其他依赖外部服务器的消息传递应用程序不同,LocalSend 不需要互联网连接或第三方服务器,使其成为快速可靠的本地通信解决方案。\nLocalSend 使用安全通信协议,允许设备使用 REST API 相互通信。所有数据都通过HTTPS安全发送,并在每台设备上动态生成TLS / SSL证书,确保最大的安全性。", - "Tags": "debian;community;ubuntu;deepin;uos;a2d", - "img_urls": "[\"https://spk-json.spark-app.store/store/tools/localsend/screen_1.png\"]", - "icons": "https://spk-json.spark-app.store/store/tools/localsend/icon.png" - } - }, - "linglong-store": { - "repo": "GershonWang/linglong-store", - "file_template": "linglong-store_{stripped_version}_arm64.deb", - "app.json": { - "Name": "玲珑应用商店", - "Author": "Jokul <986432015@qq.com>", - "Website": "https://github.com/GershonWang/linglong-store", - "More": "Jokul自制简易式玲珑商店客户端,是玲珑官方SIG项目之一,使用过程中出现BUG,请在商店关于内问题反馈,或者在作者得github或者gitee上留issue,谢谢!", - "Tags": "debian;community;ubuntu;deepin" - } - }, - "cloudflared": { - "repo": "cloudflare/cloudflared", - "file_template": "cloudflared-linux-arm64.deb", - "app.json": { - "Name": "Cloudflare Tunnel client", - "Version": "2024.12.2", - "Author": "Cloudflare ", - "Website": "https://github.com/cloudflare/cloudflared", - "More": "Contains the command-line client for Cloudflare Tunnel, a tunneling daemon that proxies traffic from the Cloudflare network to your origins. This daemon sits between Cloudflare network and your origin (e.g. a webserver). Cloudflare attracts client requests and sends them to you via this daemon, without requiring you to poke holes on your firewall --- your origin can remain as closed as possible. Extensive documentation can be found in the Cloudflare Tunnel section of the Cloudflare Docs. All usages related with proxying to your origins are available under cloudflared tunnel help.\nYou can also use cloudflared to access Tunnel origins (that are protected with cloudflared tunnel) for TCP traffic at Layer 4 (i.e., not HTTP/websocket), which is relevant for use cases such as SSH, RDP, etc. Such usages are available under cloudflared access help.\nYou can instead use WARP client to access private origins behind Tunnels for Layer 4 traffic without requiring cloudflared access commands on the client side.", - "Tags": "debian;ubuntu;deepin;uos", - "img_urls": "[\"https://spk-json.spark-app.store/images/2025/01/01/0ec1daa5df0f4f9597c0440c39e69116.png\",\"https://spk-json.spark-app.store/images/2025/01/01/f50bab7804504b66a266b027c29c0adc.png\"]", - "icons": "https://spk-json.spark-app.store/icons/2025/01/01/5db109ad0dd9452b81b87088b512a512.png" - } - }, - "pot":{ - "repo": "pot-app/pot-desktop", - "file_template": "pot_{version_tag}_arm64.deb", - "app.json": { - "Name": "Pot (派了个萌的翻译器)", - "Author": "pot-app", - "Website": "https://pot-app.com", - "More": "一个跨平台的划词翻译和OCR软件 | A cross-platform software for text translation and recognize.", - "Tags": "community;debian;deepin;ubuntu;uos" - } - } -} \ No newline at end of file diff --git a/aarch64-store/xrea/data/github.json b/aarch64-store/xrea/data/github.json deleted file mode 100644 index 1a3a34baab8399b6741b732d21b050a7d0235f4f..0000000000000000000000000000000000000000 --- a/aarch64-store/xrea/data/github.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "mihomo": { - "repo": "MetaCubeX/mihomo", - "file_template": "mihomo-linux-arm64-{version_tag}.deb", - "app.json": {} - }, - "clash-verge": { - "repo": "clash-verge-rev/clash-verge-rev", - "file_template": "Clash.Verge_{stripped_version}_arm64.deb", - "app.json": {} - } -} \ No newline at end of file diff --git a/github-downloader b/github-downloader new file mode 100755 index 0000000000000000000000000000000000000000..5369c2e7d01f24aefa6f34613715346c84be6b1f --- /dev/null +++ b/github-downloader @@ -0,0 +1,182 @@ +#!/usr/bin/env python3 + +import argparse +import json +import logging +import os +import requests +import re +import threading +from datetime import datetime +from concurrent.futures import ThreadPoolExecutor, wait + + +# 全局配置变量 +CONFIG = { + "data_dir": "data", + "output_dir": ".", + "proxy": "", + "thread": 5, + "category": "", + "dry_run": False, +} +version_lock = threading.Lock() +# 日志等级,若需要展示每次请求结果请使用 INFO 等级 +logging.basicConfig(level=logging.INFO) + + +# 读取命令行参数 +def read_args() -> None: + parser = argparse.ArgumentParser( + description="Github Downloader - Github Releases 更新下载器" + ) + parser.add_argument("-c", "--category", default="", help="分类,用于包的保存路径") + parser.add_argument("-d", "--data", default="data", help="从 读取仓库配置") + parser.add_argument( + "-o", "--output", default=".", help="将文件保存到 ,默认为当前文件夹" + ) + parser.add_argument( + "-p", "--proxy", default="", help="Github 代理, 必须以 / 结尾" + ) + parser.add_argument( + "-t", "--thread", type=int, default=5, help="并发下载线程数量,默认为 5" + ) + parser.add_argument("--dry-run", action="store_true", help="运行但不下载文件") + args = parser.parse_args() + + CONFIG.update( + { + "category": args.category, + "data_dir": args.data, + "output_dir": args.output, + "proxy": args.proxy, + "thread": args.thread, + "dry_run": args.dry_run, + } + ) + + +# 读取 JSON 文件 +def read_json(filename: str) -> dict: + try: + with open(os.path.join(CONFIG["data_dir"], filename), "r") as f: + return json.load(f) + except (FileNotFoundError, json.JSONDecodeError) as e: + logging.error(e) + return {} + + +# 获取最新版本标签 +def latest_version_tag(repo_url: str) -> str: + url = f"{repo_url}/releases/latest" + try: + location = requests.head(url).headers.get("Location", "") + match = re.search(r".*releases/tag/([^/]+)", location) + return match.group(1) if match else "" + except requests.RequestException as e: + logging.error(e) + return "" + + +# 下载文件 +def download(url: str, file_path: str) -> tuple[bool, str]: + # 检查是否为 dry-run 模式 + method = requests.head if CONFIG["dry_run"] else requests.get + response = method(url, stream=True, allow_redirects=True) + if response.status_code != 200: + logging.error(f"Can't download {url} because received {response.status_code}") + return False, "" + + # 记录文件大小,size_str 使用 kB/MB 而不是 KiB/MiB + len = int(response.headers.get("Content-Length", 0)) + size_str = f"{len / 10**3:.2f}kB" if len < 10**6 else f"{len / 10**6:.2f}MB" + + if CONFIG["dry_run"]: + logging.info(f"Dry-run download: {url}") + else: + logging.info(f"Downloading: {url}") + with open(file_path, "wb") as f: + for chunk in response.iter_content(chunk_size=8192): + f.write(chunk) + return True, size_str + + +# 检查版本并下载新版本文件 +def check(name: str, repo: dict, version_list: dict) -> None: + repo_url = f"{CONFIG['proxy']}https://github.com/{repo['repo']}" + version_tag = latest_version_tag(repo_url) + if not version_tag: + logging.error(f"Can't get latest version tag of {name}") + return + logging.info(f"{name} = {version_tag}") + + # https://www.debian.org/doc/manuals/debmake-doc/ch06.zh-cn.html#name-version + # 参考文档中 Upstream version 正则表达式获取版本号,即从第一个数字开始。 + vpattern = "[0-9][-+.:~a-z0-9A-Z]*" + version = match.group() if (match := re.search(vpattern, version_tag)) else "" + + # 判断是否需要更新 + local_version = version_list.get(name, "") + if not version or local_version == version: + return + + for arch, file_template in repo["file_list"].items(): + # 确定本地文件目录并确保目录存在 + app_dir = os.path.join( + CONFIG["output_dir"], f"{arch}-store", CONFIG["category"], name + ) + os.makedirs(app_dir, exist_ok=True) + # 拼接得到 Releases 中的文件名 + release_filename = file_template.format( + version_tag=version_tag, # 若存在则用完整 tag 替换 + stripped_version=version, # 若存在则用 version 替换 + ) + file_url = f"{repo_url}/releases/download/{version_tag}/{release_filename}" + filename = f"{name}_{version}_{arch}.deb" # 格式化后的文件名 + file_path = os.path.join(app_dir, filename) + + downloaded, size = download(file_url, file_path) + if downloaded: + # 判断是否是新添加应用 + if local_version == "": + print(f"AddNew: {name}:{arch} ({version})") + else: + print(f"Update: {name}:{arch} ({local_version} -> {version})") + # 删除旧版本文件 + old_file_path = os.path.join( + app_dir, f"{name}_{local_version}_{arch}.deb" + ) + if os.path.exists(old_file_path): + os.remove(old_file_path) + # 更新 app.json + repo["app.json"].update( + { + "Pkgname": name, + "Version": version, + "Filename": filename, + "Update": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), + "Size": size, + "Contributor": "https://gitee.com/spark-building-service/github", + } + ) + # 保存 app.json + with open(os.path.join(app_dir, "app.json.update"), "w") as f: + json.dump(repo["app.json"], f, indent=4, ensure_ascii=False) + # 更新版本号 + with version_lock: + version_list[name] = version + + +if __name__ == "__main__": + read_args() + repo_list = read_json("github.json") + version_list = read_json("github-local.json") + with ThreadPoolExecutor(max_workers=CONFIG["thread"]) as executor: + tasks = [ + executor.submit(check, name, repo, version_list) + for name, repo in repo_list.items() + ] + wait(tasks) + # 保存到 github-local.json + with open(os.path.join(CONFIG["data_dir"], "github-local.json"), "w") as f: + json.dump(version_list, f, indent=4) diff --git a/loong64-store/reading/data/github.json b/loong64-store/reading/data/github.json deleted file mode 100644 index 107092b74592e18cd3a884a54fb89e2902a86273..0000000000000000000000000000000000000000 --- a/loong64-store/reading/data/github.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "foliate": { - "repo": "johnfactotum/foliate", - "file_template": "foliate_{version_tag}_all.deb", - "app.json": { - "Name": "Foliate", - "Author": "John Factotum", - "Website": "https://johnfactotum.github.io/foliate/", - "More": "Foliate是一个使用GJS和 Epub.js构建的开源GTK电子书阅读器,具有简单而现代的用户界面", - "Tags": "debian;deepin;ubuntu;uos" - } - } -} \ No newline at end of file diff --git a/run.sh b/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..4d2cd3e04041169b75fce131faecf1bdbc3ec047 --- /dev/null +++ b/run.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +store_dir="$HOME/store-dir" + +category=$(ls store) + +for i in $category; do + ./github-downloader -o $store_dir -d store/$i/ -c $i +done \ No newline at end of file diff --git a/store/chat/github.json b/store/chat/github.json index 7f6ab499ac1d4ddceb83514dfbabdf805e92a412..1fa520d7e51e6139de1eb87c0dfec2abc40b9aed 100644 --- a/store/chat/github.json +++ b/store/chat/github.json @@ -1,7 +1,10 @@ { "icalingua": { "repo": "Icalingua-plus-plus/Icalingua-plus-plus", - "file_template": "icalingua_{stripped_version}_amd64.deb", + "file_list": { + "amd64": "icalingua_{stripped_version}_amd64.deb", + "arm64": "icalingua_{stripped_version}_arm64.deb" + }, "app.json": { "Name": "Icalingua++(第三方QQ)", "Pkgname": "icalingua", @@ -13,4 +16,4 @@ "icons": "https://spk-json.spark-app.store/icons/2024/12/31/92aaa646b10746ada98c8e699db9ff74.png" } } -} +} \ No newline at end of file diff --git a/store/development/data/github.json b/store/development/github.json similarity index 81% rename from store/development/data/github.json rename to store/development/github.json index d04c34b6467d4b1e9e448deba81c42cde316e1a1..91cc32862d4140fe7dc56e8d84da669afdd3e6c2 100644 --- a/store/development/data/github.json +++ b/store/development/github.json @@ -1,7 +1,9 @@ { "neovim": { "repo": "neovim/neovim-releases", - "file_template": "nvim-linux-x86_64.deb", + "file_list": { + "amd64": "nvim-linux-x86_64.deb" + }, "app.json": { "Name": "Neovim", "Author": "Neovim.io", @@ -14,7 +16,10 @@ }, "tabby-terminal": { "repo": "Eugeny/tabby", - "file_template": "tabby-{stripped_version}-linux-x64.deb", + "file_list": { + "amd64": "tabby-{stripped_version}-linux-x64.deb", + "arm64": "tabby-{stripped_version}-linux-arm64.deb" + }, "app.json": { "Name": "Tabby", "Author": "Eugene Pankov ", @@ -27,7 +32,10 @@ }, "lazydocker": { "repo": "wcbing-build/lazydocker-debs", - "file_template": "lazydocker_{stripped_version}-1_amd64.deb", + "file_list": { + "amd64": "lazydocker_{stripped_version}-1_amd64.deb", + "arm64": "lazydocker_{stripped_version}-1_arm64.deb" + }, "app.json": { "Name": "Lazydocker", "Author": "wcbing ", @@ -38,7 +46,10 @@ }, "lazygit": { "repo": "wcbing-build/lazygit-debs", - "file_template": "lazygit_{stripped_version}-1_amd64.deb", + "file_list": { + "amd64": "lazygit_{stripped_version}-1_amd64.deb", + "arm64": "lazygit_{stripped_version}-1_arm64.deb" + }, "app.json": { "Name": "Lazygit", "Author": "wcbing ", @@ -49,7 +60,9 @@ }, "io.github.msojocs.wechat-devtools-linux": { "repo": "msojocs/wechat-web-devtools-linux", - "file_template": "io.github.msojocs.wechat-devtools-linux_{stripped_version}_amd64.deb", + "file_list": { + "amd64": "io.github.msojocs.wechat-devtools-linux_{stripped_version}_amd64.deb" + }, "app.json": { "Name": "微信开发者工具 Linux版", "Author": "msojocs", diff --git a/loong64-store/games/data/github.json b/store/games/github.json similarity index 78% rename from loong64-store/games/data/github.json rename to store/games/github.json index 734dfe9ab92bc93aaebc95bf457d2fd50c6a923f..2a77f87ebc25228252d867ba5e6682ff9df64095 100644 --- a/loong64-store/games/data/github.json +++ b/store/games/github.json @@ -1,7 +1,9 @@ { "osu-lazer": { "repo": "Catty2014/osu-lazer-loongarch", - "file_template": "osu-lazer_{version_tag}_loong64.deb", + "file_list": { + "loong64": "osu-lazer_{version_tag}_loong64.deb" + }, "app.json": { "Name": "osu!", "Author": "Catty Steve", diff --git a/store/image_graphics/data/github.json b/store/image_graphics/github.json similarity index 82% rename from store/image_graphics/data/github.json rename to store/image_graphics/github.json index 6c641c306c96236fe3d6e8bc88cac2630e9f74aa..6da1377ff6d3d4cf24fb1b03c9a0b7b0a6c26ed1 100644 --- a/store/image_graphics/data/github.json +++ b/store/image_graphics/github.json @@ -1,7 +1,10 @@ { "draw.io": { "repo": "jgraph/drawio-desktop", - "file_template": "drawio-amd64-{stripped_version}.deb", + "file_list": { + "amd64": "drawio-amd64-{stripped_version}.deb", + "arm64": "drawio-arm64-{stripped_version}.deb" + }, "app.json": { "Name": "draw.io", "Author": "JGraph ", diff --git a/store/music/data/github.json b/store/music/github.json similarity index 84% rename from store/music/data/github.json rename to store/music/github.json index 4fdfafa4938dbf50ffab6482a2428ba184cffeab..453a2cff4af272f06b6d69deaebd172d3b3c14bb 100644 --- a/store/music/data/github.json +++ b/store/music/github.json @@ -1,7 +1,10 @@ { "lx-music-desktop": { "repo": "lyswhut/lx-music-desktop", - "file_template": "lx-music-desktop_{stripped_version}_amd64.deb", + "file_list": { + "amd64": "lx-music-desktop_{stripped_version}_amd64.deb", + "arm64": "lx-music-desktop_{stripped_version}_arm64.deb" + }, "app.json": { "Name": "洛雪音乐助手", "Author": "lyswhut ", @@ -12,4 +15,4 @@ "icons": "https://spk-json.spark-app.store/store/music/lx-music-desktop/icon.png" } } -} +} \ No newline at end of file diff --git a/store/network/data/github.json b/store/network/github.json similarity index 80% rename from store/network/data/github.json rename to store/network/github.json index 1202b4c0076fc6e412151b510e63142803367996..66e3630197eaae1d73020c06deb3c26402f98344 100644 --- a/store/network/data/github.json +++ b/store/network/github.json @@ -1,7 +1,10 @@ { "motrix": { "repo": "agalwood/Motrix", - "file_template": "Motrix_{stripped_version}_amd64.deb", + "file_list": { + "amd64": "Motrix_{stripped_version}_amd64.deb", + "arm64": "Motrix_{stripped_version}_arm64.deb" + }, "app.json": { "Name": "Motrix", "Author": "Dr_rOot ", @@ -14,7 +17,10 @@ }, "dufs": { "repo": "wcbing-build/dufs-debs", - "file_template": "dufs_{stripped_version}-1_amd64.deb", + "file_list": { + "amd64": "dufs_{stripped_version}-1_amd64.deb", + "arm64": "dufs_{stripped_version}-1_arm64.deb" + }, "app.json": { "Name": "Dufs", "Author": "wcbing ", @@ -25,7 +31,10 @@ }, "downkyi": { "repo": "yaobiao131/downkyicore", - "file_template": "downkyi_{stripped_version}_linux_self-contained_amd64.deb", + "file_list": { + "amd64": "downkyi_{stripped_version}_linux_self-contained_amd64.deb", + "arm64": "downkyi_{stripped_version}_linux_self-contained_arm64.deb" + }, "app.json": { "Name": "哔哩下载姬(跨平台版)", "Author": "28655758+yaobiao131@users.noreply.github.com", @@ -37,7 +46,9 @@ }, "abdownloadmanager": { "repo": "amir1376/ab-download-manager", - "file_template": "ABDownloadManager_{stripped_version}_linux_x64.deb", + "file_list": { + "amd64": "ABDownloadManager_{stripped_version}_linux_x64.deb" + }, "app.json": { "Name": "AB Download Manager", "Author": "abdownloadmanager.com", diff --git a/store/office/data/github.json b/store/office/github.json similarity index 82% rename from store/office/data/github.json rename to store/office/github.json index 7e64a495a53d9553cbfad9ee550d04058ec418c0..0d882c096afc5c2eb529dc3c678b19bd98f66234 100644 --- a/store/office/data/github.json +++ b/store/office/github.json @@ -1,7 +1,10 @@ { "hugo": { "repo": "gohugoio/hugo", - "file_template": "hugo_extended_{stripped_version}_linux-amd64.deb", + "file_list": { + "amd64": "hugo_extended_{stripped_version}_linux-amd64.deb", + "arm64": "hugo_extended_{stripped_version}_linux-arm64.deb" + }, "app.json": { "Name": "hugo-extended 博客程序", "Author": "Bjørn Erik Pedersen ", @@ -14,7 +17,9 @@ }, "obsidian": { "repo": "obsidianmd/obsidian-releases", - "file_template": "obsidian_{stripped_version}_amd64.deb", + "file_list": { + "amd64": "obsidian_{stripped_version}_amd64.deb" + }, "app.json": { "Name": "Obsidian", "Author": "Dynalist Inc.", @@ -27,7 +32,10 @@ }, "pandoc": { "repo": "jgm/pandoc", - "file_template": "pandoc-{version_tag}-1-amd64.deb", + "file_list": { + "amd64": "pandoc-{version_tag}-1-amd64.deb", + "arm64": "pandoc-{version_tag}-1-arm64.deb" + }, "app.json": { "Name": "Pandoc", "Author": "John MacFarlane ", @@ -40,7 +48,10 @@ }, "siyuan": { "repo": "siyuan-note/siyuan", - "file_template": "siyuan-{stripped_version}-linux.deb", + "file_list": { + "amd64": "siyuan-{stripped_version}-linux.deb", + "arm64": "siyuan-{stripped_version}-linux-arm64.deb" + }, "app.json": { "Name": "思源笔记", "Author": "云南链滴科技有限公司 <845765@qq.com>", diff --git a/store/reading/data/github.json b/store/reading/data/github.json deleted file mode 100644 index 32440564bfbe5e3d6658c89fe0e463d37e48dc45..0000000000000000000000000000000000000000 --- a/store/reading/data/github.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "foliate": { - "repo": "johnfactotum/foliate", - "file_template": "foliate_{version_tag}_all.deb", - "app.json": { - "Name": "Foliate", - "Author": "John Factotum", - "Website": "https://johnfactotum.github.io/foliate/", - "More": "Foliate是一个使用GJS和 Epub.js构建的开源GTK电子书阅读器,具有简单而现代的用户界面", - "Tags": "debian;deepin;ubuntu;uos" - } - }, - "venera": { - "repo": "venera-app/venera", - "file_template": "venera_{stripped_version}_amd64.deb", - "app.json": { - "Name": "Venera", - "Author": "wgh136", - "Website": "https://github.com/venera-app/venera", - "More": "Venera 支持阅读本地和多个源的网络漫画的漫画阅读器", - "Tags": "debian;ubuntu;deepin;uos" - } - } -} \ No newline at end of file diff --git a/aarch64-store/reading/data/github.json b/store/reading/github.json similarity index 68% rename from aarch64-store/reading/data/github.json rename to store/reading/github.json index efe77955361dbca0751fe89524aca578969efb87..b298064976b66d29da34ce1f177b924bcbd0406d 100644 --- a/aarch64-store/reading/data/github.json +++ b/store/reading/github.json @@ -1,7 +1,11 @@ { "foliate": { "repo": "johnfactotum/foliate", - "file_template": "foliate_{version_tag}_all.deb", + "file_list": { + "amd64": "foliate_{version_tag}_all.deb", + "arm64": "foliate_{version_tag}_all.deb", + "loong64": "foliate_{version_tag}_all.deb" + }, "app.json": { "Name": "Foliate", "Author": "John Factotum", @@ -12,7 +16,10 @@ }, "venera": { "repo": "venera-app/venera", - "file_template": "venera_{stripped_version}_arm64.deb", + "file_list": { + "amd64": "venera_{stripped_version}_amd64.deb", + "arm64": "venera_{stripped_version}_arm64.deb" + }, "app.json": { "Name": "Venera", "Author": "wgh136", diff --git a/store/tools/data/github.json b/store/tools/github.json similarity index 87% rename from store/tools/data/github.json rename to store/tools/github.json index 0261f350571cc93e3fc855666c4dd91a98c606ef..8d4c9a3cc53ca66f3848412c397ecf9287aebe9c 100644 --- a/store/tools/data/github.json +++ b/store/tools/github.json @@ -1,7 +1,10 @@ { "rustdesk": { "repo": "rustdesk/rustdesk", - "file_template": "rustdesk-{version_tag}-x86_64.deb", + "file_list": { + "amd64": "rustdesk-{version_tag}-x86_64.deb", + "arm64": "rustdesk-{version_tag}-aarch64.deb" + }, "app.json": { "Name": "RustDesk", "Author": "rustdesk ", @@ -14,7 +17,10 @@ }, "localsend": { "repo": "localsend/localsend", - "file_template": "LocalSend-{stripped_version}-linux-x86-64.deb", + "file_list": { + "amd64": "LocalSend-{stripped_version}-linux-x86-64.deb", + "arm64": "LocalSend-{stripped_version}-linux-arm-64.deb" + }, "app.json": { "Name": "LocalSend", "Author": "Tienisto ", @@ -27,7 +33,10 @@ }, "linglong-store": { "repo": "GershonWang/linglong-store", - "file_template": "linglong-store_{stripped_version}_amd64.deb", + "file_list": { + "amd64": "linglong-store_{stripped_version}_amd64.deb", + "arm64": "linglong-store_{stripped_version}_arm64.deb" + }, "app.json": { "Name": "玲珑应用商店", "Author": "Jokul <986432015@qq.com>", @@ -38,7 +47,9 @@ }, "peazip": { "repo": "peazip/PeaZip", - "file_template": "peazip_{version_tag}.LINUX.Qt6-1_amd64.deb", + "file_list": { + "amd64": "peazip_{version_tag}.LINUX.Qt6-1_amd64.deb" + }, "app.json": { "Name": "PeaZip", "Author": "Giorgio Tani ", @@ -51,7 +62,9 @@ }, "ollama": { "repo": "lingfish/ollama-deb", - "file_template": "ollama_{stripped_version}_amd64.deb", + "file_list": { + "amd64": "ollama_{stripped_version}_amd64.deb" + }, "app.json": { "Name": "Ollama", "Author": "ollama ", @@ -64,7 +77,10 @@ }, "cloudflared": { "repo": "cloudflare/cloudflared", - "file_template": "cloudflared-linux-amd64.deb", + "file_list": { + "amd64": "cloudflared-linux-amd64.deb", + "arm64": "cloudflared-linux-arm64.deb" + }, "app.json": { "Name": "Cloudflare Tunnel client", "Author": "Cloudflare ", @@ -77,7 +93,9 @@ }, "cloudflared-fips": { "repo": "cloudflare/cloudflared", - "file_template": "cloudflared-fips-linux-amd64.deb", + "file_list": { + "amd64": "cloudflared-fips-linux-amd64.deb" + }, "app.json": { "Name": "Cloudflare Tunnel client (fips)", "Author": "Cloudflare ", @@ -88,9 +106,12 @@ "icons": "https://spk-json.spark-app.store/icons/2025/01/01/b76df8b0e9824a6094b5faefef0fbc36.png" } }, - "pot":{ + "pot": { "repo": "pot-app/pot-desktop", - "file_template": "pot_{version_tag}_amd64.deb", + "file_list": { + "amd64": "pot_{version_tag}_amd64.deb", + "arm64": "pot_{version_tag}_arm64.deb" + }, "app.json": { "Name": "Pot (派了个萌的翻译器)", "Author": "pot-app", diff --git a/store/video/data/github.json b/store/video/github.json similarity index 94% rename from store/video/data/github.json rename to store/video/github.json index 80d53877e2ce7b7b2f853c443b2701acf1cf7dd7..efafaf67c9e6760c0b7cbbb2ba94ca94784d01c8 100644 --- a/store/video/data/github.json +++ b/store/video/github.json @@ -1,7 +1,9 @@ { "biliup-app": { "repo": "biliup/biliup-app", - "file_template": "biliup-app_{stripped_version}_amd64.deb", + "file_list": { + "amd64": "biliup-app_{stripped_version}_amd64.deb" + }, "app.json": { "Name": "biliup-app(开源 bilibili投稿客户端)", "Author": "you", diff --git a/store/xrea/data/github.json b/store/xrea/github.json similarity index 41% rename from store/xrea/data/github.json rename to store/xrea/github.json index d7a6239298f78762c9d8566ce526d2786b04f2de..2313ca8348af9fd904773b02fe8861ed1203e782 100644 --- a/store/xrea/data/github.json +++ b/store/xrea/github.json @@ -1,22 +1,32 @@ { "mihomo": { "repo": "MetaCubeX/mihomo", - "file_template": "mihomo-linux-amd64-compatible-{version_tag}.deb", + "file_list": { + "amd64": "mihomo-linux-amd64-compatible-{version_tag}.deb", + "arm64": "mihomo-linux-arm64-{version_tag}.deb" + }, "app.json": {} }, "clash-verge": { "repo": "clash-verge-rev/clash-verge-rev", - "file_template": "Clash.Verge_{stripped_version}_amd64.deb", + "file_list": { + "amd64": "Clash.Verge_{stripped_version}_amd64.deb", + "arm64": "Clash.Verge_{stripped_version}_arm64.deb" + }, "app.json": {} }, "flclash": { "repo": "chen08209/FlClash", - "file_template": "FlClash-{stripped_version}-linux-amd64.deb", + "file_list": { + "amd64": "FlClash-{stripped_version}-linux-amd64.deb" + }, "app.json": {} }, "hiddify": { "repo": "hiddify/hiddify-app", - "file_template": "Hiddify-Debian-x64.deb", + "file_list": { + "amd64": "Hiddify-Debian-x64.deb" + }, "app.json": {} } } \ No newline at end of file