update-yt-dlp #1561
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: update-yt-dlp | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| jobs: | |
| update-yt-dlp : | |
| runs-on: ubuntu-latest | |
| steps: | |
| - | |
| name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.AUTOUPDATE_PAT }} | |
| - | |
| name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.13' | |
| - | |
| name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - | |
| name: Update yt-dlp | |
| run: | | |
| uv sync --locked | |
| # Check if yt-dlp has updates available | |
| LATEST_VERSION=$(uv pip list --outdated --format json | jq -r '.[] | select(.name == "yt-dlp") | .latest_version') | |
| CURRENT_VERSION=$(uv pip list --format json | jq -r '.[] | select(.name == "yt-dlp") | .version') | |
| if [ -n "$LATEST_VERSION" ] && [ "$LATEST_VERSION" != "$CURRENT_VERSION" ]; then | |
| echo "Updating yt-dlp from $CURRENT_VERSION to $LATEST_VERSION" | |
| uv lock --upgrade-package "yt-dlp[default,curl-cffi]" | |
| git config --global user.email "updater@metube" | |
| git config --global user.name "AutoUpdater" | |
| git add uv.lock | |
| git commit -m "upgrade yt-dlp from $CURRENT_VERSION to $LATEST_VERSION" | |
| git push | |
| else | |
| echo "yt-dlp is already up to date ($CURRENT_VERSION)" | |
| fi |