update README.md check_downloader.py

This commit is contained in:
wcbing 2024-12-02 15:31:58 +08:00
parent b58c6340bd
commit e01e5e67a4
2 changed files with 6 additions and 10 deletions

View File

@ -71,7 +71,7 @@ curl -fsSL https://packages.wcbing.top/deb/del.sh | sudo sh
| 软件仓库 | 包名 | amd64 | arm64 |
| ------ | ---- | ----- | ----- |
|Mozilla Firefox|firefox<br />firefox_beta<br />firefox_devedition<br />firefox_esr<br />firefox_nightly<br />mozillavpn| ✅ | ✅ |
|Mozilla Firefox|firefox<br />firefox_beta<br />firefox_devedition<br />firefox_esr<br />firefox_nightly<br />mozillavpn| ✅ | ✅<br />官方仅提供<br />firefox_nightly |
|Google Chrome|google-chrome-stable<br />google-chrome-beta<br />google-chrome-unstable| ✅ | |
|Microsoft Edge|microsoft-edge-stable<br />microsoft-edge-beta<br />microsoft-edge-dev| ✅ | |
|Visual Studio Code|code<br />code-insiders<br />code-exploration| ✅ | ✅ |
@ -81,7 +81,7 @@ curl -fsSL https://packages.wcbing.top/deb/del.sh | sudo sh
|Tailscale|tailscale<br />tailscale-nginx-auth| ✅ | ✅ |
|[black-desk 打包](https://github.com/black-desk/debs)|app.typst.typst<br />dev.neovide.neovide<br />dev.zed.zed<br />dev.zed.zed-pre<br />io.github.black-desk.debian-tweak<br />io.neovim.neovim<br />io.neovim.neovim-nightly<br />one.metacubex.clash-meta<br />org.pimalaya.himalaya| ✅ | |
|Typora|typora| ✅ | ✅ |
|Zotero|zotero<br />zotero-beta<br />zotero6|
|Zotero|zotero<br />zotero-beta<br />zotero6| ✅ | |
|Github CLI|gh| ✅ | ✅ |

View File

@ -13,7 +13,7 @@ def download(url, file_type):
subprocess.run(["curl", "-H", "User-Agent: Debian APT-HTTP/1.3 (2.6.1)", "-fsLo", file_path, url])
def check_download(name, version, url, arch, file_type):
def check_download(name, version, url, arch, file_type="deb"):
conn = sqlite3.connect(file_type + ".db")
cur = conn.cursor()
@ -50,16 +50,12 @@ def check_download(name, version, url, arch, file_type):
conn.close()
def deb(name, version, url, arch="x86_64"):
check_download(name, version, url, arch=arch, file_type="deb")
if __name__ == "__main__":
args = os.sys.argv
if len(args) == 5:
deb(args[1], args[2], args[3], args[4])
check_download(args[1], args[2], args[3], args[4])
elif len(args) == 4:
deb(args[1], args[2], args[3])
check_download(args[1], args[2], args[3], "x86_64")
else:
print("Usage: check.py <name> <version> <url> [arch]\n")
print("arch: x86_64, arm64. default is x86_64")