From 48314db7b51e1de290bdfac6a1d25a1c7d726cfc Mon Sep 17 00:00:00 2001 From: wcbing Date: Thu, 25 Jul 2024 18:43:32 +0800 Subject: [PATCH] add hugo --- README.md | 1 + get/hugo.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 get/hugo.py diff --git a/README.md b/README.md index 0cf07e5..94522ac 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,4 @@ echo "deb [signed-by=/etc/apt/keyrings/wcbing.gpg] https://deb.wcbing.top /" | s |QQ|linuxqq|[官网](https://im.qq.com/linuxqq/)| |Clash Verge Rev|clash-verge|[Github Releses](https://github.com/clash-verge-rev/clash-verge-rev/releases)| |mihomo|mihomo|[Github Releases](https://github.com/MetaCubeX/mihomo/releases)| +|hugo|hugo|[Github Releases](https://github.com/gohugoio/hugo/releases)| diff --git a/get/hugo.py b/get/hugo.py new file mode 100644 index 0000000..6a857e3 --- /dev/null +++ b/get/hugo.py @@ -0,0 +1,19 @@ +import requests +from module.check import check_download + +name = "hugo" + +release_url = "https://github.com/gohugoio/hugo/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) + +# /v0.129.0/hugo_0.129.0_linux-amd64.deb +x64_deb_url = ( + release_url + "/download/" + vversion + "/" + + name + "_" + version + "_linux-amd64.deb" +) + +check_download(name, version, x64_deb_url)