Redirects to the latest 32-bit (armeabi-v7a) Android TV APK from any
GitHub repository's latest release. Built for linking from a JavaScript-free
Carrd site so a plain <a href> click downloads the right
APK in TV browsers (e.g. TV Bro on Fire OS).
https://<endpoint>/<owner>/<repo>
Examples:
/truefedex/tv-bro→ TV Bro/mlm-games/Fluffy→ Fluffy/NuvioMedia/NuvioTV→ Nuvio/yuliskov/SmartTube→ SmartTube
Append /info (e.g. /yuliskov/SmartTube/info) to preview the chosen file as
JSON instead of being redirected.
Rendering mermaid diagram...
Asset selection (github.ts → pickApk) is strict on architecture, lenient on
release channel:
- Keep only
.apkassets (drops.aab,.sha256checksums, source archives). - If any APK names an ABI, drop the 64-bit / x86-only builds (
arm64-v8a,x86_64, …) so a Fire Stick never gets an incompatible binary. If no APK names an ABI, keep them all — the dev ships one architecture-agnostic build (e.g. AerialViews). - Score the survivors: explicit
armeabi-v7a>universal> ABI-less, withstablepreferred overpreview/beta/rconly as a tiebreaker (so an always-beta repo like Nuvio still resolves). - If nothing usable remains → a standards-compliant
404error page.
The redirect points at GitHub's own browser_download_url, which serves the
file with the correct application/vnd.android.package-archive MIME type and a
Content-Disposition: attachment header. The redirect response mirrors those
hints too, as a belt-and-suspenders measure for older WebView builds (e.g. on a
Fire Stick that no longer receives OTA updates) that may sniff the redirect.
| Path | Resolves to |
|---|---|
/truefedex/tv-bro | …-armeabi-v7a.apk |
/mlm-games/Fluffy | fluffy-…-armeabi-v7a.apk |
/NuvioMedia/NuvioTV | app-full-armeabi-v7a-release.apk (beta) |
/yuliskov/SmartTube | SmartTube_stable_…_armeabi-v7a.apk |
/theothernt/AerialViews | aerial-views-….apk (single, no-ABI) |
/florisboard/florisboard | florisboard-…-stable.apk (no-ABI, stable) |
| File | Purpose |
|---|---|
main.ts | HTTP entrypoint; re-exports the handler |
router.ts | Request routing, redirect, JSON preview, error handling |
github.ts | GitHub API fetch + APK asset selection |
pages.ts | Index and error page HTML |
Unauthenticated GitHub API requests are limited to 60/hour per server IP. Adding a token raises this to 5,000/hour. The token is stored as an encrypted Val Town environment variable and is never exposed in the source, even if this val is public or remixed.
- Create a token (no scopes needed — public read only) at https://github.com/settings/tokens?type=beta.
- Add it as an env var named
GITHUB_TOKEN.
👉 Add GITHUB_TOKEN here: https://www.val.town/x/cgio/latest-github-atv-32/environment-variables?key=GITHUB_TOKEN