Add fork documentation and rewrite README

- README: watch-first feature overview, install + libmpv requirement,
  fork attribution.
- docs/UPSTREAM.md: upstream merge procedure, expected conflict zones,
  list of SageTube-only modules.
- docs/BUILDING.md: per-OS libmpv install, managed-binary locations,
  playback reliability notes, warning that inherited GitHub release
  workflows download appimagetool/ffmpeg without checksum verification.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jaroslav Beneš
2026-07-25 02:46:59 +02:00
parent 8a05d5ff8f
commit b4ff618d41
3 changed files with 123 additions and 4 deletions
+48
View File
@@ -0,0 +1,48 @@
# Building & running SageTube
## Requirements
- Python >= 3.10
- **libmpv** (system library; `python-mpv` binds to it at runtime)
- Arch: `sudo pacman -S mpv`
- Debian/Ubuntu: `sudo apt install libmpv2`
- Fedora: `sudo dnf install mpv-libs`
- macOS: `brew install mpv`
- Windows: place `libmpv-2.dll` next to the executable (builds from
https://github.com/shinchiro/mpv-winbuild-cmake/releases), or install mpv
and add it to PATH
- ffmpeg (for download merging; the app can auto-install it)
Without libmpv the app still runs — the Watch tab shows an install hint and
search/browse/download work normally.
## Run from source
```bash
python -m venv .venv && source .venv/bin/activate
pip install -e .
sagetube
```
On first start the app downloads its own SHA256-verified `yt-dlp` binary and
the Deno runtime (yt-dlp's JS challenge solver) into the SageTube data dir:
- Linux: `~/.local/share/SageTube/bin/`
- macOS: `~/Library/Application Support/SageTube/bin/`
- Windows: `%LOCALAPPDATA%\SageTube\bin\`
## Notes on YouTube playback reliability
Playback resolves streams through mpv's `ytdl_hook` using the managed yt-dlp.
YouTube's CDN intermittently serves stalled streams to non-browser clients;
the player retries automatically (twice, after 25 s of no playback). Keeping
yt-dlp updated (built-in updater, stable or nightly channel) is the long-term
fix channel for extractor breakage.
## Release workflows
The `.github/workflows/` files are inherited from upstream YTSage and target
GitHub runners; they do not run on Gitea. If you set up Gitea Actions, note
that the upstream Linux/Windows workflows download appimagetool and a bundled
ffmpeg **without checksum verification** — add hash checks before reusing
them for release artifacts.
+38
View File
@@ -0,0 +1,38 @@
# Tracking upstream YTSage
SageTube keeps the full git history of [YTSage](https://github.com/oop7/YTSage)
and the internal `ytsage` package name so upstream improvements can be merged.
## Syncing
```bash
git fetch upstream # upstream = https://github.com/oop7/YTSage.git
git merge upstream/main
```
## Expected conflict zones
Most SageTube features live in **new files** and merge cleanly. Conflicts are
likely only in:
| File | Reason |
|---|---|
| `ytsage/gui/ytsage_gui_main.py` | tab-shell edit in `init_ui` (`_setup_main_tabs`), closeEvent hook |
| `ytsage/gui/ytsage_gui_analysis.py` | delegates subprocess execution to `YtdlpClient` |
| `ytsage/utils/ytsage_constants.py` | SageTube data dirs, PATH prepend for managed binaries |
| `ytsage/utils/ytsage_config_manager.py` | atomic save, defaults merge, player/feed/advanced keys |
| `pyproject.toml` | name, version, deps (python-mpv), URLs |
| `ytsage/languages/en.json` | added sections: player, cards, main_tabs, search, watch, browse, feed |
Bug fixes made in this fork (see git log between the merge commit and the
first feature commit) may also conflict if upstream fixes them differently —
prefer whichever version is stricter about verification and thread safety.
## SageTube-only modules (never conflict)
- `ytsage/core/ytsage_client.py` — shared yt-dlp JSON invocation layer
- `ytsage/core/ytsage_mpv.py` — libmpv probe
- `ytsage/gui/ytsage_gui_player.py` — embedded mpv player
- `ytsage/gui/ytsage_gui_watch.py` / `_search.py` / `_browse.py` / `_feed.py` — tabs
- `ytsage/gui/ytsage_gui_router.py` / `_cards.py` — navigation + video cards
- `ytsage/utils/ytsage_library_manager.py` — subscriptions/history/queue DB