From 1d426f1b86a6efa1ac9f5c2f4a17688bd472614e Mon Sep 17 00:00:00 2001 From: bashonly Date: Tue, 12 Aug 2025 00:25:48 -0500 Subject: [PATCH 1/8] [build] Add Windows arm64 builds Authored by: bashonly --- .github/workflows/build.yml | 89 ++++++++++--------------------------- README.md | 5 ++- yt_dlp/update.py | 1 + 3 files changed, 28 insertions(+), 67 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 810490f735..6669804ed6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,9 +27,6 @@ on: windows: default: true type: boolean - windows32: - default: true - type: boolean origin: required: false default: '' @@ -72,11 +69,7 @@ on: default: true type: boolean windows: - description: yt-dlp.exe, yt-dlp_win.zip - default: true - type: boolean - windows32: - description: yt-dlp_x86.exe + description: yt-dlp.exe, yt-dlp_win.zip, yt-dlp_x86.exe, yt-dlp_win_x86.zip, yt-dlp_arm64.exe, yt-dlp_win_arm64.zip default: true type: boolean origin: @@ -399,18 +392,26 @@ jobs: windows: needs: process if: inputs.windows - runs-on: windows-latest + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - { arch: 'x64', runner: 'windows-2025', suffix: '' } + - { arch: 'x86', runner: 'windows-2025', suffix: '_x86'} + - { arch: 'arm64', runner: 'windows-11-arm', suffix: '_arm64' } steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.11" # arm64 only has Python >= 3.11 available + architecture: ${{ matrix.arch }} - name: Install Requirements - run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds + run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds python devscripts/install_deps.py -o --include build - python devscripts/install_deps.py --include curl-cffi - python -m pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-6.13.0-py3-none-any.whl" + python devscripts/install_deps.py ${{ (matrix.arch != 'x86' && '--include curl-cffi') || '' }} + python -m pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/${{ matrix.arch }}/pyinstaller-6.15.0-py3-none-any.whl" - name: Prepare run: | @@ -420,12 +421,15 @@ jobs: run: | python -m bundle.pyinstaller python -m bundle.pyinstaller --onedir - Compress-Archive -Path ./dist/yt-dlp/* -DestinationPath ./dist/yt-dlp_win.zip + Compress-Archive -Path ./dist/yt-dlp${{ matrix.suffix }}/* -DestinationPath ./dist/yt-dlp_win${{ matrix.suffix }}.zip - name: Verify --update-to - if: vars.UPDATE_TO_VERIFICATION + # if: vars.UPDATE_TO_VERIFICATION + # Temporarily skip for arm64 until there is a release that it can --update-to + if: | + vars.UPDATE_TO_VERIFICATION && matrix.arch != 'arm64' run: | - foreach ($name in @("yt-dlp")) { + foreach ($name in @("yt-dlp${{ matrix.suffix }}")) { Copy-Item "./dist/${name}.exe" "./dist/${name}_downgraded.exe" $version = & "./dist/${name}.exe" --version & "./dist/${name}_downgraded.exe" -v --update-to yt-dlp/yt-dlp@2023.03.04 @@ -438,56 +442,10 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: build-bin-${{ github.job }} - path: | - dist/yt-dlp.exe - dist/yt-dlp_win.zip - compression-level: 0 - - windows32: - needs: process - if: inputs.windows32 - runs-on: windows-latest - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - architecture: "x86" - - name: Install Requirements - run: | - python devscripts/install_deps.py -o --include build - python devscripts/install_deps.py - python -m pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/i686/pyinstaller-6.13.0-py3-none-any.whl" - - - name: Prepare - run: | - python devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}" - python devscripts/make_lazy_extractors.py - - name: Build - run: | - python -m bundle.pyinstaller - - - name: Verify --update-to - if: vars.UPDATE_TO_VERIFICATION - run: | - foreach ($name in @("yt-dlp_x86")) { - Copy-Item "./dist/${name}.exe" "./dist/${name}_downgraded.exe" - $version = & "./dist/${name}.exe" --version - & "./dist/${name}_downgraded.exe" -v --update-to yt-dlp/yt-dlp@2023.03.04 - $downgraded_version = & "./dist/${name}_downgraded.exe" --version - if ($version -eq $downgraded_version) { - exit 1 - } - } - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: build-bin-${{ github.job }} + name: build-bin-${{ github.job }}-win${{ matrix.suffix }} path: | - dist/yt-dlp_x86.exe + dist/yt-dlp${{ matrix.suffix }}.exe + dist/yt-dlp_win${{ matrix.suffix }}.zip compression-level: 0 meta_files: @@ -500,7 +458,6 @@ jobs: - macos - macos_legacy - windows - - windows32 runs-on: ubuntu-latest steps: - name: Download artifacts diff --git a/README.md b/README.md index 9b28147f2c..53cd2c5c05 100644 --- a/README.md +++ b/README.md @@ -106,10 +106,13 @@ File|Description File|Description :---|:--- [yt-dlp_x86.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_x86.exe)|Windows (Win8+) standalone x86 (32-bit) binary +[yt-dlp_arm64.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_arm64.exe)|Windows (Win8+) standalone arm64 (64-bit) binary [yt-dlp_linux](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux)|Linux standalone x64 binary [yt-dlp_linux_armv7l](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_armv7l)|Linux standalone armv7l (32-bit) binary [yt-dlp_linux_aarch64](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_aarch64)|Linux standalone aarch64 (64-bit) binary -[yt-dlp_win.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win.zip)|Unpackaged Windows executable (no auto-update) +[yt-dlp_win.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win.zip)|Unpackaged Windows (Win8+) x64 executable (no auto-update) +[yt-dlp_win_x86.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win_x86.zip)|Unpackaged Windows (Win8+) x86 executable (no auto-update) +[yt-dlp_win_arm64.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win_arm64.zip)|Unpackaged Windows (Win8+) arm64 executable (no auto-update) [yt-dlp_macos.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos.zip)|Unpackaged MacOS (10.15+) executable (no auto-update) [yt-dlp_macos_legacy](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos_legacy)|MacOS (10.9+) standalone x64 executable diff --git a/yt_dlp/update.py b/yt_dlp/update.py index ca69fbbada..6bff71b5a2 100644 --- a/yt_dlp/update.py +++ b/yt_dlp/update.py @@ -110,6 +110,7 @@ _FILE_SUFFIXES = { 'zip': '', 'win_exe': '.exe', 'win_x86_exe': '_x86.exe', + 'win_arm64_exe': '_arm64.exe', 'darwin_exe': '_macos', 'darwin_legacy_exe': '_macos_legacy', 'linux_exe': '_linux', From e98ada969a2ed424bd8ad4dd2ea1c89a8057d124 Mon Sep 17 00:00:00 2001 From: bashonly Date: Wed, 13 Aug 2025 11:39:45 -0500 Subject: [PATCH 2/8] add temp verify test for arm64 Authored by: bashonly --- .github/workflows/build.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6669804ed6..58d1f0a636 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -439,6 +439,16 @@ jobs: } } + # TODO: remove when there is a windows_arm64 release that we can --update-to + - name: Verify arm64 executable + if: | + vars.UPDATE_TO_VERIFICATION && matrix.arch == 'arm64' + run: | + foreach ($name in @("yt-dlp${{ matrix.suffix }}")) { + & "./dist/${name}.exe" -v || true + & "./dist/${name}.exe" --version + } + - name: Upload artifacts uses: actions/upload-artifact@v4 with: From c63d914255369212f1869dec05ecde6f7942a508 Mon Sep 17 00:00:00 2001 From: bashonly Date: Wed, 13 Aug 2025 11:59:16 -0500 Subject: [PATCH 3/8] still use python 3.10 for x64 and x86 Authored by: bashonly --- .github/workflows/build.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58d1f0a636..e5091c0f27 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -397,15 +397,24 @@ jobs: fail-fast: false matrix: include: - - { arch: 'x64', runner: 'windows-2025', suffix: '' } - - { arch: 'x86', runner: 'windows-2025', suffix: '_x86'} - - { arch: 'arm64', runner: 'windows-11-arm', suffix: '_arm64' } + - arch: 'x64' + runner: windows-2025 + suffix: '' + python_version: '3.10' + - arch: 'x86' + runner: windows-2025 + suffix: '_x86' + python_version: '3.10' + - arch: 'arm64' + runner: windows-11-arm + suffix: '_arm64' + python_version: '3.11' # arm64 only has Python >= 3.11 available steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.11" # arm64 only has Python >= 3.11 available + python-version: ${{ matrix.python_version }} architecture: ${{ matrix.arch }} - name: Install Requirements run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds From b875d88d4b24a017295e835793c38647b73e17f0 Mon Sep 17 00:00:00 2001 From: bashonly Date: Wed, 13 Aug 2025 12:00:45 -0500 Subject: [PATCH 4/8] improve arm64 verify step Authored by: bashonly --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5091c0f27..dd359daf6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -454,7 +454,8 @@ jobs: vars.UPDATE_TO_VERIFICATION && matrix.arch == 'arm64' run: | foreach ($name in @("yt-dlp${{ matrix.suffix }}")) { - & "./dist/${name}.exe" -v || true + & "./dist/${name}.exe" -v --print-traffic --impersonate chrome "https://tls.browserleaks.com/json" -o ./resp.json + & cat ./resp.json & "./dist/${name}.exe" --version } From ed55c38ab814221f4c11e9ff8fad67d9cbc10944 Mon Sep 17 00:00:00 2001 From: bashonly Date: Wed, 13 Aug 2025 12:20:14 -0500 Subject: [PATCH 5/8] use venv and cache arm64 requirements Authored by: bashonly --- .github/workflows/build.yml | 38 ++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd359daf6f..8452abb050 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -392,6 +392,9 @@ jobs: windows: needs: process if: inputs.windows + permissions: + contents: read + actions: write # For cleaning up cache runs-on: ${{ matrix.runner }} strategy: fail-fast: false @@ -416,10 +419,25 @@ jobs: with: python-version: ${{ matrix.python_version }} architecture: ${{ matrix.arch }} + + - name: Restore cached requirements + id: restore-cache + if: matrix.arch == 'arm64' + uses: actions/cache/restore@v4 + env: + SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1 + with: + path: | + /yt-dlp-build-venv + key: cache-reqs-${{ github.job }}_${{ matrix.arch }}-${{ github.ref }} + - name: Install Requirements - run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds + run: | + python -m venv /yt-dlp-build-venv + /yt-dlp-build-venv/Scripts/Activate.ps1 python devscripts/install_deps.py -o --include build python devscripts/install_deps.py ${{ (matrix.arch != 'x86' && '--include curl-cffi') || '' }} + # Use custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds python -m pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/${{ matrix.arch }}/pyinstaller-6.15.0-py3-none-any.whl" - name: Prepare @@ -428,6 +446,7 @@ jobs: python devscripts/make_lazy_extractors.py - name: Build run: | + /yt-dlp-build-venv/Scripts/Activate.ps1 python -m bundle.pyinstaller python -m bundle.pyinstaller --onedir Compress-Archive -Path ./dist/yt-dlp${{ matrix.suffix }}/* -DestinationPath ./dist/yt-dlp_win${{ matrix.suffix }}.zip @@ -468,6 +487,23 @@ jobs: dist/yt-dlp_win${{ matrix.suffix }}.zip compression-level: 0 + - name: Cleanup cache + if: | + matrix.arch == 'arm64' && steps.restore-cache.outputs.cache-hit == 'true' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + cache_key: cache-reqs-${{ github.job }}_${{ matrix.arch }}-${{ github.ref }} + run: | + gh cache delete "${cache_key}" + + - name: Cache requirements + if: matrix.arch == 'arm64' + uses: actions/cache/save@v4 + with: + path: | + /yt-dlp-build-venv + key: cache-reqs-${{ github.job }}_${{ matrix.arch }}-${{ github.ref }} + meta_files: if: always() && !cancelled() needs: From 2f09d71be2c336f4998e32bdc401e9251ee7f772 Mon Sep 17 00:00:00 2001 From: bashonly Date: Wed, 13 Aug 2025 12:43:53 -0500 Subject: [PATCH 6/8] use python 3.13 for arm64 and update README Authored by: bashonly --- .github/workflows/build.yml | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8452abb050..90d4d2c965 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -411,7 +411,7 @@ jobs: - arch: 'arm64' runner: windows-11-arm suffix: '_arm64' - python_version: '3.11' # arm64 only has Python >= 3.11 available + python_version: '3.13' # arm64 only has Python >= 3.11 available steps: - uses: actions/checkout@v4 diff --git a/README.md b/README.md index 53cd2c5c05..85757bbe0c 100644 --- a/README.md +++ b/README.md @@ -106,13 +106,13 @@ File|Description File|Description :---|:--- [yt-dlp_x86.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_x86.exe)|Windows (Win8+) standalone x86 (32-bit) binary -[yt-dlp_arm64.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_arm64.exe)|Windows (Win8+) standalone arm64 (64-bit) binary +[yt-dlp_arm64.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_arm64.exe)|Windows (Win10+) standalone arm64 (64-bit) binary [yt-dlp_linux](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux)|Linux standalone x64 binary [yt-dlp_linux_armv7l](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_armv7l)|Linux standalone armv7l (32-bit) binary [yt-dlp_linux_aarch64](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_aarch64)|Linux standalone aarch64 (64-bit) binary [yt-dlp_win.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win.zip)|Unpackaged Windows (Win8+) x64 executable (no auto-update) [yt-dlp_win_x86.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win_x86.zip)|Unpackaged Windows (Win8+) x86 executable (no auto-update) -[yt-dlp_win_arm64.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win_arm64.zip)|Unpackaged Windows (Win8+) arm64 executable (no auto-update) +[yt-dlp_win_arm64.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win_arm64.zip)|Unpackaged Windows (Win10+) arm64 executable (no auto-update) [yt-dlp_macos.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos.zip)|Unpackaged MacOS (10.15+) executable (no auto-update) [yt-dlp_macos_legacy](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos_legacy)|MacOS (10.9+) standalone x64 executable From 1001d419f460d8de08103a918f035b67e64d95b0 Mon Sep 17 00:00:00 2001 From: bashonly Date: Wed, 13 Aug 2025 12:49:16 -0500 Subject: [PATCH 7/8] cache by python version! Authored by: bashonly --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90d4d2c965..ab718210fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -429,7 +429,7 @@ jobs: with: path: | /yt-dlp-build-venv - key: cache-reqs-${{ github.job }}_${{ matrix.arch }}-${{ github.ref }} + key: cache-reqs-${{ github.job }}_${{ matrix.arch }}-${{ matrix.python_version }}-${{ github.ref }} - name: Install Requirements run: | @@ -492,7 +492,7 @@ jobs: matrix.arch == 'arm64' && steps.restore-cache.outputs.cache-hit == 'true' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - cache_key: cache-reqs-${{ github.job }}_${{ matrix.arch }}-${{ github.ref }} + cache_key: cache-reqs-${{ github.job }}_${{ matrix.arch }}-${{ matrix.python_version }}-${{ github.ref }} run: | gh cache delete "${cache_key}" @@ -502,7 +502,7 @@ jobs: with: path: | /yt-dlp-build-venv - key: cache-reqs-${{ github.job }}_${{ matrix.arch }}-${{ github.ref }} + key: cache-reqs-${{ github.job }}_${{ matrix.arch }}-${{ matrix.python_version }}-${{ github.ref }} meta_files: if: always() && !cancelled() From a0722c34331497c5923e34e10596cbf523b73b9a Mon Sep 17 00:00:00 2001 From: bashonly <88596187+bashonly@users.noreply.github.com> Date: Sat, 16 Aug 2025 22:49:58 +0000 Subject: [PATCH 8/8] better artifact name --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9268f3e937..f1f65dea91 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -422,7 +422,7 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: build-bin-${{ github.job }}-win${{ matrix.suffix }} + name: build-bin-${{ github.job }}-${{ matrix.arch }} path: | dist/yt-dlp${{ matrix.suffix }}.exe dist/yt-dlp_win${{ matrix.suffix }}.zip