From 376c1a279f8f0742bcbe1bbfdd10954cb1602205 Mon Sep 17 00:00:00 2001 From: bashonly Date: Mon, 11 Aug 2025 13:55:53 -0500 Subject: [PATCH 01/10] Discontinue `darwin_legacy_exe` support (#13860) Authored by: bashonly --- .github/workflows/build.yml | 64 +++---------------------------------- README.md | 1 - yt_dlp/update.py | 43 +++++++++++-------------- 3 files changed, 23 insertions(+), 85 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 810490f735..c505fbf594 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,9 +21,6 @@ on: macos: default: true type: boolean - macos_legacy: - default: true - type: boolean windows: default: true type: boolean @@ -67,10 +64,6 @@ on: description: yt-dlp_macos, yt-dlp_macos.zip default: true type: boolean - macos_legacy: - description: yt-dlp_macos_legacy - default: true - type: boolean windows: description: yt-dlp.exe, yt-dlp_win.zip default: true @@ -344,58 +337,6 @@ jobs: ~/yt-dlp-build-venv key: cache-reqs-${{ github.job }}-${{ github.ref }} - macos_legacy: - needs: process - if: inputs.macos_legacy - runs-on: macos-13 - - steps: - - uses: actions/checkout@v4 - - name: Install Python - # We need the official Python, because the GA ones only support newer macOS versions - env: - PYTHON_VERSION: 3.10.5 - MACOSX_DEPLOYMENT_TARGET: 10.9 # Used up by the Python build tools - run: | - # Hack to get the latest patch version. Uncomment if needed - #brew install python@3.10 - #export PYTHON_VERSION=$( $(brew --prefix)/opt/python@3.10/bin/python3 --version | cut -d ' ' -f 2 ) - curl "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macos11.pkg" -o "python.pkg" - sudo installer -pkg python.pkg -target / - python3 --version - - name: Install Requirements - run: | - brew install coreutils - python3 devscripts/install_deps.py --user -o --include build - python3 devscripts/install_deps.py --user --include pyinstaller - - - name: Prepare - run: | - python3 devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}" - python3 devscripts/make_lazy_extractors.py - - name: Build - run: | - python3 -m bundle.pyinstaller - mv dist/yt-dlp_macos dist/yt-dlp_macos_legacy - - - name: Verify --update-to - if: vars.UPDATE_TO_VERIFICATION - run: | - chmod +x ./dist/yt-dlp_macos_legacy - cp ./dist/yt-dlp_macos_legacy ./dist/yt-dlp_macos_legacy_downgraded - version="$(./dist/yt-dlp_macos_legacy --version)" - ./dist/yt-dlp_macos_legacy_downgraded -v --update-to yt-dlp/yt-dlp@2023.03.04 - downgraded_version="$(./dist/yt-dlp_macos_legacy_downgraded --version)" - [[ "$version" != "$downgraded_version" ]] - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: build-bin-${{ github.job }} - path: | - dist/yt-dlp_macos_legacy - compression-level: 0 - windows: needs: process if: inputs.windows @@ -498,7 +439,6 @@ jobs: - linux_static - linux_arm - macos - - macos_legacy - windows - windows32 runs-on: ubuntu-latest @@ -532,6 +472,7 @@ jobs: lock 2024.10.22 linux_(?:armv7l|aarch64)_exe .+-glibc2\.(?:[12]?\d|30)\b lock 2024.10.22 (?!\w+_exe).+ Python 3\.8 lock 2024.10.22 win(?:_x86)?_exe Python 3\.[78].+ Windows-(?:7-|2008ServerR2) + lock 2025.09.01 darwin_legacy_exe .+ lockV2 yt-dlp/yt-dlp 2022.08.18.36 .+ Python 3\.6 lockV2 yt-dlp/yt-dlp 2023.11.16 (?!win_x86_exe).+ Python 3\.7 lockV2 yt-dlp/yt-dlp 2023.11.16 win_x86_exe .+ Windows-(?:Vista|2008Server) @@ -539,18 +480,21 @@ jobs: lockV2 yt-dlp/yt-dlp 2024.10.22 linux_(?:armv7l|aarch64)_exe .+-glibc2\.(?:[12]?\d|30)\b lockV2 yt-dlp/yt-dlp 2024.10.22 (?!\w+_exe).+ Python 3\.8 lockV2 yt-dlp/yt-dlp 2024.10.22 win(?:_x86)?_exe Python 3\.[78].+ Windows-(?:7-|2008ServerR2) + lockV2 yt-dlp/yt-dlp 2025.09.01 darwin_legacy_exe .+ lockV2 yt-dlp/yt-dlp-nightly-builds 2023.11.15.232826 (?!win_x86_exe).+ Python 3\.7 lockV2 yt-dlp/yt-dlp-nightly-builds 2023.11.15.232826 win_x86_exe .+ Windows-(?:Vista|2008Server) lockV2 yt-dlp/yt-dlp-nightly-builds 2024.10.22.051025 py2exe .+ lockV2 yt-dlp/yt-dlp-nightly-builds 2024.10.22.051025 linux_(?:armv7l|aarch64)_exe .+-glibc2\.(?:[12]?\d|30)\b lockV2 yt-dlp/yt-dlp-nightly-builds 2024.10.22.051025 (?!\w+_exe).+ Python 3\.8 lockV2 yt-dlp/yt-dlp-nightly-builds 2024.10.22.051025 win(?:_x86)?_exe Python 3\.[78].+ Windows-(?:7-|2008ServerR2) + lockV2 yt-dlp/yt-dlp-nightly-builds 2025.09.01.234000 darwin_legacy_exe .+ lockV2 yt-dlp/yt-dlp-master-builds 2023.11.15.232812 (?!win_x86_exe).+ Python 3\.7 lockV2 yt-dlp/yt-dlp-master-builds 2023.11.15.232812 win_x86_exe .+ Windows-(?:Vista|2008Server) lockV2 yt-dlp/yt-dlp-master-builds 2024.10.22.045052 py2exe .+ lockV2 yt-dlp/yt-dlp-master-builds 2024.10.22.060347 linux_(?:armv7l|aarch64)_exe .+-glibc2\.(?:[12]?\d|30)\b lockV2 yt-dlp/yt-dlp-master-builds 2024.10.22.060347 (?!\w+_exe).+ Python 3\.8 lockV2 yt-dlp/yt-dlp-master-builds 2024.10.22.060347 win(?:_x86)?_exe Python 3\.[78].+ Windows-(?:7-|2008ServerR2) + lockV2 yt-dlp/yt-dlp-master-builds 2025.09.01.000000 darwin_legacy_exe .+ EOF - name: Sign checksum files diff --git a/README.md b/README.md index 9b28147f2c..aa8b1d4f24 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,6 @@ #### Alternatives [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_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 #### Misc diff --git a/yt_dlp/update.py b/yt_dlp/update.py index ca69fbbada..ee3df8790e 100644 --- a/yt_dlp/update.py +++ b/yt_dlp/update.py @@ -58,26 +58,28 @@ def _get_variant_and_executable_path(): """@returns (variant, executable_path)""" if getattr(sys, 'frozen', False): path = sys.executable + # py2exe is unsupported but we should still correctly identify it for debugging purposes if not hasattr(sys, '_MEIPASS'): return 'py2exe', path - elif sys._MEIPASS == os.path.dirname(path): + if sys._MEIPASS == os.path.dirname(path): return f'{sys.platform}_dir', path - elif sys.platform == 'darwin': - machine = '_legacy' if version_tuple(platform.mac_ver()[0]) < (10, 15) else '' - else: - machine = f'_{platform.machine().lower()}' - is_64bits = sys.maxsize > 2**32 - # Ref: https://en.wikipedia.org/wiki/Uname#Examples - if machine[1:] in ('x86', 'x86_64', 'amd64', 'i386', 'i686'): - machine = '_x86' if not is_64bits else '' - # platform.machine() on 32-bit raspbian OS may return 'aarch64', so check "64-bitness" - # See: https://github.com/yt-dlp/yt-dlp/issues/11813 - elif machine[1:] == 'aarch64' and not is_64bits: - machine = '_armv7l' - # sys.executable returns a /tmp/ path for staticx builds (linux_static) - # Ref: https://staticx.readthedocs.io/en/latest/usage.html#run-time-information - if static_exe_path := os.getenv('STATICX_PROG_PATH'): - path = static_exe_path + if sys.platform == 'darwin': + return 'darwin_exe', path + + machine = f'_{platform.machine().lower()}' + is_64bits = sys.maxsize > 2**32 + # Ref: https://en.wikipedia.org/wiki/Uname#Examples + if machine[1:] in ('x86', 'x86_64', 'amd64', 'i386', 'i686'): + machine = '_x86' if not is_64bits else '' + # platform.machine() on 32-bit raspbian OS may return 'aarch64', so check "64-bitness" + # See: https://github.com/yt-dlp/yt-dlp/issues/11813 + elif machine[1:] == 'aarch64' and not is_64bits: + machine = '_armv7l' + # sys.executable returns a /tmp/ path for staticx builds (linux_static) + # Ref: https://staticx.readthedocs.io/en/latest/usage.html#run-time-information + if static_exe_path := os.getenv('STATICX_PROG_PATH'): + path = static_exe_path + return f'{remove_end(sys.platform, "32")}{machine}_exe', path path = os.path.dirname(__file__) @@ -111,7 +113,6 @@ def current_git_head(): 'win_exe': '.exe', 'win_x86_exe': '_x86.exe', 'darwin_exe': '_macos', - 'darwin_legacy_exe': '_macos_legacy', 'linux_exe': '_linux', 'linux_aarch64_exe': '_linux_aarch64', 'linux_armv7l_exe': '_linux_armv7l', @@ -147,12 +148,6 @@ def _get_system_deprecation(): STOP_MSG = 'You may stop receiving updates on this version at any time!' variant = detect_variant() - # Temporary until macos_legacy executable builds are discontinued - if variant == 'darwin_legacy_exe': - return EXE_MSG_TMPL.format( - f'{variant} (the PyInstaller-bundled executable for macOS versions older than 10.15)', - 'issues/13856', STOP_MSG) - # Temporary until linux_armv7l executable builds are discontinued if variant == 'linux_armv7l_exe': return EXE_MSG_TMPL.format( From 5503e2eecb73cdd092782e5450833b2760fc6a36 Mon Sep 17 00:00:00 2001 From: bashonly Date: Sat, 9 Aug 2025 20:08:34 -0500 Subject: [PATCH 02/10] [build] Discontinue `yt-dlp_linux_armv7l`, use manylinux build strategy Authored by: bashonly --- .github/workflows/build.yml | 116 ++++++++--------------------- bundle/docker/compose.yml | 23 +++++- bundle/docker/linux/Dockerfile | 7 ++ bundle/docker/linux/entrypoint.sh | 11 +++ bundle/docker/static/Dockerfile | 21 ------ bundle/docker/static/entrypoint.sh | 14 ---- 6 files changed, 68 insertions(+), 124 deletions(-) create mode 100644 bundle/docker/linux/Dockerfile create mode 100755 bundle/docker/linux/entrypoint.sh delete mode 100644 bundle/docker/static/Dockerfile delete mode 100755 bundle/docker/static/entrypoint.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c505fbf594..efdcd44d98 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,10 +12,7 @@ on: unix: default: true type: boolean - linux_static: - default: true - type: boolean - linux_arm: + linux: default: true type: boolean macos: @@ -52,12 +49,8 @@ on: description: yt-dlp, yt-dlp.tar.gz default: true type: boolean - linux_static: - description: yt-dlp_linux - default: true - type: boolean - linux_arm: - description: yt-dlp_linux_aarch64, yt-dlp_linux_armv7l + linux: + description: yt-dlp_linux, yt-dlp_linux_aarch64 default: true type: boolean macos: @@ -134,13 +127,23 @@ jobs: yt-dlp.tar.gz compression-level: 0 - linux_static: + linux: needs: process - if: inputs.linux_static - runs-on: ubuntu-latest + if: inputs.linux + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - exe: yt-dlp_linux + platform: x86_64 + runner: ubuntu-24.04 + - exe: yt-dlp_linux_aarch64 + platform: aarch64 + runner: ubuntu-24.04-arm steps: - uses: actions/checkout@v4 - - name: Build static executable + - name: Build executable env: channel: ${{ inputs.channel }} origin: ${{ needs.process.outputs.origin }} @@ -148,85 +151,25 @@ jobs: run: | mkdir ~/build cd bundle/docker - docker compose up --build static - sudo chown "${USER}:docker" ~/build/yt-dlp_linux + docker compose up --build linux_${{ matrix.platform }} + sudo chown "${USER}:docker" ~/build/${{ matrix.exe }} + chmod +x ~/build/${{ matrix.exe }} + # docker compose can fail with exit code 0, so we need to check the exe here + ~/build/${{ matrix.exe }} --version - name: Verify --update-to if: vars.UPDATE_TO_VERIFICATION run: | - chmod +x ~/build/yt-dlp_linux - cp ~/build/yt-dlp_linux ~/build/yt-dlp_linux_downgraded - version="$(~/build/yt-dlp_linux --version)" - ~/build/yt-dlp_linux_downgraded -v --update-to yt-dlp/yt-dlp@2023.03.04 - downgraded_version="$(~/build/yt-dlp_linux_downgraded --version)" + cp ~/build/${{ matrix.exe }} ~/build/${{ matrix.exe }}_downgraded + version="$(~/build/${{ matrix.exe }} --version)" + ~/build/${{ matrix.exe }}_downgraded -v --update-to yt-dlp/yt-dlp@2023.03.04 + downgraded_version="$(~/build/${{ matrix.exe }}_downgraded --version)" [[ "$version" != "$downgraded_version" ]] - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: build-bin-${{ github.job }} + name: build-bin-${{ github.job }}_${{ matrix.platform }} path: | - ~/build/yt-dlp_linux - compression-level: 0 - - linux_arm: - needs: process - if: inputs.linux_arm - permissions: - contents: read - packages: write # for creating cache - runs-on: ubuntu-latest - strategy: - matrix: - architecture: - - armv7 - - aarch64 - - steps: - - uses: actions/checkout@v4 - with: - path: ./repo - - name: Virtualized Install, Prepare & Build - uses: yt-dlp/run-on-arch-action@v3 - with: - # Ref: https://github.com/uraimo/run-on-arch-action/issues/55 - env: | - GITHUB_WORKFLOW: build - githubToken: ${{ github.token }} # To cache image - arch: ${{ matrix.architecture }} - distro: ubuntu20.04 # Standalone executable should be built on minimum supported OS - dockerRunArgs: --volume "${PWD}/repo:/repo" - install: | # Installing Python 3.10 from the Deadsnakes repo raises errors - apt update - apt -y install zlib1g-dev libffi-dev python3.9 python3.9-dev python3.9-distutils python3-pip \ - python3-secretstorage # Cannot build cryptography wheel in virtual armv7 environment - python3.9 -m pip install -U pip wheel 'setuptools>=71.0.2' - # XXX: Keep this in sync with pyproject.toml (it can't be accessed at this stage) and exclude secretstorage - python3.9 -m pip install -U Pyinstaller mutagen pycryptodomex brotli certifi cffi \ - 'requests>=2.32.2,<3' 'urllib3>=2.0.2,<3' 'websockets>=13.0' - - run: | - cd repo - python3.9 devscripts/install_deps.py -o --include build - python3.9 devscripts/install_deps.py --include pyinstaller # Cached versions may be out of date - python3.9 devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}" - python3.9 devscripts/make_lazy_extractors.py - python3.9 -m bundle.pyinstaller - - if ${{ vars.UPDATE_TO_VERIFICATION && 'true' || 'false' }}; then - arch="${{ (matrix.architecture == 'armv7' && 'armv7l') || matrix.architecture }}" - chmod +x ./dist/yt-dlp_linux_${arch} - cp ./dist/yt-dlp_linux_${arch} ./dist/yt-dlp_linux_${arch}_downgraded - version="$(./dist/yt-dlp_linux_${arch} --version)" - ./dist/yt-dlp_linux_${arch}_downgraded -v --update-to yt-dlp/yt-dlp@2023.03.04 - downgraded_version="$(./dist/yt-dlp_linux_${arch}_downgraded --version)" - [[ "$version" != "$downgraded_version" ]] - fi - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: build-bin-linux_${{ matrix.architecture }} - path: | # run-on-arch-action designates armv7l as armv7 - repo/dist/yt-dlp_linux_${{ (matrix.architecture == 'armv7' && 'armv7l') || matrix.architecture }} + ~/build/${{ matrix.exe }} compression-level: 0 macos: @@ -436,8 +379,7 @@ jobs: needs: - process - unix - - linux_static - - linux_arm + - linux - macos - windows - windows32 diff --git a/bundle/docker/compose.yml b/bundle/docker/compose.yml index 5f89ca6d09..7677f00bea 100644 --- a/bundle/docker/compose.yml +++ b/bundle/docker/compose.yml @@ -1,6 +1,25 @@ services: - static: - build: static + linux_x86_64: + build: + context: linux + platforms: + - "linux/amd64" + args: + BASEIMAGE: ghcr.io/bashonly/manylinux2014_x86_64_builds:latest + environment: + channel: ${channel} + origin: ${origin} + version: ${version} + volumes: + - ~/build:/build + - ../..:/yt-dlp + linux_aarch64: + build: + context: linux + platforms: + - "linux/arm64" + args: + BASEIMAGE: ghcr.io/bashonly/manylinux2014_aarch64_builds:latest environment: channel: ${channel} origin: ${origin} diff --git a/bundle/docker/linux/Dockerfile b/bundle/docker/linux/Dockerfile new file mode 100644 index 0000000000..d989390b05 --- /dev/null +++ b/bundle/docker/linux/Dockerfile @@ -0,0 +1,7 @@ +ARG BASEIMAGE=ghcr.io/bashonly/manylinux2014_x86_64_builds:latest + +FROM $BASEIMAGE AS base + +WORKDIR /yt-dlp +COPY entrypoint.sh /entrypoint.sh +ENTRYPOINT /entrypoint.sh diff --git a/bundle/docker/linux/entrypoint.sh b/bundle/docker/linux/entrypoint.sh new file mode 100755 index 0000000000..d82f326ff5 --- /dev/null +++ b/bundle/docker/linux/entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +python3.13 -m venv ~/yt-dlp-build-venv +source ~/yt-dlp-build-venv/bin/activate +python3.13 -m devscripts.install_deps -o --include build +python3.13 -m devscripts.install_deps --include secretstorage --include curl-cffi --include pyinstaller +python3.13 -m devscripts.make_lazy_extractors +python3.13 devscripts/update-version.py -c "${channel}" -r "${origin}" "${version}" +python3.13 -m bundle.pyinstaller +mv dist/* /build/ diff --git a/bundle/docker/static/Dockerfile b/bundle/docker/static/Dockerfile deleted file mode 100644 index dae2dff3d8..0000000000 --- a/bundle/docker/static/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM alpine:3.19 as base - -RUN apk --update add --no-cache \ - build-base \ - python3 \ - pipx \ - ; - -RUN pipx install pyinstaller -# Requires above step to prepare the shared venv -RUN ~/.local/share/pipx/shared/bin/python -m pip install -U wheel -RUN apk --update add --no-cache \ - scons \ - patchelf \ - binutils \ - ; -RUN pipx install staticx - -WORKDIR /yt-dlp -COPY entrypoint.sh /entrypoint.sh -ENTRYPOINT /entrypoint.sh diff --git a/bundle/docker/static/entrypoint.sh b/bundle/docker/static/entrypoint.sh deleted file mode 100755 index 8049e68205..0000000000 --- a/bundle/docker/static/entrypoint.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/ash -set -e - -source ~/.local/share/pipx/venvs/pyinstaller/bin/activate -python -m devscripts.install_deps -o --include build -python -m devscripts.install_deps --include secretstorage --include curl-cffi -python -m devscripts.make_lazy_extractors -python devscripts/update-version.py -c "${channel}" -r "${origin}" "${version}" -python -m bundle.pyinstaller -deactivate - -source ~/.local/share/pipx/venvs/staticx/bin/activate -staticx /yt-dlp/dist/yt-dlp_linux /build/yt-dlp_linux -deactivate From 08f2f1d641704c7095d47aee477ea173d82b9816 Mon Sep 17 00:00:00 2001 From: bashonly Date: Mon, 11 Aug 2025 14:19:56 -0500 Subject: [PATCH 03/10] [build] entrypoint script fixes Authored by: bashonly --- .github/workflows/build.yml | 1 - bundle/docker/linux/entrypoint.sh | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efdcd44d98..e13bc0a50b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -154,7 +154,6 @@ jobs: docker compose up --build linux_${{ matrix.platform }} sudo chown "${USER}:docker" ~/build/${{ matrix.exe }} chmod +x ~/build/${{ matrix.exe }} - # docker compose can fail with exit code 0, so we need to check the exe here ~/build/${{ matrix.exe }} --version - name: Verify --update-to if: vars.UPDATE_TO_VERIFICATION diff --git a/bundle/docker/linux/entrypoint.sh b/bundle/docker/linux/entrypoint.sh index d82f326ff5..d18c49c364 100755 --- a/bundle/docker/linux/entrypoint.sh +++ b/bundle/docker/linux/entrypoint.sh @@ -1,11 +1,11 @@ #!/bin/bash -set -e +set -exuo pipefail -python3.13 -m venv ~/yt-dlp-build-venv +python3 -m venv ~/yt-dlp-build-venv source ~/yt-dlp-build-venv/bin/activate -python3.13 -m devscripts.install_deps -o --include build -python3.13 -m devscripts.install_deps --include secretstorage --include curl-cffi --include pyinstaller -python3.13 -m devscripts.make_lazy_extractors -python3.13 devscripts/update-version.py -c "${channel}" -r "${origin}" "${version}" -python3.13 -m bundle.pyinstaller +python3 -m devscripts.install_deps -o --include build +python3 -m devscripts.install_deps --include secretstorage --include curl-cffi --include pyinstaller +python3 -m devscripts.make_lazy_extractors +python3 devscripts/update-version.py -c "${channel}" -r "${origin}" "${version}" +python3 -m bundle.pyinstaller mv dist/* /build/ From 60fc70676f56d8ba99867cdd11f67bf868318f3f Mon Sep 17 00:00:00 2001 From: bashonly Date: Mon, 11 Aug 2025 14:48:07 -0500 Subject: [PATCH 04/10] [build] Add `linux_dir` builds Authored by: bashonly --- .github/workflows/build.yml | 11 +++++++---- bundle/docker/compose.yml | 14 ++++++++------ bundle/docker/linux/entrypoint.sh | 8 ++++++-- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e13bc0a50b..1b9d901c34 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,7 @@ on: default: true type: boolean linux: - description: yt-dlp_linux, yt-dlp_linux_aarch64 + description: yt-dlp_linux, yt-dlp_linux.zip, yt-dlp_linux_aarch64, yt-dlp_linux_aarch64.zip default: true type: boolean macos: @@ -145,14 +145,16 @@ jobs: - uses: actions/checkout@v4 - name: Build executable env: - channel: ${{ inputs.channel }} - origin: ${{ needs.process.outputs.origin }} - version: ${{ inputs.version }} + EXE_NAME: ${{ matrix.exe }} + CHANNEL: ${{ inputs.channel }} + ORIGIN: ${{ needs.process.outputs.origin }} + VERSION: ${{ inputs.version }} run: | mkdir ~/build cd bundle/docker docker compose up --build linux_${{ matrix.platform }} sudo chown "${USER}:docker" ~/build/${{ matrix.exe }} + sudo chown "${USER}:docker" ~/build/${{ matrix.exe }}.zip chmod +x ~/build/${{ matrix.exe }} ~/build/${{ matrix.exe }} --version - name: Verify --update-to @@ -169,6 +171,7 @@ jobs: name: build-bin-${{ github.job }}_${{ matrix.platform }} path: | ~/build/${{ matrix.exe }} + ~/build/${{ matrix.exe }}.zip compression-level: 0 macos: diff --git a/bundle/docker/compose.yml b/bundle/docker/compose.yml index 7677f00bea..30a28d6664 100644 --- a/bundle/docker/compose.yml +++ b/bundle/docker/compose.yml @@ -7,9 +7,10 @@ services: args: BASEIMAGE: ghcr.io/bashonly/manylinux2014_x86_64_builds:latest environment: - channel: ${channel} - origin: ${origin} - version: ${version} + EXE_NAME: ${EXE_NAME} + CHANNEL: ${CHANNEL} + ORIGIN: ${ORIGIN} + VERSION: ${VERSION} volumes: - ~/build:/build - ../..:/yt-dlp @@ -21,9 +22,10 @@ services: args: BASEIMAGE: ghcr.io/bashonly/manylinux2014_aarch64_builds:latest environment: - channel: ${channel} - origin: ${origin} - version: ${version} + EXE_NAME: ${EXE_NAME} + CHANNEL: ${CHANNEL} + ORIGIN: ${ORIGIN} + VERSION: ${VERSION} volumes: - ~/build:/build - ../..:/yt-dlp diff --git a/bundle/docker/linux/entrypoint.sh b/bundle/docker/linux/entrypoint.sh index d18c49c364..dba214801b 100755 --- a/bundle/docker/linux/entrypoint.sh +++ b/bundle/docker/linux/entrypoint.sh @@ -6,6 +6,10 @@ source ~/yt-dlp-build-venv/bin/activate python3 -m devscripts.install_deps -o --include build python3 -m devscripts.install_deps --include secretstorage --include curl-cffi --include pyinstaller python3 -m devscripts.make_lazy_extractors -python3 devscripts/update-version.py -c "${channel}" -r "${origin}" "${version}" +python3 devscripts/update-version.py -c "${CHANNEL}" -r "${ORIGIN}" "${VERSION}" +python3 -m bundle.pyinstaller --onedir +pushd "./dist/${EXE_NAME}" +zip -r "/build/${EXE_NAME}.zip" . +popd python3 -m bundle.pyinstaller -mv dist/* /build/ +mv "./dist/${EXE_NAME}" /build/ From f0cb0550a9730ae358fcbe48e804f59e1c2a54b7 Mon Sep 17 00:00:00 2001 From: bashonly Date: Mon, 11 Aug 2025 14:50:59 -0500 Subject: [PATCH 05/10] [update] remove `linux_armv7l_exe` from `_FILE_SUFFIXES` Authored by: bashonly --- yt_dlp/update.py | 1 - 1 file changed, 1 deletion(-) diff --git a/yt_dlp/update.py b/yt_dlp/update.py index ee3df8790e..c53be00cff 100644 --- a/yt_dlp/update.py +++ b/yt_dlp/update.py @@ -115,7 +115,6 @@ def current_git_head(): 'darwin_exe': '_macos', 'linux_exe': '_linux', 'linux_aarch64_exe': '_linux_aarch64', - 'linux_armv7l_exe': '_linux_armv7l', } _NON_UPDATEABLE_REASONS = { From 87722b6cc806fa1ea52026e058f7508ea3d8a315 Mon Sep 17 00:00:00 2001 From: bashonly Date: Mon, 11 Aug 2025 14:55:40 -0500 Subject: [PATCH 06/10] [update] remove temporary deprecation code Authored by: bashonly --- yt_dlp/update.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/yt_dlp/update.py b/yt_dlp/update.py index c53be00cff..cc6e70012e 100644 --- a/yt_dlp/update.py +++ b/yt_dlp/update.py @@ -142,21 +142,6 @@ def _get_binary_name(): def _get_system_deprecation(): MIN_SUPPORTED, MIN_RECOMMENDED = (3, 9), (3, 10) - EXE_MSG_TMPL = ('Support for {} has been deprecated. ' - 'See https://github.com/yt-dlp/yt-dlp/{} for details.\n{}') - STOP_MSG = 'You may stop receiving updates on this version at any time!' - variant = detect_variant() - - # Temporary until linux_armv7l executable builds are discontinued - if variant == 'linux_armv7l_exe': - return EXE_MSG_TMPL.format( - f'{variant} (the PyInstaller-bundled executable for the Linux armv7l platform)', - 'issues/13976', STOP_MSG) - - # Temporary until linux_aarch64_exe is built with Python >=3.10 instead of Python 3.9 - if variant == 'linux_aarch64_exe': - return None - if sys.version_info > MIN_RECOMMENDED: return None From aa0d28531aa77b9d1e8e2b616401a4e216cfc85f Mon Sep 17 00:00:00 2001 From: bashonly Date: Mon, 11 Aug 2025 15:12:59 -0500 Subject: [PATCH 07/10] [update] fix onedir variant names Authored by: bashonly --- yt_dlp/update.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yt_dlp/update.py b/yt_dlp/update.py index cc6e70012e..5d38baecc6 100644 --- a/yt_dlp/update.py +++ b/yt_dlp/update.py @@ -61,10 +61,10 @@ def _get_variant_and_executable_path(): # py2exe is unsupported but we should still correctly identify it for debugging purposes if not hasattr(sys, '_MEIPASS'): return 'py2exe', path - if sys._MEIPASS == os.path.dirname(path): - return f'{sys.platform}_dir', path + # We know it's a PyInstaller bundle, but is it "onedir" or "onefile"? + suffix = 'dir' if sys._MEIPASS == os.path.dirname(path) else 'exe' if sys.platform == 'darwin': - return 'darwin_exe', path + return f'darwin_{suffix}', path machine = f'_{platform.machine().lower()}' is_64bits = sys.maxsize > 2**32 @@ -80,7 +80,7 @@ def _get_variant_and_executable_path(): if static_exe_path := os.getenv('STATICX_PROG_PATH'): path = static_exe_path - return f'{remove_end(sys.platform, "32")}{machine}_exe', path + return f'{remove_end(sys.platform, "32")}{machine}_{suffix}', path path = os.path.dirname(__file__) if isinstance(__loader__, zipimporter): From 580bb60b8734316b8b16dbf0cc89738b9f9f8dfa Mon Sep 17 00:00:00 2001 From: bashonly Date: Mon, 11 Aug 2025 15:18:29 -0500 Subject: [PATCH 08/10] [update] still identify `darwin_legacy_exe` Authored by: bashonly --- yt_dlp/update.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yt_dlp/update.py b/yt_dlp/update.py index 5d38baecc6..6d66256e3b 100644 --- a/yt_dlp/update.py +++ b/yt_dlp/update.py @@ -64,7 +64,9 @@ def _get_variant_and_executable_path(): # We know it's a PyInstaller bundle, but is it "onedir" or "onefile"? suffix = 'dir' if sys._MEIPASS == os.path.dirname(path) else 'exe' if sys.platform == 'darwin': - return f'darwin_{suffix}', path + # darwin_legacy_exe is no longer supported, but still identify it to block updates + machine = '_legacy' if version_tuple(platform.mac_ver()[0]) < (10, 15) else '' + return f'darwin{machine}_{suffix}', path machine = f'_{platform.machine().lower()}' is_64bits = sys.maxsize > 2**32 From 8d129c869ad8fb707d0eb59a309f8dccc21c3dcc Mon Sep 17 00:00:00 2001 From: bashonly Date: Mon, 11 Aug 2025 15:36:36 -0500 Subject: [PATCH 09/10] [docs] Update "Release Files" in README Authored by: bashonly --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index aa8b1d4f24..624ea19934 100644 --- a/README.md +++ b/README.md @@ -106,10 +106,11 @@ #### Alternatives 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_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_linux](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux)|Linux (glibc 2.17+) standalone x86_64 binary +[yt-dlp_linux.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux.zip)|Unpackaged Linux (glibc 2.17+) x86_64 executable (no auto-update) +[yt-dlp_linux_aarch64](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_aarch64)|Linux (glibc 2.17+) standalone aarch64 binary +[yt-dlp_linux_aarch64.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_aarch64.zip)|Unpackaged Linux (glibc 2.17+) aarch64 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+) 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) #### Misc From 47922adf9e954e0f00708def043da09165923b9b Mon Sep 17 00:00:00 2001 From: bashonly Date: Tue, 12 Aug 2025 02:48:50 -0500 Subject: [PATCH 10/10] use python zipfile instead of `zip` Authored by: bashonly --- bundle/docker/linux/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundle/docker/linux/entrypoint.sh b/bundle/docker/linux/entrypoint.sh index dba214801b..e230c5f8b1 100755 --- a/bundle/docker/linux/entrypoint.sh +++ b/bundle/docker/linux/entrypoint.sh @@ -9,7 +9,7 @@ python3 -m devscripts.make_lazy_extractors python3 devscripts/update-version.py -c "${CHANNEL}" -r "${ORIGIN}" "${VERSION}" python3 -m bundle.pyinstaller --onedir pushd "./dist/${EXE_NAME}" -zip -r "/build/${EXE_NAME}.zip" . +python3 -m zipfile -c "/build/${EXE_NAME}.zip" ./ popd python3 -m bundle.pyinstaller mv "./dist/${EXE_NAME}" /build/