#
ReVanced Version Updater
This directory contains scripts for updating ReVanced version information using the new v4 API.
#
Files
update_versions.py
- Main script that updates versions and manages git branchesrun_updater.sh
- Bash wrapper script for easier executiontest_api.py
- Test script to verify API connectivity and parsingtest_dry_run.py
- Dry-run test that simulates the update processrequirements.txt
- Python dependenciesgithub-actions-template.yml
- Template for GitHub Actions workflownew-workflow.yml
- Complete replacement workflow for the old systemMIGRATION.md
- Detailed migration guide from old to new systemlist.json
- Sample response from patches list API (for reference)version.json
- Sample response from patches version API (for reference)
#
Main Script: update_versions.py
#
Features
- Fetches data from ReVanced API v4 endpoints
- Parses patch compatibility information
- Finds the latest supported YouTube version
- Replaces placeholders in markdown files:
20.13.41
→ Latest YouTube version (e.g., "20.12.46")2025-08-05 18:20:16 UTC
→ Timestamp of last update (e.g., "2025-06-18 16:11:26 UTC")- APKMirror URLs → Automatically updates hardcoded dashed versions (e.g., "youtube-19-43-41-release" → "youtube-20-12-46-release")
- Manages git branches (works on
docs-base
, commits tomain
) - Exports outputs for GitHub Actions
#
API Endpoints Used
https://api.revanced.app/v4/patches/list
- List of all patches with compatibility infohttps://api.revanced.app/v4/patches/version
- Latest patches version
#
Usage
# Using the wrapper script (recommended)
./python/run_updater.sh # Normal run
./python/run_updater.sh --dry-run # Test without making changes
./python/run_updater.sh --force # Force update
# Or run directly
cd /path/to/repository
pip install -r python/requirements.txt
python3 python/update_versions.py
#
Environment Variables
GITHUB_ACTIONS=true
- Enables GitHub Actions modeGITHUB_OUTPUT
- File path for GitHub Actions outputsEVENT=workflow_dispatch
- Forces update when manually triggeredFORCE=1
- Forces update in local mode
#
Git Workflow
- Ensures it's running on
docs-base
branch - Fetches latest data from API
- Updates placeholders in all markdown files
- Commits changes to
main
branch - Returns to
docs-base
branch
#
Outputs (GitHub Actions)
modified
- Whether files were updated (true
/false
)youtube_version
- Latest supported YouTube versionlast_update
- Timestamp of the update
#
Testing
#
Test API connectivity:
python3 test_api.py
#
Dry-run test (no file modifications):
python3 test_dry_run.py
#
Migration from checkReVancedVersion.py
The new script (update_versions.py
) replaces checkReVancedVersion.py
with these improvements:
- Updated API: Uses v4 API instead of deprecated v2
- Simplified structure: Cleaner, more maintainable code
- Git integration: Handles branch management automatically
- Better error handling: More robust error handling and logging
- Flexible placeholders: Supports multiple placeholder types
- Modern Python: Uses timezone-aware datetime objects
#
Configuration Files
The script uses the existing configuration structure:
.conf/python/update.state
- Tracks last update and data.conf/python/update.lut.json
- Package name to common name lookup.conf/python/update.template
- Template for version table (legacy)
#
Dependencies
requests
- For API callspackaging
- For version comparisongit
- Must be available in PATH for git operations
#
GitHub Actions Integration
#
Quick Setup
- Copy
new-workflow.yml
to.github/workflows/update-versions.yml
- Disable the old workflow (
version-and-lastCheck-bump.yml
) - Ensure
docs-base
branch exists - Configure secrets if using Discord notifications
#
Workflow Features
- Automatic scheduling: Runs every 30 minutes (configurable)
- Manual triggering: Can be triggered manually with force option
- Branch management: Automatically handles
docs-base
↔main
workflow - Website rebuilding: Triggers retype rebuild when versions change
- Notifications: Discord webhook support for updates and failures
- Error handling: Creates GitHub issues for failures
#
Required Secrets (Optional)
DISCORD_WEBHOOK
- For Discord notifications
#
Migration from Old System
See MIGRATION.md
for detailed instructions on migrating from checkReVancedVersion.py
to the new system.