English · 中文 README
| Project name (EN) | GH Release Fetch |
| Project name (ZH) | GitHub 发行版拉取工具 |
| Repository | shellsec/gh-release-fetch |
| Description (EN) | Cross-platform JSON catalog + Python helper to resolve versions from GitHub Releases (release pages and API), pick the right Windows/macOS/Linux asset, download it, and optionally run the installer. Mirrors are tried first where configured, with fallback to github.com. |
| Description (ZH) | 基于 GitHub Releases(发布页与 API)的跨平台 JSON 清单 + Python 脚本:解析版本、匹配安装包/归档、下载并可选择启动安装程序;支持镜像优先与回退官方。 |
This repository helps you maintain a version-controlled list of open-source (and other) apps that ship binaries on GitHub Releases, and automate check → download → (optional) install instead of clicking through noisy release pages.
Core files
auto_update.py— loads merged config fromapps/(or legacy rootapps.json), resolves latest release, downloads assets, optionally launches installers.apps/— recommended layout:apps/root.json+ per-platform JSON shards underapps/windows/,apps/darwin/,apps/linux/. Falls back toapps/darwin.json/apps/linux.jsonif shard dirs are empty. Monolith backup:apps.json.monolith.bak; optional backups after splitting:apps/darwin.json.bak,apps/linux.json.bak.run_update.bat— Windows shortcut: checks Python, installs deps, runspython auto_update.py.
Approximate catalog size (changes when you edit JSON): ~277 Windows entries across 26 shard files; ~170 each for darwin and linux. Confirm with the log line “已从 apps/ 目录合并配置” when you run the script.
Scope: entries target assets discoverable from GitHub (or mirrors). No cracked software, piracy, or license circumvention. Some rows are stubs until you add full installer_markers / download_names / save_name rules.
- Release pages mix many assets (OS, arch, portable, checksums); picking the right
.exe/.msi/.zipis slow and error-prone. - Version vs “latest” can disagree between page title,
latestAPI, and pre-releases. - Networks block or throttle GitHub; you want mirror → official → API style fallback.
- Many tools ⇒ you want a single maintainable manifest instead of ad-hoc bookmarks.
- Users and admins who refresh open-source desktop/CLI tools from GitHub and want
enabled: true+ scheduledpython auto_update.py(Task Scheduler,cron, etc.). - Anyone who wants filenames and logs that reflect versions (
save_name,update_log.txt,github_page_<platform>_<id>.html). - Not ideal for apps only on app stores, closed-source without public GitHub assets, or releases with naming that cannot be matched by the JSON rules.
| Topic | Note |
|---|---|
| “Latest” each run | The script re-resolves the current release from the page/API; it does not sync the whole GitHub repo. GitHub’s latest API usually skips drafts and pre-releases; behavior may differ if a project only ships prereleases. |
| Re-download | Whether an existing file is skipped depends on auto_update.py; use logs and expected filenames to see if a re-run fetched again. |
| Upstream renames | If tags or asset names change, update installer_markers, download_names, version_tag_as_on_github, prefer_api_assets, etc. |
| Rule quality | Only rows with complete matching rules are suitable for unattended schedules; stub rows need manual completion. |
| Item | Detail |
|---|---|
| OS | Script runs on Windows, macOS, Linux; run_update.bat is Windows-only. |
| Python | 3.6+ (same as run_update.bat message); prefer a supported 3.x release. |
| pip | Install dependencies with pip install -r requirements.txt. |
requests(≥2.25.0) — HTTP and GitHub API.beautifulsoup4(≥4.9.0) — parse GitHub release HTML.
| Item | Detail |
|---|---|
| GitHub | Reach github.com and api.github.com (or get them via fallback). If releases_url uses a mirror (e.g. bgithub.xyz), the script can fall back to official release pages and then the API. |
| TLS | Use --insecure or root apps/root.json "ssl_verify": false only when needed (MITM risk); revert when certificates are fixed. |
| Item | Detail |
|---|---|
| Recommended | apps/root.json plus shard arrays under apps/windows/, apps/darwin/, apps/linux/ (unique id per platform). Use python tools/split_darwin_linux_to_dirs.py to migrate legacy single-file darwin/linux lists. |
| Legacy | Root apps.json if apps/root.json is absent. |
| Per app | At minimum: id, releases_url, repo_path. |
- Only
enabled: trueentries run; CLI-listed ids must also be enabled. - Data source is primarily GitHub Releases; other distribution channels may not fit the same schema.
pip install -r requirements.txtWindows (double-click)
Run run_update.bat — checks Python, installs requirements, runs python auto_update.py.
CLI (any OS)
python auto_update.pyDefault behavior: detect platform, merge apps/ into platforms.*, process only enabled apps, try releases_url then official GitHub and API, prefer tag-derived versions when the page is ambiguous.
In the relevant shard under apps/windows/ (or darwin/linux), set:
"enabled": trueGlobal options live in apps/root.json.
python auto_update.py obsidian vscodium nodejspython auto_update.py --platform windows
python auto_update.py nodejs --platform windowspython auto_update.py --insecureOr in apps/root.json: "ssl_verify": false (temporary).
Order of operations (see auto_update.py for details): entry releases_url → on failure, https://github.com/<owner>/<repo>/releases → optional API. Optional root release_page_mirrors list for extra release-page hosts.
download_dir in apps/root.json sets the root (e.g. "." or "downloads").
If download_subdir_by_platform is true (default in this repo), files go under:
{download_dir}/{windows|darwin|linux}/…
Logs include [platform: …] and the resolved target directory. Large files via public proxies may be slow; the console shows percent (with decimals) and MiB to avoid a stuck “0%” display. Direct GitHub URLs are tried in the script’s mirror chain.
Required: id, releases_url, repo_path.
Useful optional fields: enabled, installer_markers, download_names, download_url_templates, save_name, windows_installer, installer_extensions, process_name, kill_before_install, run_installer, url_hint, href_exclude_substrings, installer_markers_match_all, prefer_api_assets, version_tag_as_on_github.
Human-oriented field glossary: _说明 inside apps/root.json (keys starting with _ are not consumed by the script).
Root keys: download_dir, ssl_verify, download_subdir_by_platform, release_page_mirrors, etc.
- Prefer fully specified rules before enabling many apps for cron; smoke-test single
idfirst. - Archives with
run_installer: falseare not auto-extracted. - Special cases (e.g.
nodejs) may use extra official URLs — see script. - Unauthenticated GitHub API rate limits can return 403; retry later, use a proxy, or wire a token into your environment for
requests(not built into this repo). - If tag names and file names diverge (e.g.
release-1.xvs1.xin the asset),{ver}templates may need manual tuning.
pip install -r requirements.txt
python auto_update.py
python auto_update.py nodejs
python auto_update.py --platform windows
python auto_update.py --insecure- Log file:
update_log.txt - Saved release HTML:
github_page_<platform>_<app_id>.html(e.g.github_page_windows_obsidian.html) - On failure: check
releases_url, fallbacks, markers vs real asset names, TLS,enabled, API rate limits
- Reset all
enabledtofalse:python tools/reset_enabled_json.py(--dry-runto preview) - Split legacy
apps/darwin.json/apps/linux.jsoninto shard dirs:python tools/split_darwin_linux_to_dirs.py(backs up*.json.bak) - Monolith vs
apps/notes:apps/root.json→_说明
Former working title: GithubWinDownTools — renamed for clarity now that darwin/linux catalogs are first-class.