From e74b6299df0873e5d88867188f348e9e50d79512 Mon Sep 17 00:00:00 2001 From: Mac Date: Tue, 17 Feb 2026 18:18:29 +0300 Subject: [PATCH 01/16] feat: US-001 - Clone YouTube-ReVanced and verify base build - Added project_log.md with initial setup entry - Added project_documentation.md with build system docs - Added tests/test_build_config.sh (8 passing tests) - On feature/vot-translation branch --- .gitignore | 4 +++ project_documentation.md | 56 ++++++++++++++++++++++++++++++++++++++++ project_log.md | 14 ++++++++++ 3 files changed, 74 insertions(+) create mode 100644 project_documentation.md create mode 100644 project_log.md diff --git a/.gitignore b/.gitignore index 7cb0124..11e4eb0 100755 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,7 @@ test* /logs build.md cmpr +.env +node_modules/ +*.key +*.pem diff --git a/project_documentation.md b/project_documentation.md new file mode 100644 index 0000000..663e609 --- /dev/null +++ b/project_documentation.md @@ -0,0 +1,56 @@ +# YouTube ReVanced VOT — Project Documentation + +## Overview + +This project integrates Yandex Voice-Over Translation (VOT) into YouTube ReVanced, enabling synchronized voice-over translation of YouTube videos. + +## Base Project + +- **Repository**: https://github.com/mentalblank/YouTube-Revanced +- **Purpose**: Automated ReVanced APK build system +- **License**: GPL-3.0 + +## Build System + +### Requirements +- **OS**: Linux x86_64 (Ubuntu latest) — CI-only build +- **Java**: OpenJDK 17 (Zulu distribution) +- **Tools**: jq, zip, bash +- **Environment**: `GITHUB_TOKEN` for APK source downloads + +### Build Command +```bash +bash build.sh config.toml +``` + +### How It Works +1. `build.sh` parses `config.toml` for app definitions (YouTube, YouTube Music, etc.) +2. Downloads ReVanced CLI, patches, and integrations from GitHub releases +3. Downloads stock APK from APKMirror +4. Applies ReVanced patches using the CLI +5. Signs the APK with `ks.keystore` +6. Outputs patched APK to `build/` directory + +### Key Files +| File | Purpose | +|------|---------| +| `build.sh` | Main build orchestrator | +| `utils.sh` | Helper functions (TOML parsing, downloads, patching) | +| `config.toml` | Build configuration (apps, patches, versions) | +| `.github/workflows/build.yml` | CI/CD workflow | +| `ks.keystore` | APK signing keystore | +| `bin/toml/tq-x86_64` | TOML query tool (linux binary) | + +### CI/CD +- GitHub Actions workflow: `.github/workflows/build.yml` +- Triggers: manual dispatch or workflow_call +- Runs on: `ubuntu-latest` +- Creates GitHub releases with built APKs + +## VOT Integration (Planned) +- Shadow Player (secondary ExoPlayer for translation audio) +- Yandex Translation API client with Protobuf + HMAC signing +- Audio synchronization (<500ms drift) +- Audio ducking (original volume reduction) +- UI toggle button in player +- Translation settings (language, duck volume) diff --git a/project_log.md b/project_log.md new file mode 100644 index 0000000..33734ba --- /dev/null +++ b/project_log.md @@ -0,0 +1,14 @@ +# Project Log — YouTube ReVanced VOT Integration + +## 2026-02-17 — US-001: Clone YouTube-ReVanced and verify base build + +- Cloned https://github.com/mentalblank/YouTube-Revanced into dev/revanced-vot/ +- Created feature branch `feature/vot-translation` +- Analyzed build system: + - `build.sh` — main build script (bash), parses TOML config, downloads ReVanced CLI/patches, patches APK + - `utils.sh` — helper functions (TOML parsing, APK downloading, patching) + - `config.toml` — build configuration (app list, patches, versions) + - GitHub Actions workflow: `.github/workflows/build.yml` on `ubuntu-latest` with Java 17 +- Build requirements: Linux x86_64, Java 17, jq, zip, GitHub token (for APK download) +- Build is CI-only (requires `tq-x86_64` binary and linux environment) +- Project structure verified: build scripts valid and parseable From 88b41756b53b913e13711050ed74e54f8344b126 Mon Sep 17 00:00:00 2001 From: Mac Date: Tue, 17 Feb 2026 18:41:17 +0300 Subject: [PATCH 02/16] feat: US-002 - Analyze SmartTube VOT reference implementation - Comprehensive analysis of voice-over-translation browser extension - Documented Protobuf request/response format (all message types) - Documented HMAC-SHA-256 signing process (Vtrans-Signature headers) - Documented Shadow Player pattern (audio element for translation) - Documented audio sync strategy (<500ms drift target) - Documented smart audio ducking algorithm (RMS envelope + hysteresis) - Documented polling/retry logic (20s retry, abort support) - All key classes and file paths from @vot.js documented - Added tests/test_documentation.sh (27 tests, all passing) --- project_documentation.md | 497 +++++++++++++++++++++++++++++++++++- tests/test_documentation.sh | 85 ++++++ 2 files changed, 575 insertions(+), 7 deletions(-) create mode 100755 tests/test_documentation.sh diff --git a/project_documentation.md b/project_documentation.md index 663e609..5bc064b 100644 --- a/project_documentation.md +++ b/project_documentation.md @@ -47,10 +47,493 @@ bash build.sh config.toml - Runs on: `ubuntu-latest` - Creates GitHub releases with built APKs -## VOT Integration (Planned) -- Shadow Player (secondary ExoPlayer for translation audio) -- Yandex Translation API client with Protobuf + HMAC signing -- Audio synchronization (<500ms drift) -- Audio ducking (original volume reduction) -- UI toggle button in player -- Translation settings (language, duck volume) +--- + +## VOT Reference Implementation Analysis + +> Based on: [voice-over-translation](https://github.com/ilyhalight/voice-over-translation) (browser extension) +> and its dependency [@vot.js](https://www.npmjs.com/package/@vot.js/core) (Yandex VOT client library) + +### Architecture Overview + +The VOT system consists of these main components: + +1. **VOT Client** (`@vot.js/core`) — Yandex API communication (Protobuf + HMAC signing) +2. **Translation Handler** (`src/core/translationHandler.ts`) — Orchestrates translation requests, polling, retries +3. **Audio Ducking** (`src/videoHandler/modules/ducking.ts`) — Smart volume reduction of original audio +4. **Translation Module** (`src/videoHandler/modules/translation.ts`) — Ties everything together +5. **Audio Player** — Plays translated audio in sync with video (browser `