From 587e75f538fbef1bab65095351336cfa6f60887c Mon Sep 17 00:00:00 2001 From: wcbing Date: Thu, 1 Aug 2024 20:02:37 +0800 Subject: [PATCH] add code --- README.md | 1 + get/code.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 get/code.py diff --git a/README.md b/README.md index 25c659e..3b7d6ca 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ echo "deb [signed-by=/etc/apt/keyrings/wcbing.gpg] https://deb.wcbing.top /" | s |mihomo|mihomo|[Github Releases](https://github.com/MetaCubeX/mihomo/releases)| |hugo|hugo|[Github Releases](https://github.com/gohugoio/hugo/releases)| |RustDesk|rustdesk|[Github Releases](https://github.com/rustdesk/rustdesk/releases)| +|Visual Studio Code|code|[官网](https://code.visualstudio.com)| ## 自行建立仓库 diff --git a/get/code.py b/get/code.py new file mode 100644 index 0000000..c353f5b --- /dev/null +++ b/get/code.py @@ -0,0 +1,12 @@ +import requests +import re +from module.check import check_download + +x64_deb_req = "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64" + +res = requests.head(x64_deb_req) +version = re.findall("_(.*)-", res.headers["Location"])[0] +x64_deb_url = res.headers["Location"] +# print(version, x64_deb_url) + +check_download("code", version, x64_deb_url)