A feature-rich command-line audio/video downloader
[build] Add Windows ARM64 builds (#14003)
bashonly07247d6c20fe
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex ec5d4020ab..f1f65dea91 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -24,9 +24,6 @@ on:windows:default: truetype: boolean- windows32:- default: true- type: booleanorigin:required: falsedefault: ''@@ -65,11 +62,7 @@ on:default: truetype: booleanwindows:- 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.zipdefault: truetype: booleanorigin:@@ -340,18 +333,53 @@ jobs:windows:needs: processif: inputs.windows- runs-on: windows-latest+ permissions:+ contents: read+ actions: write # For cleaning up cache+ runs-on: ${{ matrix.runner }}+ strategy:+ fail-fast: false+ matrix:+ include:+ - 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.13' # arm64 only has Python >= 3.11 availablesteps:- uses: actions/checkout@v4- uses: actions/setup-python@v5with:- python-version: "3.10"+ 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 }}-${{ matrix.python_version }}-${{ 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.ps1python 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/x64/pyinstaller-6.15.0-py3-none-any.whl"+ 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: Preparerun: |@@ -359,14 +387,18 @@ jobs:python devscripts/make_lazy_extractors.py- name: Buildrun: |+ /yt-dlp-build-venv/Scripts/Activate.ps1python -m bundle.pyinstallerpython -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/[email protected]@@ -376,60 +408,42 @@ 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 --print-traffic --impersonate chrome "https://tls.browserleaks.com/json" -o ./resp.json+ & cat ./resp.json+ & "./dist/${name}.exe" --version+ }+- name: Upload artifactsuses: actions/upload-artifact@v4with:- name: build-bin-${{ github.job }}+ name: build-bin-${{ github.job }}-${{ matrix.arch }}path: |- dist/yt-dlp.exe- dist/yt-dlp_win.zip+ dist/yt-dlp${{ matrix.suffix }}.exe+ dist/yt-dlp_win${{ matrix.suffix }}.zipcompression-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/x86/pyinstaller-6.15.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+ - 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 }}-${{ matrix.python_version }}-${{ github.ref }}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/[email protected]- $downgraded_version = & "./dist/${name}_downgraded.exe" --version- if ($version -eq $downgraded_version) {- exit 1- }- }+ gh cache delete "${cache_key}"- - name: Upload artifacts- uses: actions/upload-artifact@v4+ - name: Cache requirements+ if: matrix.arch == 'arm64'+ uses: actions/cache/save@v4with:- name: build-bin-${{ github.job }}path: |- dist/yt-dlp_x86.exe- compression-level: 0+ /yt-dlp-build-venv+ key: cache-reqs-${{ github.job }}_${{ matrix.arch }}-${{ matrix.python_version }}-${{ github.ref }}meta_files:if: always() && !cancelled()@@ -440,7 +454,6 @@ jobs:- linux_arm- macos- windows- - windows32runs-on: ubuntu-lateststeps:- name: Download artifactsdiff --git a/README.md b/README.mdindex 56a53a08b4..411c8725d5 100644--- a/README.md+++ b/README.md@@ -106,10 +106,13 @@ File|DescriptionFile|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 (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 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 (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)#### Miscdiff --git a/yt_dlp/update.py b/yt_dlp/update.pyindex dd948cd521..a17a806432 100644--- a/yt_dlp/update.py+++ b/yt_dlp/update.py@@ -114,6 +114,7 @@ _FILE_SUFFIXES = {'zip': '','win_exe': '.exe','win_x86_exe': '_x86.exe',+ 'win_arm64_exe': '_arm64.exe','darwin_exe': '_macos','linux_exe': '_linux','linux_aarch64_exe': '_linux_aarch64',