diff --git a/.gitignore b/.gitignore index 3806415..d131023 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ data/github-local.json -*/module/__pycache__/ deb/* !deb/index.html !deb/add.sh diff --git a/get/module/check.py b/check_downloader.py old mode 100644 new mode 100755 similarity index 83% rename from get/module/check.py rename to check_downloader.py index 5fa81fd..a4e8771 --- a/get/module/check.py +++ b/check_downloader.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import subprocess import os import sqlite3 @@ -51,3 +52,14 @@ def check_download(name, version, url, arch, file_type): 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]) + elif len(args) == 4: + deb(args[1], args[2], args[3]) + else: + print("Usage: check.py [arch]\n") + print("arch: x86_64, arm64. default is x86_64") \ No newline at end of file diff --git a/get/baidunetdisk.py b/get/baidunetdisk.py deleted file mode 100644 index a139ee7..0000000 --- a/get/baidunetdisk.py +++ /dev/null @@ -1,14 +0,0 @@ -import requests -import json -from module.check import deb - -res = requests.get("https://pan.baidu.com/disk/cmsdata?do=client") -res.encoding = "utf-8" - -download_list = json.loads(res.text) - -version = download_list["linux"]["version"].split("V")[1] -x64_deb_url = download_list["linux"]["url_1"] -# print(version, x64_deb_url) - -deb("baidunetdisk", version, x64_deb_url) diff --git a/get/baidunetdisk.sh b/get/baidunetdisk.sh new file mode 100644 index 0000000..82b6e5b --- /dev/null +++ b/get/baidunetdisk.sh @@ -0,0 +1,6 @@ +JSON=$(curl -s "https://pan.baidu.com/disk/cmsdata?do=client") + +VERSION=$(echo $JSON | jq -r ".linux.version" | cut -d "V" -f 2) +X64_URL=$(echo $JSON | jq -r ".linux.url_1") + +./check_downloader.py baidunetdisk $VERSION $X64_URL diff --git a/get/browser360-cn-stable.py b/get/browser360-cn-stable.py deleted file mode 100644 index 7ad5640..0000000 --- a/get/browser360-cn-stable.py +++ /dev/null @@ -1,10 +0,0 @@ -import requests -import json -from module.check import deb - -version_json = json.loads(requests.get("https://active.browser.360.net/api/v1/web-version").text) -version = version_json["data"]["web_version"] - -x64_deb_url = f"https://gedown.360safe.com/gc/browser360-cn-stable_{version}-1_amd64.deb" - -deb("browser360-cn-stable", version, x64_deb_url) \ No newline at end of file diff --git a/get/browser360-cn-stable.sh b/get/browser360-cn-stable.sh new file mode 100644 index 0000000..168902b --- /dev/null +++ b/get/browser360-cn-stable.sh @@ -0,0 +1,6 @@ +JSON=$(curl -s https://active.browser.360.net/api/v1/web-version) +VERSION=$(echo $JSON | jq -r ".data.web_version") + +X64_URL="https://gedown.360safe.com/gc/browser360-cn-stable_"$VERSION"-1_amd64.deb" + +./check_downloader.py browser360-cn-stable $VERSION $X64_URL \ No newline at end of file diff --git a/get/bytedance-feishu-stable.py b/get/bytedance-feishu-stable.py deleted file mode 100644 index 7165990..0000000 --- a/get/bytedance-feishu-stable.py +++ /dev/null @@ -1,12 +0,0 @@ -import requests -import json -from module.check import deb - -x64_deb_res = requests.get("https://www.feishu.cn/api/package_info?platform=10") -x64_deb_json = json.loads(x64_deb_res.text) - -# "version_number": "Linux-x64-deb@V7.22.9" -version = x64_deb_json["data"]["version_number"].split("@V")[1] -x64_deb_url = x64_deb_json["data"]["download_link"] - -deb("bytedance-feishu-stable", version, x64_deb_url) diff --git a/get/bytedance-feishu-stable.sh b/get/bytedance-feishu-stable.sh new file mode 100644 index 0000000..b141f8f --- /dev/null +++ b/get/bytedance-feishu-stable.sh @@ -0,0 +1,8 @@ +X64_JSON=$(curl -s "https://www.feishu.cn/api/package_info?platform=10") +# arm64 https://www.feishu.cn/api/package_info?platform=12 + +# "version_number": "Linux-x64-deb@V7.22.9" +VERSION=$(echo $X64_JSON | jq -r ".data.version_number" | cut -d '@' -f 2) +X64_URL=$(echo $X64_JSON | jq -r ".data.download_link") + +./check_downloader.py bytedance-feishu-stable $VERSION $X64_URL diff --git a/get/com.alibabainc.dingtalk.py b/get/com.alibabainc.dingtalk.py deleted file mode 100644 index a0e361f..0000000 --- a/get/com.alibabainc.dingtalk.py +++ /dev/null @@ -1,9 +0,0 @@ -import requests -from module.check import deb - -req = requests.get("https://www.dingtalk.com/win/d/qd=linux_amd64", allow_redirects=False) - -x64_deb_url = req.headers['Location'] -version = x64_deb_url.split("/")[-1].split("_")[1] - -deb("com.alibabainc.dingtalk", version, x64_deb_url) diff --git a/get/com.alibabainc.dingtalk.sh b/get/com.alibabainc.dingtalk.sh new file mode 100644 index 0000000..8cc3ee4 --- /dev/null +++ b/get/com.alibabainc.dingtalk.sh @@ -0,0 +1,4 @@ +X64_URL=$(curl -sw %{redirect_url} https://www.dingtalk.com/win/d/qd=linux_amd64) +VERSION=$(echo $X64_URL | cut -d '/' -f 8| cut -d '_' -f 2) + +./check_downloader.py com.alibabainc.dingtalk $VERSION $X64_URL diff --git a/get/dida.py b/get/dida.py deleted file mode 100644 index 46a31cb..0000000 --- a/get/dida.py +++ /dev/null @@ -1,11 +0,0 @@ -import requests -from module.check import deb - -x64_deb_req = requests.head("https://dida365.com/static/getApp/download?type=linux_deb_x64", headers={"User-Agent": "curl/8.10.1"}) -# arm64_deb_req = requests.head("https://dida365.com/static/getApp/download?type=linux_deb_arm64", headers={"User-Agent": "curl/8.10.1"}) - -x64_deb_url = x64_deb_req.headers["location"] -# https://cdn.dida365.cn/download/linux/linux_deb_x64/dida-6.0.0-amd64.deb -version = x64_deb_url.split("-")[-2] - -deb("dida", version, x64_deb_url) diff --git a/get/dida.sh b/get/dida.sh new file mode 100644 index 0000000..160eccd --- /dev/null +++ b/get/dida.sh @@ -0,0 +1,7 @@ +X64_URL=$(curl -sI "https://dida365.com/static/getApp/download?type=linux_deb_x64" | grep location | cut -d ' ' -f 2) +# arm64 https://dida365.com/static/getApp/download?type=linux_deb_arm64 + +# https://cdn.dida365.cn/download/linux/linux_deb_x64/dida-6.0.0-amd64.deb +VERSION=$(echo $X64_URL | cut -d "-" -f 2) + +./check_downloader.py dida $VERSION $X64_URL diff --git a/get/linuxqq.py b/get/linuxqq.py deleted file mode 100644 index 9fb0278..0000000 --- a/get/linuxqq.py +++ /dev/null @@ -1,18 +0,0 @@ -import requests -import re -import json -from module.check import deb - -res = requests.get("https://im.qq.com/rainbow/linuxQQDownload") -res.encoding = "utf-8" - -download_list_json = re.search( - r"var params\s*=\s*(\{.*?\});", res.text, re.DOTALL -).group(1) -download_list = json.loads(download_list_json) - -version = download_list["version"] + "_" + download_list["updateDate"] -x64_deb_url = download_list["x64DownloadUrl"]["deb"] -# print(version, x64_deb_url) - -deb("linuxqq", version, x64_deb_url) diff --git a/get/linuxqq.sh b/get/linuxqq.sh new file mode 100644 index 0000000..9e6ae78 --- /dev/null +++ b/get/linuxqq.sh @@ -0,0 +1,6 @@ +JSON=$(curl -s https://im.qq.com/rainbow/linuxQQDownload | sed -nE 's/.*var params\s*=\s*(\{.*?\});.*/\1/p') + +VERSION=$(echo $JSON | jq -r '.version + "_" + .updateDate') +X64_URL=$(echo $JSON | jq -r '.x64DownloadUrl.deb') + +./check_downloader.py linuxqq $VERSION $X64_URL diff --git a/get/qqmusic.py b/get/qqmusic.py deleted file mode 100644 index 5b18ec5..0000000 --- a/get/qqmusic.py +++ /dev/null @@ -1,15 +0,0 @@ -import requests -import re -from module.check import deb - -res = requests.get("https://y.qq.com/download/download.html") -res.encoding = "utf-8" - -version = re.findall( - r"Linux 最新版:(\d+\.\d+\.\d+)", - res.text, -)[0] -x64_deb_url = re.findall(r"https://dl\S+\.deb", res.text)[0] -# print(version, x64_deb_url) - -deb("qqmusic", version, x64_deb_url) diff --git a/get/qqmusic.sh b/get/qqmusic.sh new file mode 100644 index 0000000..4418fe1 --- /dev/null +++ b/get/qqmusic.sh @@ -0,0 +1,6 @@ +WEB_CONTENT=$(curl -s "https://y.qq.com/download/download.html") + +VERSION=$(echo $WEB_CONTENT | grep -o "Linux 最新版:[0-9\.]*" | cut -d ':' -f 2) +X64_URL=$(echo $WEB_CONTENT | grep -o "https://[0-9a-z/\._]*amd64\.deb" | head -n 1) + +./check_downloader.py qqmusic $VERSION $X64_URL diff --git a/get/sunlogin.py b/get/sunlogin.py deleted file mode 100644 index 3178e23..0000000 --- a/get/sunlogin.py +++ /dev/null @@ -1,8 +0,0 @@ -import requests -from module.check import deb - -req = requests.get("https://client-webapi.oray.com/softwares/SUNLOGIN_X_LINUX?x64=1") -version = req.json()["versionno"] -x64_url = req.json()["downloadurl"] - -deb("sunloginclient", version, x64_url) \ No newline at end of file diff --git a/get/sunlogin.sh b/get/sunlogin.sh new file mode 100644 index 0000000..0816d0e --- /dev/null +++ b/get/sunlogin.sh @@ -0,0 +1,6 @@ +JSON=$(curl -fs "https://client-webapi.oray.com/softwares/SUNLOGIN_X_LINUX?x64=1") + +VERSION=$(echo "$JSON" | jq -r '.versionno') +X64_URL=$(echo $JSON | jq -r '.downloadurl') + +./check_downloader.py sunlogin $VERSION $X64_URL \ No newline at end of file diff --git a/get/todesk.py b/get/todesk.py deleted file mode 100644 index 0a60fb8..0000000 --- a/get/todesk.py +++ /dev/null @@ -1,12 +0,0 @@ -import requests -import re -from module.check import deb - -res = requests.get("https://www.todesk.com/linux.html") - -x64_url = re.findall("https://[0-9a-zA-Z_/.-]*.deb", res.text)[0] - -# https://dl.todesk.com/linux/todesk-v4.7.2.0-amd64.deb -version = x64_url.split("-")[1] - -deb("todesk", version, x64_url) diff --git a/get/todesk.sh b/get/todesk.sh new file mode 100644 index 0000000..b8a0856 --- /dev/null +++ b/get/todesk.sh @@ -0,0 +1,6 @@ +X64_URL=$(curl -s https://www.todesk.com/linux.html | grep -o "https://[0-9a-zA-Z_\/\.\-]*.deb" | head -n 1) +# X64_URL=https:/ /dl.todesk.com/linux/todesk-v4.7.2.0-amd64.deb + +VERSION=$(echo $X64_URL | cut -d '-' -f 2) + +./check_downloader.py todesk $VERSION $X64_URL \ No newline at end of file diff --git a/get/utools.py b/get/utools.py deleted file mode 100644 index 43d3006..0000000 --- a/get/utools.py +++ /dev/null @@ -1,11 +0,0 @@ -import requests -import re -from module.check import deb - -res = requests.get("https://u.tools/download/") -res.encoding = "utf-8" - -x64_deb_url = re.findall(r"https:\/\/[^ ]+\.deb", res.text)[0] -version = re.findall(".*utools_(.+)_amd64.deb", x64_deb_url)[0] - -deb("utools", version, x64_deb_url) diff --git a/get/utools.sh b/get/utools.sh new file mode 100644 index 0000000..e986ec9 --- /dev/null +++ b/get/utools.sh @@ -0,0 +1,8 @@ +WEB_CONTENT=$(curl -s "https://u.tools/download/") + +X64_URL=$(echo $WEB_CONTENT | grep -o "https://[^ ]*amd64\.deb") + +# https://open.u-tools.cn/download/utools_5.2.1_amd64.deb +VERSION=$(echo $X64_URL | cut -d '_' -f 2) + +./check_downloader.py utools $VERSION $X64_URL diff --git a/get/wechat.py b/get/wechat.py deleted file mode 100644 index 6ebd885..0000000 --- a/get/wechat.py +++ /dev/null @@ -1,13 +0,0 @@ -import requests -import re -from module.check import deb - -html = requests.get("https://linux.weixin.qq.com/").text -x64_deb_url = re.findall(r'href="(https:.*x86_64\.deb)"', html)[0] - -last_modified = requests.head(x64_deb_url).headers["Last-Modified"] -# Wed, 06 Nov 2024 02:08:50 GMT -version = "-".join(last_modified.split(" ")[1:5]) -# 06-Nov-2024-02:08:50 - -deb("wechat", version, x64_deb_url) diff --git a/get/wechat.sh b/get/wechat.sh new file mode 100644 index 0000000..f050a37 --- /dev/null +++ b/get/wechat.sh @@ -0,0 +1,9 @@ +WEB_CONTENT=$(curl -s "https://linux.weixin.qq.com/") +X64_URL=$(echo $WEB_CONTENT | grep -o 'https:[0-9a-zA-Z/\._]*x86_64\.deb') + +Last_Modified=$(curl -sI $X64_URL | grep "Last-Modified") +# Last-Modified: Wed, 06 Nov 2024 02:08:50 GMT +VERSION=$(echo $Last_Modified | cut -d ' ' -f 3-6 | sed 's/ /-/g') +# 06-Nov-2024-02:08:50 + +./check_downloader.py wechat $VERSION $X64_URL diff --git a/get/wemeet.py b/get/wemeet.py deleted file mode 100644 index 595f7d3..0000000 --- a/get/wemeet.py +++ /dev/null @@ -1,28 +0,0 @@ -import requests -import json -from module.check import deb - -""" -https://meeting.tencent.com/web-service/query-download-info?q=[\ -{"package-type":"app","channel":"0300000000","platform":"linux","arch":"x86_64","decorators":["deb"]},\ -{"package-type":"app","channel":"0300000000","platform":"linux","arch":"arm64","decorators":["deb"]},\ -{"package-type":"app","channel":"0300000000","platform":"linux","arch":"loongarch64","decorators":["deb"]}\ -]&nonce=D38mxpWk6TMTA44a -""" - -download_list_url = "https://meeting.tencent.com/web-service/query-download-info?q=%5B\ -%7B%22package-type%22%3A%22app%22%2C%22channel%22%3A%220300000000%22%2C%22platform%22%3A%22linux%22%2C%22arch%22%3A%22x86_64%22%2C%22decorators%22%3A%5B%22deb%22%5D%7D%2C\ -%7B%22package-type%22%3A%22app%22%2C%22channel%22%3A%220300000000%22%2C%22platform%22%3A%22linux%22%2C%22arch%22%3A%22arm64%22%2C%22decorators%22%3A%5B%22deb%22%5D%7D%2C\ -%7B%22package-type%22%3A%22app%22%2C%22channel%22%3A%220300000000%22%2C%22platform%22%3A%22linux%22%2C%22arch%22%3A%22loongarch64%22%2C%22decorators%22%3A%5B%22deb%22%5D%7D\ -%5D&nonce=D38mxpWk6TMTA44a" - -res = requests.get(download_list_url) -res.encoding = "utf-8" - -download_list = json.loads(res.text) - -version = download_list["info-list"][0]["version"] -x64_deb_url = download_list["info-list"][0]["url"] -# print(version, x64_deb_url) - -deb("wemeet", version, x64_deb_url) diff --git a/get/wemeet.sh b/get/wemeet.sh new file mode 100644 index 0000000..ab650d8 --- /dev/null +++ b/get/wemeet.sh @@ -0,0 +1,18 @@ +# https://meeting.tencent.com/web-service/query-download-info?q=[\ +# {"package-type":"app","channel":"0300000000","platform":"linux","arch":"x86_64","decorators":["deb"]},\ +# {"package-type":"app","channel":"0300000000","platform":"linux","arch":"arm64","decorators":["deb"]},\ +# {"package-type":"app","channel":"0300000000","platform":"linux","arch":"loongarch64","decorators":["deb"]}\ +# ]&nonce=D38mxpWk6TMTA44a + +download_list_url="https://meeting.tencent.com/web-service/query-download-info?q=%5B\ +%7B%22package-type%22%3A%22app%22%2C%22channel%22%3A%220300000000%22%2C%22platform%22%3A%22linux%22%2C%22arch%22%3A%22x86_64%22%2C%22decorators%22%3A%5B%22deb%22%5D%7D%2C\ +%7B%22package-type%22%3A%22app%22%2C%22channel%22%3A%220300000000%22%2C%22platform%22%3A%22linux%22%2C%22arch%22%3A%22arm64%22%2C%22decorators%22%3A%5B%22deb%22%5D%7D%2C\ +%7B%22package-type%22%3A%22app%22%2C%22channel%22%3A%220300000000%22%2C%22platform%22%3A%22linux%22%2C%22arch%22%3A%22loongarch64%22%2C%22decorators%22%3A%5B%22deb%22%5D%7D\ +%5D&nonce=D38mxpWk6TMTA44a" + +JSON=$(curl -s $download_list_url) + +VERSION=$(echo $JSON | jq -r '."info-list"[0].version') +X64_URL=$(echo $JSON | jq -r '."info-list"[0].url') + +./check_downloader.py wemeet $VERSION $X64_URL diff --git a/get/wps-office.sh b/get/wps-office.sh new file mode 100644 index 0000000..9af92e5 --- /dev/null +++ b/get/wps-office.sh @@ -0,0 +1,27 @@ +decrypt() { + url=$1 + pathname="/$(echo $url | cut -d '/' -f 4-)" + secrity_key="7f8faaaa468174dc1c9cd62e5f218a5b" + timestamp10=$(date '+%s') + md5hash=$(echo -n "${secrity_key}${pathname}${timestamp10}" | md5sum | cut -d " " -f 1 ) + url="$url?t=${timestamp10}&k=${md5hash}" + echo $url + + # # js + # function downLoad(url) { + # var urlObj=new URL(url); + # var uri=urlObj.pathname; + # var secrityKey="7f8faaaa468174dc1c9cd62e5f218a5b"; + # var timestamp10=Math.floor(new Date().getTime() / 1000); + # var md5hash=CryptoJS.MD5(secrityKey + uri + timestamp10); + # url += '?t=' + timestamp10 + '&k=' + md5hash + # console.log(url); + # } +} + +WEB_CONTENT=$(curl -fs https://linux.wps.cn/) +VERSION=$(echo $WEB_CONTENT | grep -o "

[0-9.]*

" | sed 's/

\(.*\)<\/p>/\1/') +X64_ORI_URL=$(echo $WEB_CONTENT | grep -o "https://[0-9a-zA-Z_\/\.\-]*amd64\.deb" | head -n 1) +X64_URL=$(decrypt $X64_ORI_URL) + +./check_downloader.py wps-office $VERSION $X64_URL \ No newline at end of file diff --git a/get/wps.py b/get/wps.py deleted file mode 100644 index 43c5eb4..0000000 --- a/get/wps.py +++ /dev/null @@ -1,34 +0,0 @@ -import requests -import re -import time -import hashlib -from module.check import deb - -res = requests.get("https://linux.wps.cn/") -res.encoding = "utf-8" - -version = re.findall(r"

(.*)

", res.text)[0] - -"""js -function downLoad(url) { - var urlObj = new URL(url); - var uri = urlObj.pathname; - var secrityKey = "7f8faaaa468174dc1c9cd62e5f218a5b"; - var timestamp10 = Math.floor(new Date().getTime() / 1000); - var md5hash = CryptoJS.MD5(secrityKey + uri + timestamp10); - url += '?t=' + timestamp10 + '&k=' + md5hash - console.log(url); -} -""" - -secrityKey = "7f8faaaa468174dc1c9cd62e5f218a5b" -timestamp10 = str(int(time.time())) - -x64_deb_url = re.findall(r"https://.*/wps/download/.*_amd64.deb", res.text)[0] -x64_deb_pathname = "/" + "/".join(x64_deb_url.split("/")[3:]) -x64_deb_md5hash = hashlib.md5(str.encode(secrityKey + x64_deb_pathname + timestamp10)) -x64_deb_url += '?t=' + timestamp10 + '&k=' + x64_deb_md5hash.hexdigest() - -# print(version, x64_deb_url) - -deb("wps-office", version, x64_deb_url) diff --git a/get/xmind-vana.py b/get/xmind-vana.py deleted file mode 100644 index aedf9ae..0000000 --- a/get/xmind-vana.py +++ /dev/null @@ -1,10 +0,0 @@ -import requests -from module.check import deb - -x64_deb_req = requests.head("https://xmind.cn/zen/download/linux_deb/") - -x64_deb_url = x64_deb_req.headers["Location"] -# https://dl3.xmind.cn/Xmind-for-Linux-amd64bit-24.04.10311-202405240010.deb -version = x64_deb_url.split("-")[-2] - -deb("xmind-vana", version, x64_deb_url) diff --git a/get/xmind-vana.sh b/get/xmind-vana.sh new file mode 100644 index 0000000..8bf483f --- /dev/null +++ b/get/xmind-vana.sh @@ -0,0 +1,6 @@ +X64_URL=$(curl -sI "https://xmind.cn/zen/download/linux_deb/" | grep location | cut -d ' ' -f 2) + +# https://dl3.xmind.cn/Xmind-for-Linux-amd64bit-24.04.10311-202405240010.deb +VERSION=$(echo $X64_URL | cut -d '-' -f 5) + +./check_downloader.py xmind-vana $VERSION $X64_URL \ No newline at end of file diff --git a/update_gen.sh b/run.sh similarity index 82% rename from update_gen.sh rename to run.sh index 556ba15..3ebe851 100755 --- a/update_gen.sh +++ b/run.sh @@ -1,13 +1,15 @@ #!/bin/sh date +# import go tools +export PATH="$PATH:$HOME/go/bin/" # merge the Packages files of third-party repositories rm deb/Packages merge-apt-repo # check for updates github-downloader -r -find get -maxdepth 1 -type f -name "*.py" -exec python3 {} \; +find get -maxdepth 1 -type f -name "*.sh" -exec sh {} \; # generate the files cd deb