How 25175/tvyuan works
Purpose and published artifacts
This repository is an automated TVBox media-source aggregator. It fetches upstream source definitions, validates and ranks sources, then commits client-consumable JSON configurations:
• Compact, tested collector sources: tvbox.json
• Merged full configuration with spider/JAR support: tvbox_full.json
• Separate upstream repositories for multi-repository-capable clients: tvbox_multi.json
Entrypoints and automation
The operational entrypoint is update.py, executed on an hourly GitHub Actions schedule. The workflow in .github/workflows/update.yml is the production orchestrator: it runs the updater and publishes refreshed generated JSON back to the repository. Static inputs and generated outputs are versioned together.
Source ingestion boundary
sources.txt is the upstream-source registry consumed by the update process. Upstream data originates from the external TVBox source service described in the README. update.py is responsible for pulling source configurations and treating remote source data as untrusted: unavailable entries are removed and can reappear in later runs once reachable.
Grounding paths:
• sources.txt
• update.py
Validation and ranking pipeline
update.py implements the central quality pipeline: retrieve candidate video content, fetch and parse m3u8 playlists, download TS segments, and calculate sustained playback speed. Collector sources are ordered by measured playback performance; crawler-style sources are ordered by latency. Sony and 360 sources are explicitly pinned ahead of normal ranking.
This separates client-facing source ordering from raw upstream order and ensures the compact output retains only the fastest fixed subset of collector sources.
Grounding paths:
• update.py
• tvbox.json
Configuration assembly variants
The updater projects one source pool into three compatibility-oriented output contracts:
• tvbox.json: minimal collector-only configuration, fixed to the fastest ten and independent of a JAR.
• tvbox_full.json: aggregate configuration retaining all applicable sites, with collectors first and crawler sites later, including spider/JAR references.
• tvbox_multi.json: preserves individual upstream repositories and their associated JAR/site sets for clients that support switching repositories.
Grounding paths:
• tvbox.json
• tvbox_full.json
• tvbox_multi.json
Runtime, network, and delivery infrastructure
Python is the execution runtime implied by update.py; GitHub Actions supplies scheduled compute and repository write/publish automation. The update environment uses a Cloudflare Tunnel plus a local/domestic-IP proxy for tests against collection sites that may block GitHub-hosted IP ranges. Final JSON is delivered through repository raw URLs and a custom direct domain, while Gitee is an additional mirror/distribution channel.
Grounding paths:
• .github/workflows/update.yml
• update.py
• README.md
Primary control flow
Hourly schedule → workflow execution → load sources.txt → fetch upstream repository/source definitions → playback/latency checks through proxy/tunnel → remove failed sources and rank viable ones → generate compact/full/multi JSON projections → commit updated tvbox*.json artifacts. Consumers never invoke repository code; TVBox-compatible clients fetch the published JSON artifacts directly.
Main entry points: update.py Candidate sources · update.yml Repository publishing · tvbox.json Compact config · tvbox_full.json Full config
Components 16
Automation
- Hourly schedule
.github/workflows/update.yml - Update workflow · Runs and publishes the updater.
.github/workflows/update.yml - Python runtime
update.py - Repository publishing · Commits generated artifacts with their static inputs.
.github/workflows/update.yml
Update pipeline
- Upstream registry · Lists upstream source repositories.
sources.txt - Updater · Fetches, validates, ranks, and assembles source configurations.
update.py - Tunnel and domestic proxy · Routes checks around collection-site IP blocking.
update.py - Candidate sources · Remote entries treated as untrusted until validated.
update.py - Playback checks · Fetches content, parses m3u8, downloads TS segments, and measures sustained speed.
update.py - Ranking and filtering · Removes failures; pins Sony and 360; ranks collectors by speed and crawlers by latency.
update.py
Published artifacts
- Compact config · Fastest ten collector sources without a JAR.
tvbox.json - Full config · All applicable sites, with collectors first and spider/JAR support.
tvbox_full.json - Multi-repository config · Preserves upstream repositories and their JAR/site sets.
tvbox_multi.json
Other components
- TVBox source service · Provides remote source configurations.
- TVBox-compatible clients · Fetch published JSON directly rather than running repository code.
- Raw, custom-domain, and Gitee delivery
README.md
Connections 18
- Hourly schedule → Update workflow: triggers
- Update workflow → Python runtime: runs
- Python runtime → Updater: executes
- Upstream registry → Updater: source URLs
- TVBox source service → Candidate sources: source definitions
- Updater → Candidate sources: fetches
- Tunnel and domestic proxy → Playback checks: routes checks
- Candidate sources → Playback checks: validates collectors
- Playback checks → Ranking and filtering: speed results
- Candidate sources → Ranking and filtering: crawler latency
- Ranking and filtering → Compact config: top 10 collectors
- Ranking and filtering → Full config: merged sites and JARs
- Candidate sources → Multi-repository config: preserved upstream sets
- Compact config → Repository publishing: committed
- Full config → Repository publishing: committed
- Multi-repository config → Repository publishing: committed
- Repository publishing → Raw, custom-domain, and Gitee delivery: publishes
- Raw, custom-domain, and Gitee delivery → TVBox-compatible clients: serves configs