From dbd8bfc1274f281f45308e7d056247f8d42dfe40 Mon Sep 17 00:00:00 2001 From: wcbing Date: Thu, 1 Aug 2024 20:07:53 +0800 Subject: [PATCH] add obsidian --- README.md | 1 + get/obsidian.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 get/obsidian.py diff --git a/README.md b/README.md index 25a995f..4cb7d4f 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ echo "deb [signed-by=/etc/apt/keyrings/wcbing.gpg] https://deb.wcbing.top /" | s |Visual Studio Code|code|[官网](https://code.visualstudio.com)| |Microsoft Edge|microsoft-edge-stable|[官网](https://www.microsoft.com/en-us/edge/download)| |Google Chrome|google-chrome-stable|[官网](https://www.google.com/chrome/)| +|Obsidian|obsidian|[Github Releases](https://github.com/obsidianmd/obsidian-releases/releases)| ## 自行建立仓库 diff --git a/get/obsidian.py b/get/obsidian.py new file mode 100644 index 0000000..e8cbd8f --- /dev/null +++ b/get/obsidian.py @@ -0,0 +1,18 @@ +import requests +from module.check import check_download + +name = "obsidian" + +release_url = "https://github.com/obsidianmd/obsidian-releases/releases" + +res = requests.head(release_url + "/latest", allow_redirects=False) +vversion = requests.Session().get_redirect_target(res).split("/")[-1] # v1.1.1 +version = vversion[1:] # 1.1.1 +# print(vversion, version) + +# /v1.6.7/obsidian_1.6.7_amd64.deb +x64_deb_url = ( + release_url + "/download/" + vversion + "/" + name + "_" + version + "_amd64.deb" +) + +check_download(name, version, x64_deb_url)