diff --git a/README.md b/README.md index ad6ca13..93a289d 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,7 @@ ### Github Releses -> 因服务器资源有限,本仓库可能无法收录部分大文件。 -> 有收录需求也可投稿至星火商店的 [Github Releases 更新配置仓库](https://gitee.com/spark-building-service/github),其和本部分内容是同源的。 +> 也可投稿至星火商店的 [Github Releases 更新配置仓库](https://gitee.com/spark-building-service/github),其和本部分内容是同源的。 | 软件名 | 包名 | amd64 | arm64 | | ----- | ---- | ----- | ----- | diff --git a/check_downloader.py b/check_downloader.py index cb47b74..32bbaca 100755 --- a/check_downloader.py +++ b/check_downloader.py @@ -10,7 +10,7 @@ from threading import Lock DEB_BASE_DIR = "deb" PACKAGES_DIR = "packages" DB_DIR = "data" -USER_AGENT = "Debian APT-HTTP/1.3 (2.6.1)" # from Debian 12 +USER_AGENT = "Debian APT-HTTP/1.3 (3.0.3)" # from Debian 13 version_lock = Lock() @@ -58,7 +58,7 @@ def check_download(name, version, url, arch): file_path = os.path.join(DEB_BASE_DIR, arch, f"{name}_{version}_{arch}.deb") local_version = None - db_path = os.path.join("data", f"{DEB_BASE_DIR}.db") + db_path = os.path.join(DB_DIR, f"{DEB_BASE_DIR}.db") # get local version with version_lock, sqlite3.connect(db_path) as conn: res = conn.execute( @@ -74,6 +74,7 @@ def check_download(name, version, url, arch): os.makedirs(os.path.join(DEB_BASE_DIR, arch), exist_ok=True) if not download(url, file_path): return + logging.info(f"Downloaded {name}:{arch} ({version})") os.makedirs(os.path.join(PACKAGES_DIR, arch), exist_ok=True) if not scan(name, arch, url, file_path): return diff --git a/get-github-releases.py b/get-github-releases.py index 98a4e4c..a1045c0 100755 --- a/get-github-releases.py +++ b/get-github-releases.py @@ -7,7 +7,7 @@ import re from concurrent.futures import ThreadPoolExecutor, wait from check_downloader import check_download -github_info_list = {} +git_repo_list = {} CONFIG = {"data_dir": "data", "proxy": "", "thread": 5} @@ -31,11 +31,11 @@ if __name__ == "__main__": # read all repo info 读取所有仓库配置 with open(os.path.join(CONFIG["data_dir"], "github.json"), "r") as f: - github_info_list = json.load(f) + git_repo_list = json.load(f) tasks = [] with ThreadPoolExecutor(max_workers=CONFIG["thread"]) as executor: - for name, repo in github_info_list.items(): + for name, repo in git_repo_list.items(): if "site" in repo: repo_url = os.path.join(repo["site"], repo['repo']) else: