mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-04-29 12:05:55 +00:00
Compare commits
6 Commits
65e90aea29
...
df4b4e8ccf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df4b4e8ccf | ||
|
|
f3829463c7 | ||
|
|
ae3923b6b2 | ||
|
|
8ab262c66b | ||
|
|
e2d37bcc8e | ||
|
|
eb4b3a5fc7 |
225
.github/workflows/build.yml
vendored
225
.github/workflows/build.yml
vendored
@ -84,6 +84,8 @@ jobs:
|
|||||||
origin: ${{ steps.process_inputs.outputs.origin }}
|
origin: ${{ steps.process_inputs.outputs.origin }}
|
||||||
timestamp: ${{ steps.process_inputs.outputs.timestamp }}
|
timestamp: ${{ steps.process_inputs.outputs.timestamp }}
|
||||||
version: ${{ steps.process_inputs.outputs.version }}
|
version: ${{ steps.process_inputs.outputs.version }}
|
||||||
|
linux_matrix: ${{ steps.linux_matrix.outputs.matrix }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Process inputs
|
- name: Process inputs
|
||||||
id: process_inputs
|
id: process_inputs
|
||||||
@ -118,6 +120,69 @@ jobs:
|
|||||||
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
|
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
|
||||||
f.write('\n'.join(f'{key}={value}' for key, value in outputs.items()))
|
f.write('\n'.join(f'{key}={value}' for key, value in outputs.items()))
|
||||||
|
|
||||||
|
- name: Build Linux matrix
|
||||||
|
id: linux_matrix
|
||||||
|
env:
|
||||||
|
INPUTS: ${{ toJSON(inputs) }}
|
||||||
|
PYTHON_VERSION: '3.13'
|
||||||
|
UPDATE_TO: yt-dlp/yt-dlp@2025.09.05
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
EXE_MAP = {
|
||||||
|
'linux': [{
|
||||||
|
'os': 'linux',
|
||||||
|
'arch': 'x86_64',
|
||||||
|
'runner': 'ubuntu-24.04',
|
||||||
|
}, {
|
||||||
|
'os': 'linux',
|
||||||
|
'arch': 'aarch64',
|
||||||
|
'runner': 'ubuntu-24.04-arm',
|
||||||
|
}],
|
||||||
|
'linux_armv7l': [{
|
||||||
|
'os': 'linux',
|
||||||
|
'arch': 'armv7l',
|
||||||
|
'runner': 'ubuntu-24.04-arm',
|
||||||
|
'qemu_platform': 'linux/arm/v7',
|
||||||
|
'onefile': False,
|
||||||
|
'cache_requirements': True,
|
||||||
|
'update_to': 'yt-dlp/yt-dlp@2023.03.04',
|
||||||
|
}],
|
||||||
|
'musllinux': [{
|
||||||
|
'os': 'musllinux',
|
||||||
|
'arch': 'x86_64',
|
||||||
|
'runner': 'ubuntu-24.04',
|
||||||
|
}, {
|
||||||
|
'os': 'musllinux',
|
||||||
|
'arch': 'aarch64',
|
||||||
|
'runner': 'ubuntu-24.04-arm',
|
||||||
|
}],
|
||||||
|
}
|
||||||
|
INPUTS = json.loads(os.environ['INPUTS'])
|
||||||
|
matrix = [exe for key, group in EXE_MAP.items() for exe in group if INPUTS.get(key)]
|
||||||
|
if not matrix:
|
||||||
|
# If we send an empty matrix when no linux inputs are given, the entire workflow fails
|
||||||
|
matrix = [EXE_MAP['linux'][0]]
|
||||||
|
for exe in matrix:
|
||||||
|
exe['exe'] = '_'.join(filter(None, (
|
||||||
|
'yt-dlp',
|
||||||
|
exe['os'],
|
||||||
|
exe['arch'] != 'x86_64' and exe['arch'],
|
||||||
|
)))
|
||||||
|
exe.setdefault('qemu_platform', None)
|
||||||
|
exe.setdefault('onefile', True)
|
||||||
|
exe.setdefault('onedir', True)
|
||||||
|
exe.setdefault('cache_requirements', False)
|
||||||
|
exe.setdefault('python_version', os.environ['PYTHON_VERSION'])
|
||||||
|
exe.setdefault('update_to', os.environ['UPDATE_TO'])
|
||||||
|
if not any(INPUTS.get(key) for key in EXE_MAP):
|
||||||
|
print('skipping linux job')
|
||||||
|
else:
|
||||||
|
print(json.dumps(matrix, indent=2))
|
||||||
|
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
|
||||||
|
f.write(f'matrix={json.dumps(matrix)}')
|
||||||
|
|
||||||
unix:
|
unix:
|
||||||
needs: process
|
needs: process
|
||||||
if: inputs.unix
|
if: inputs.unix
|
||||||
@ -127,24 +192,30 @@ jobs:
|
|||||||
ORIGIN: ${{ needs.process.outputs.origin }}
|
ORIGIN: ${{ needs.process.outputs.origin }}
|
||||||
VERSION: ${{ needs.process.outputs.version }}
|
VERSION: ${{ needs.process.outputs.version }}
|
||||||
UPDATE_TO: yt-dlp/yt-dlp@2025.09.05
|
UPDATE_TO: yt-dlp/yt-dlp@2025.09.05
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Needed for changelog
|
fetch-depth: 0 # Needed for changelog
|
||||||
|
|
||||||
- uses: actions/setup-python@v6
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: "3.10"
|
||||||
|
|
||||||
- name: Install Requirements
|
- name: Install Requirements
|
||||||
run: |
|
run: |
|
||||||
sudo apt -y install zip pandoc man sed
|
sudo apt -y install zip pandoc man sed
|
||||||
|
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
run: |
|
run: |
|
||||||
python devscripts/update-version.py -c "${CHANNEL}" -r "${ORIGIN}" "${VERSION}"
|
python devscripts/update-version.py -c "${CHANNEL}" -r "${ORIGIN}" "${VERSION}"
|
||||||
python devscripts/update_changelog.py -vv
|
python devscripts/update_changelog.py -vv
|
||||||
python devscripts/make_lazy_extractors.py
|
python devscripts/make_lazy_extractors.py
|
||||||
|
|
||||||
- name: Build Unix platform-independent binary
|
- name: Build Unix platform-independent binary
|
||||||
run: |
|
run: |
|
||||||
make all tar
|
make all tar
|
||||||
|
|
||||||
- name: Verify --update-to
|
- name: Verify --update-to
|
||||||
if: vars.UPDATE_TO_VERIFICATION
|
if: vars.UPDATE_TO_VERIFICATION
|
||||||
run: |
|
run: |
|
||||||
@ -154,6 +225,7 @@ jobs:
|
|||||||
./yt-dlp_downgraded -v --update-to "${UPDATE_TO}"
|
./yt-dlp_downgraded -v --update-to "${UPDATE_TO}"
|
||||||
downgraded_version="$(./yt-dlp_downgraded --version)"
|
downgraded_version="$(./yt-dlp_downgraded --version)"
|
||||||
[[ "${version}" != "${downgraded_version}" ]]
|
[[ "${version}" != "${downgraded_version}" ]]
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@ -164,154 +236,71 @@ jobs:
|
|||||||
compression-level: 0
|
compression-level: 0
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
|
name: ${{ matrix.os }} (${{ matrix.arch }})
|
||||||
|
if: inputs.linux || inputs.linux_armv7l || inputs.musllinux
|
||||||
needs: process
|
needs: process
|
||||||
if: inputs.linux
|
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include: ${{ fromJSON(needs.process.outputs.linux_matrix) }}
|
||||||
- exe: yt-dlp_linux
|
|
||||||
platform: x86_64
|
|
||||||
runner: ubuntu-24.04
|
|
||||||
- exe: yt-dlp_linux_aarch64
|
|
||||||
platform: aarch64
|
|
||||||
runner: ubuntu-24.04-arm
|
|
||||||
env:
|
env:
|
||||||
CHANNEL: ${{ inputs.channel }}
|
CHANNEL: ${{ inputs.channel }}
|
||||||
ORIGIN: ${{ needs.process.outputs.origin }}
|
ORIGIN: ${{ needs.process.outputs.origin }}
|
||||||
VERSION: ${{ needs.process.outputs.version }}
|
VERSION: ${{ needs.process.outputs.version }}
|
||||||
EXE_NAME: ${{ matrix.exe }}
|
EXE_NAME: ${{ matrix.exe }}
|
||||||
UPDATE_TO: yt-dlp/yt-dlp@2025.09.05
|
PYTHON_VERSION: ${{ matrix.python_version }}
|
||||||
steps:
|
UPDATE_TO: ${{ (vars.UPDATE_TO_VERIFICATION && matrix.update_to) || '' }}
|
||||||
- uses: actions/checkout@v4
|
SKIP_ONEDIR_BUILD: ${{ (!matrix.onedir && '1') || '' }}
|
||||||
- name: Build executable
|
SKIP_ONEFILE_BUILD: ${{ (!matrix.onefile && '1') || '' }}
|
||||||
env:
|
|
||||||
SERVICE: linux_${{ matrix.platform }}
|
|
||||||
run: |
|
|
||||||
mkdir -p ./dist
|
|
||||||
pushd bundle/docker
|
|
||||||
docker compose up --build --exit-code-from "${SERVICE}" "${SERVICE}"
|
|
||||||
popd
|
|
||||||
sudo chown "${USER}:docker" "./dist/${EXE_NAME}"
|
|
||||||
- name: Verify executable in container
|
|
||||||
if: vars.UPDATE_TO_VERIFICATION
|
|
||||||
env:
|
|
||||||
SERVICE: linux_${{ matrix.platform }}_verify
|
|
||||||
run: |
|
|
||||||
cd bundle/docker
|
|
||||||
docker compose up --build --exit-code-from "${SERVICE}" "${SERVICE}"
|
|
||||||
- name: Verify --update-to
|
|
||||||
if: vars.UPDATE_TO_VERIFICATION
|
|
||||||
run: |
|
|
||||||
chmod +x "./dist/${EXE_NAME}"
|
|
||||||
mkdir -p ~/testing
|
|
||||||
cp "./dist/${EXE_NAME}" ~/testing/"${EXE_NAME}_downgraded"
|
|
||||||
version="$("./dist/${EXE_NAME}" --version)"
|
|
||||||
~/testing/"${EXE_NAME}_downgraded" -v --update-to "${UPDATE_TO}"
|
|
||||||
downgraded_version="$(~/testing/"${EXE_NAME}_downgraded" --version)"
|
|
||||||
[[ "${version}" != "${downgraded_version}" ]]
|
|
||||||
- name: Upload artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: build-bin-${{ github.job }}_${{ matrix.platform }}
|
|
||||||
path: |
|
|
||||||
dist/${{ matrix.exe }}*
|
|
||||||
compression-level: 0
|
|
||||||
|
|
||||||
linux_armv7l:
|
|
||||||
needs: process
|
|
||||||
if: inputs.linux_armv7l
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
runs-on: ubuntu-24.04-arm
|
|
||||||
env:
|
|
||||||
CHANNEL: ${{ inputs.channel }}
|
|
||||||
ORIGIN: ${{ needs.process.outputs.origin }}
|
|
||||||
VERSION: ${{ needs.process.outputs.version }}
|
|
||||||
EXE_NAME: yt-dlp_linux_armv7l
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Cache requirements
|
- name: Cache requirements
|
||||||
|
if: matrix.cache_requirements
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
env:
|
env:
|
||||||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
|
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/yt-dlp-build-venv
|
venv
|
||||||
key: cache-reqs-${{ github.job }}-${{ github.ref }}-${{ needs.process.outputs.timestamp }}
|
key: cache-reqs-${{ matrix.os }}_${{ matrix.arch }}-${{ github.ref }}-${{ needs.process.outputs.timestamp }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
cache-reqs-${{ github.job }}-${{ github.ref }}-
|
cache-reqs-${{ matrix.os }}_${{ matrix.arch }}-${{ github.ref }}-
|
||||||
cache-reqs-${{ github.job }}-
|
cache-reqs-${{ matrix.os }}_${{ matrix.arch }}-
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
|
if: matrix.qemu_platform
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
with:
|
with:
|
||||||
platforms: linux/arm/v7
|
platforms: ${{ matrix.qemu_platform }}
|
||||||
- name: Build executable
|
|
||||||
env:
|
|
||||||
SERVICE: linux_armv7l
|
|
||||||
run: |
|
|
||||||
mkdir -p ./dist
|
|
||||||
mkdir -p ~/yt-dlp-build-venv
|
|
||||||
cd bundle/docker
|
|
||||||
docker compose up --build --exit-code-from "${SERVICE}" "${SERVICE}"
|
|
||||||
- name: Verify executable in container
|
|
||||||
if: vars.UPDATE_TO_VERIFICATION
|
|
||||||
env:
|
|
||||||
SERVICE: linux_armv7l_verify
|
|
||||||
run: |
|
|
||||||
cd bundle/docker
|
|
||||||
docker compose up --build --exit-code-from "${SERVICE}" "${SERVICE}"
|
|
||||||
- name: Upload artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: build-bin-${{ github.job }}
|
|
||||||
path: |
|
|
||||||
dist/yt-dlp_linux_armv7l.zip
|
|
||||||
compression-level: 0
|
|
||||||
|
|
||||||
musllinux:
|
|
||||||
needs: process
|
|
||||||
if: inputs.musllinux
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- exe: yt-dlp_musllinux
|
|
||||||
platform: x86_64
|
|
||||||
runner: ubuntu-24.04
|
|
||||||
- exe: yt-dlp_musllinux_aarch64
|
|
||||||
platform: aarch64
|
|
||||||
runner: ubuntu-24.04-arm
|
|
||||||
env:
|
|
||||||
CHANNEL: ${{ inputs.channel }}
|
|
||||||
ORIGIN: ${{ needs.process.outputs.origin }}
|
|
||||||
VERSION: ${{ needs.process.outputs.version }}
|
|
||||||
EXE_NAME: ${{ matrix.exe }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Build executable
|
- name: Build executable
|
||||||
env:
|
env:
|
||||||
SERVICE: musllinux_${{ matrix.platform }}
|
SERVICE: ${{ matrix.os }}_${{ matrix.arch }}
|
||||||
run: |
|
run: |
|
||||||
|
mkdir -p ./venv
|
||||||
mkdir -p ./dist
|
mkdir -p ./dist
|
||||||
pushd bundle/docker
|
pushd bundle/docker
|
||||||
docker compose up --build --exit-code-from "${SERVICE}" "${SERVICE}"
|
docker compose up --build --exit-code-from "${SERVICE}" "${SERVICE}"
|
||||||
popd
|
popd
|
||||||
sudo chown "${USER}:docker" "./dist/${EXE_NAME}"
|
if [[ -z "${SKIP_ONEFILE_BUILD}" ]]; then
|
||||||
|
sudo chown "${USER}:docker" "./dist/${EXE_NAME}"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Verify executable in container
|
- name: Verify executable in container
|
||||||
if: vars.UPDATE_TO_VERIFICATION
|
|
||||||
env:
|
env:
|
||||||
SERVICE: musllinux_${{ matrix.platform }}_verify
|
SERVICE: ${{ matrix.os }}_${{ matrix.arch }}_verify
|
||||||
run: |
|
run: |
|
||||||
cd bundle/docker
|
cd bundle/docker
|
||||||
docker compose up --build --exit-code-from "${SERVICE}" "${SERVICE}"
|
docker compose up --build --exit-code-from "${SERVICE}" "${SERVICE}"
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: build-bin-${{ github.job }}_${{ matrix.platform }}
|
name: build-bin-${{ matrix.os }}_${{ matrix.arch }}
|
||||||
path: |
|
path: |
|
||||||
dist/${{ matrix.exe }}*
|
dist/${{ matrix.exe }}*
|
||||||
compression-level: 0
|
compression-level: 0
|
||||||
@ -431,23 +420,23 @@ jobs:
|
|||||||
runner: windows-2025
|
runner: windows-2025
|
||||||
python_version: '3.10'
|
python_version: '3.10'
|
||||||
platform_tag: win_amd64
|
platform_tag: win_amd64
|
||||||
pyi_version: '6.15.0'
|
pyi_version: '6.16.0'
|
||||||
pyi_tag: '2025.09.08.215938'
|
pyi_tag: '2025.09.13.221251'
|
||||||
pyi_hash: f70e327d849b29562caf01c30db60e6e8b2facb68124612bb53b04f96ffe6852
|
pyi_hash: b6496c7630c3afe66900cfa824e8234a8c2e2c81704bd7facd79586abc76c0e5
|
||||||
- arch: 'x86'
|
- arch: 'x86'
|
||||||
runner: windows-2025
|
runner: windows-2025
|
||||||
python_version: '3.10'
|
python_version: '3.10'
|
||||||
platform_tag: win32
|
platform_tag: win32
|
||||||
pyi_version: '6.15.0'
|
pyi_version: '6.16.0'
|
||||||
pyi_tag: '2025.09.08.215938'
|
pyi_tag: '2025.09.13.221251'
|
||||||
pyi_hash: b9af6b49a3556d478935de2632cb7dbef41a0c226f7a8ce36efc3ca2aeab3d51
|
pyi_hash: 2d881843580efdc54f3523507fc6d9c5b6051ee49c743a6d9b7003ac5758c226
|
||||||
- arch: 'arm64'
|
- arch: 'arm64'
|
||||||
runner: windows-11-arm
|
runner: windows-11-arm
|
||||||
python_version: '3.13' # arm64 only has Python >= 3.11 available
|
python_version: '3.13' # arm64 only has Python >= 3.11 available
|
||||||
platform_tag: win_arm64
|
platform_tag: win_arm64
|
||||||
pyi_version: '6.15.0'
|
pyi_version: '6.16.0'
|
||||||
pyi_tag: '2025.09.08.215938'
|
pyi_tag: '2025.09.13.221251'
|
||||||
pyi_hash: 5dac9f802085432dd3135708e835ef4c08570c308d07c3ef8154495b76bf2a83
|
pyi_hash: 4250c9085e34a95c898f3ee2f764914fc36ec59f0d97c28e6a75fcf21f7b144f
|
||||||
env:
|
env:
|
||||||
CHANNEL: ${{ inputs.channel }}
|
CHANNEL: ${{ inputs.channel }}
|
||||||
ORIGIN: ${{ needs.process.outputs.origin }}
|
ORIGIN: ${{ needs.process.outputs.origin }}
|
||||||
@ -542,8 +531,6 @@ jobs:
|
|||||||
- process
|
- process
|
||||||
- unix
|
- unix
|
||||||
- linux
|
- linux
|
||||||
- linux_armv7l
|
|
||||||
- musllinux
|
|
||||||
- macos
|
- macos
|
||||||
- windows
|
- windows
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
8
.github/workflows/test-workflows.yml
vendored
8
.github/workflows/test-workflows.yml
vendored
@ -3,12 +3,14 @@ on:
|
|||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- .github/workflows/*
|
- .github/workflows/*
|
||||||
|
- bundle/docker/linux/*.sh
|
||||||
- devscripts/setup_variables.py
|
- devscripts/setup_variables.py
|
||||||
- devscripts/setup_variables_tests.py
|
- devscripts/setup_variables_tests.py
|
||||||
- devscripts/utils.py
|
- devscripts/utils.py
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- .github/workflows/*
|
- .github/workflows/*
|
||||||
|
- bundle/docker/linux/*.sh
|
||||||
- devscripts/setup_variables.py
|
- devscripts/setup_variables.py
|
||||||
- devscripts/setup_variables_tests.py
|
- devscripts/setup_variables_tests.py
|
||||||
- devscripts/utils.py
|
- devscripts/utils.py
|
||||||
@ -32,6 +34,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
ACTIONLINT_TARBALL: ${{ format('actionlint_{0}_linux_amd64.tar.gz', env.ACTIONLINT_VERSION) }}
|
ACTIONLINT_TARBALL: ${{ format('actionlint_{0}_linux_amd64.tar.gz', env.ACTIONLINT_VERSION) }}
|
||||||
run: |
|
run: |
|
||||||
|
python -m devscripts.install_deps -o --include test
|
||||||
sudo apt -y install shellcheck
|
sudo apt -y install shellcheck
|
||||||
python -m pip install -U pyflakes
|
python -m pip install -U pyflakes
|
||||||
curl -LO "${ACTIONLINT_REPO}/releases/download/v${ACTIONLINT_VERSION}/${ACTIONLINT_TARBALL}"
|
curl -LO "${ACTIONLINT_REPO}/releases/download/v${ACTIONLINT_VERSION}/${ACTIONLINT_TARBALL}"
|
||||||
@ -41,6 +44,9 @@ jobs:
|
|||||||
- name: Run actionlint
|
- name: Run actionlint
|
||||||
run: |
|
run: |
|
||||||
./actionlint -color
|
./actionlint -color
|
||||||
|
- name: Check Docker shell scripts
|
||||||
|
run: |
|
||||||
|
shellcheck bundle/docker/linux/*.sh
|
||||||
- name: Test GHA devscripts
|
- name: Test GHA devscripts
|
||||||
run: |
|
run: |
|
||||||
python -m devscripts.setup_variables_tests
|
pytest -Werror --tb=short devscripts/setup_variables_tests.py
|
||||||
|
|||||||
4
Makefile
4
Makefile
@ -10,7 +10,7 @@ tar: yt-dlp.tar.gz
|
|||||||
# intended use: when building a source distribution,
|
# intended use: when building a source distribution,
|
||||||
# make pypi-files && python3 -m build -sn .
|
# make pypi-files && python3 -m build -sn .
|
||||||
pypi-files: AUTHORS Changelog.md LICENSE README.md README.txt supportedsites \
|
pypi-files: AUTHORS Changelog.md LICENSE README.md README.txt supportedsites \
|
||||||
completions yt-dlp.1 pyproject.toml setup.cfg devscripts/* test/*
|
completions yt-dlp.1 pyproject.toml devscripts/* test/*
|
||||||
|
|
||||||
.PHONY: all clean clean-all clean-test clean-dist clean-cache \
|
.PHONY: all clean clean-all clean-test clean-dist clean-cache \
|
||||||
completions completion-bash completion-fish completion-zsh \
|
completions completion-bash completion-fish completion-zsh \
|
||||||
@ -159,7 +159,7 @@ yt-dlp.tar.gz: all
|
|||||||
README.md supportedsites.md Changelog.md LICENSE \
|
README.md supportedsites.md Changelog.md LICENSE \
|
||||||
CONTRIBUTING.md Collaborators.md CONTRIBUTORS AUTHORS \
|
CONTRIBUTING.md Collaborators.md CONTRIBUTORS AUTHORS \
|
||||||
Makefile yt-dlp.1 README.txt completions .gitignore \
|
Makefile yt-dlp.1 README.txt completions .gitignore \
|
||||||
setup.cfg yt-dlp yt_dlp pyproject.toml devscripts test
|
yt-dlp yt_dlp pyproject.toml devscripts test
|
||||||
|
|
||||||
AUTHORS: Changelog.md
|
AUTHORS: Changelog.md
|
||||||
@if [ -d '.git' ] && command -v git > /dev/null ; then \
|
@if [ -d '.git' ] && command -v git > /dev/null ; then \
|
||||||
|
|||||||
@ -13,6 +13,9 @@ services:
|
|||||||
CHANNEL: ${CHANNEL:?}
|
CHANNEL: ${CHANNEL:?}
|
||||||
ORIGIN: ${ORIGIN:?}
|
ORIGIN: ${ORIGIN:?}
|
||||||
VERSION:
|
VERSION:
|
||||||
|
PYTHON_VERSION:
|
||||||
|
SKIP_ONEDIR_BUILD:
|
||||||
|
SKIP_ONEFILE_BUILD:
|
||||||
volumes:
|
volumes:
|
||||||
- ../..:/yt-dlp
|
- ../..:/yt-dlp
|
||||||
|
|
||||||
@ -27,6 +30,8 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
EXE_NAME: ${EXE_NAME:?}
|
EXE_NAME: ${EXE_NAME:?}
|
||||||
UPDATE_TO:
|
UPDATE_TO:
|
||||||
|
SKIP_ONEDIR_BUILD:
|
||||||
|
SKIP_ONEFILE_BUILD:
|
||||||
volumes:
|
volumes:
|
||||||
- ../../dist:/build
|
- ../../dist:/build
|
||||||
|
|
||||||
@ -43,6 +48,9 @@ services:
|
|||||||
CHANNEL: ${CHANNEL:?}
|
CHANNEL: ${CHANNEL:?}
|
||||||
ORIGIN: ${ORIGIN:?}
|
ORIGIN: ${ORIGIN:?}
|
||||||
VERSION:
|
VERSION:
|
||||||
|
PYTHON_VERSION:
|
||||||
|
SKIP_ONEDIR_BUILD:
|
||||||
|
SKIP_ONEFILE_BUILD:
|
||||||
volumes:
|
volumes:
|
||||||
- ../..:/yt-dlp
|
- ../..:/yt-dlp
|
||||||
|
|
||||||
@ -57,6 +65,8 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
EXE_NAME: ${EXE_NAME:?}
|
EXE_NAME: ${EXE_NAME:?}
|
||||||
UPDATE_TO:
|
UPDATE_TO:
|
||||||
|
SKIP_ONEDIR_BUILD:
|
||||||
|
SKIP_ONEFILE_BUILD:
|
||||||
volumes:
|
volumes:
|
||||||
- ../../dist:/build
|
- ../../dist:/build
|
||||||
|
|
||||||
@ -73,10 +83,12 @@ services:
|
|||||||
CHANNEL: ${CHANNEL:?}
|
CHANNEL: ${CHANNEL:?}
|
||||||
ORIGIN: ${ORIGIN:?}
|
ORIGIN: ${ORIGIN:?}
|
||||||
VERSION:
|
VERSION:
|
||||||
SKIP_ONEFILE_BUILD: "1"
|
PYTHON_VERSION:
|
||||||
|
SKIP_ONEDIR_BUILD:
|
||||||
|
SKIP_ONEFILE_BUILD:
|
||||||
volumes:
|
volumes:
|
||||||
- ../..:/yt-dlp
|
- ../..:/yt-dlp
|
||||||
- ~/yt-dlp-build-venv:/yt-dlp-build-venv
|
- ../../venv:/yt-dlp-build-venv
|
||||||
|
|
||||||
linux_armv7l_verify:
|
linux_armv7l_verify:
|
||||||
build:
|
build:
|
||||||
@ -89,7 +101,8 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
EXE_NAME: ${EXE_NAME:?}
|
EXE_NAME: ${EXE_NAME:?}
|
||||||
UPDATE_TO:
|
UPDATE_TO:
|
||||||
TEST_ONEDIR_BUILD: "1"
|
SKIP_ONEDIR_BUILD:
|
||||||
|
SKIP_ONEFILE_BUILD:
|
||||||
volumes:
|
volumes:
|
||||||
- ../../dist:/build
|
- ../../dist:/build
|
||||||
|
|
||||||
@ -106,6 +119,9 @@ services:
|
|||||||
CHANNEL: ${CHANNEL:?}
|
CHANNEL: ${CHANNEL:?}
|
||||||
ORIGIN: ${ORIGIN:?}
|
ORIGIN: ${ORIGIN:?}
|
||||||
VERSION:
|
VERSION:
|
||||||
|
PYTHON_VERSION:
|
||||||
|
SKIP_ONEDIR_BUILD:
|
||||||
|
SKIP_ONEFILE_BUILD:
|
||||||
volumes:
|
volumes:
|
||||||
- ../..:/yt-dlp
|
- ../..:/yt-dlp
|
||||||
|
|
||||||
@ -120,6 +136,8 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
EXE_NAME: ${EXE_NAME:?}
|
EXE_NAME: ${EXE_NAME:?}
|
||||||
UPDATE_TO:
|
UPDATE_TO:
|
||||||
|
SKIP_ONEDIR_BUILD:
|
||||||
|
SKIP_ONEFILE_BUILD:
|
||||||
volumes:
|
volumes:
|
||||||
- ../../dist:/build
|
- ../../dist:/build
|
||||||
|
|
||||||
@ -136,6 +154,9 @@ services:
|
|||||||
CHANNEL: ${CHANNEL:?}
|
CHANNEL: ${CHANNEL:?}
|
||||||
ORIGIN: ${ORIGIN:?}
|
ORIGIN: ${ORIGIN:?}
|
||||||
VERSION:
|
VERSION:
|
||||||
|
PYTHON_VERSION:
|
||||||
|
SKIP_ONEDIR_BUILD:
|
||||||
|
SKIP_ONEFILE_BUILD:
|
||||||
EXCLUDE_CURL_CFFI: "1"
|
EXCLUDE_CURL_CFFI: "1"
|
||||||
volumes:
|
volumes:
|
||||||
- ../..:/yt-dlp
|
- ../..:/yt-dlp
|
||||||
@ -151,5 +172,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
EXE_NAME: ${EXE_NAME:?}
|
EXE_NAME: ${EXE_NAME:?}
|
||||||
UPDATE_TO:
|
UPDATE_TO:
|
||||||
|
SKIP_ONEDIR_BUILD:
|
||||||
|
SKIP_ONEFILE_BUILD:
|
||||||
volumes:
|
volumes:
|
||||||
- ../../dist:/build
|
- ../../dist:/build
|
||||||
|
|||||||
@ -1,16 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -exuo pipefail
|
set -exuo pipefail
|
||||||
|
|
||||||
if [[ -z "${USE_PYTHON_VERSION:-}" ]]; then
|
if [[ -z "${PYTHON_VERSION:-}" ]]; then
|
||||||
USE_PYTHON_VERSION="3.13"
|
PYTHON_VERSION="3.13"
|
||||||
|
echo "Defaulting to using Python ${PYTHON_VERSION}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function runpy {
|
function runpy {
|
||||||
"/opt/shared-cpython-${USE_PYTHON_VERSION}/bin/python${USE_PYTHON_VERSION}" "$@"
|
"/opt/shared-cpython-${PYTHON_VERSION}/bin/python${PYTHON_VERSION}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
function venvpy {
|
function venvpy {
|
||||||
"python${USE_PYTHON_VERSION}" "$@"
|
"python${PYTHON_VERSION}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
INCLUDES=(
|
INCLUDES=(
|
||||||
@ -23,6 +24,7 @@ if [[ -z "${EXCLUDE_CURL_CFFI:-}" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
runpy -m venv /yt-dlp-build-venv
|
runpy -m venv /yt-dlp-build-venv
|
||||||
|
# shellcheck disable=SC1091
|
||||||
source /yt-dlp-build-venv/bin/activate
|
source /yt-dlp-build-venv/bin/activate
|
||||||
# Inside the venv we use venvpy instead of runpy
|
# Inside the venv we use venvpy instead of runpy
|
||||||
venvpy -m ensurepip --upgrade --default-pip
|
venvpy -m ensurepip --upgrade --default-pip
|
||||||
|
|||||||
@ -1,7 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
if [ -n "${TEST_ONEDIR_BUILD:-}" ]; then
|
if [ -n "${SKIP_ONEFILE_BUILD:-}" ]; then
|
||||||
|
if [ -n "${SKIP_ONEDIR_BUILD:-}" ]; then
|
||||||
|
echo "All executable builds were skipped"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
echo "Extracting zip to verify onedir build"
|
echo "Extracting zip to verify onedir build"
|
||||||
if command -v python3 >/dev/null 2>&1; then
|
if command -v python3 >/dev/null 2>&1; then
|
||||||
python3 -m zipfile -e "/build/${EXE_NAME}.zip" ./
|
python3 -m zipfile -e "/build/${EXE_NAME}.zip" ./
|
||||||
@ -22,21 +26,20 @@ if [ -n "${TEST_ONEDIR_BUILD:-}" ]; then
|
|||||||
fi
|
fi
|
||||||
unzip "/build/${EXE_NAME}.zip" -d ./
|
unzip "/build/${EXE_NAME}.zip" -d ./
|
||||||
fi
|
fi
|
||||||
else
|
chmod +x "./${EXE_NAME}"
|
||||||
echo "Verifying onefile build"
|
|
||||||
cp "/build/${EXE_NAME}" ./
|
|
||||||
fi
|
|
||||||
|
|
||||||
chmod +x "./${EXE_NAME}"
|
|
||||||
|
|
||||||
if [ -n "${SKIP_UPDATE_TO:-}" ] || [ -n "${TEST_ONEDIR_BUILD:-}" ]; then
|
|
||||||
"./${EXE_NAME}" -v || true
|
"./${EXE_NAME}" -v || true
|
||||||
"./${EXE_NAME}" --version
|
"./${EXE_NAME}" --version
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Verifying onefile build"
|
||||||
|
cp "/build/${EXE_NAME}" ./
|
||||||
|
chmod +x "./${EXE_NAME}"
|
||||||
|
|
||||||
if [ -z "${UPDATE_TO:-}" ]; then
|
if [ -z "${UPDATE_TO:-}" ]; then
|
||||||
UPDATE_TO="yt-dlp/yt-dlp@2025.09.05"
|
"./${EXE_NAME}" -v || true
|
||||||
|
"./${EXE_NAME}" --version
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp "./${EXE_NAME}" "./${EXE_NAME}_downgraded"
|
cp "./${EXE_NAME}" "./${EXE_NAME}_downgraded"
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
# Allow direct execution
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -55,7 +54,7 @@ def _test(github_repository, note, repo_vars, repo_secrets, inputs, expected=Non
|
|||||||
assert result == exp, f'unexpected result: {github_repository} {note}'
|
assert result == exp, f'unexpected result: {github_repository} {note}'
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def test_setup_variables():
|
||||||
DEFAULT_VERSION_WITH_REVISION = dt.datetime.now(tz=dt.timezone.utc).strftime('%Y.%m.%d.%H%M%S')
|
DEFAULT_VERSION_WITH_REVISION = dt.datetime.now(tz=dt.timezone.utc).strftime('%Y.%m.%d.%H%M%S')
|
||||||
DEFAULT_VERSION = calculate_version()
|
DEFAULT_VERSION = calculate_version()
|
||||||
BASE_REPO_VARS = {
|
BASE_REPO_VARS = {
|
||||||
@ -323,9 +322,3 @@ def main():
|
|||||||
'pypi_project': None,
|
'pypi_project': None,
|
||||||
'pypi_suffix': None,
|
'pypi_suffix': None,
|
||||||
}, ignore_revision=True)
|
}, ignore_revision=True)
|
||||||
|
|
||||||
print('all tests passed')
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
|
|||||||
@ -108,7 +108,6 @@ include = [
|
|||||||
"/LICENSE", # included as license
|
"/LICENSE", # included as license
|
||||||
"/pyproject.toml", # included by default
|
"/pyproject.toml", # included by default
|
||||||
"/README.md", # included as readme
|
"/README.md", # included as readme
|
||||||
"/setup.cfg",
|
|
||||||
"/supportedsites.md",
|
"/supportedsites.md",
|
||||||
]
|
]
|
||||||
artifacts = [
|
artifacts = [
|
||||||
|
|||||||
39
setup.cfg
39
setup.cfg
@ -1,39 +0,0 @@
|
|||||||
[flake8]
|
|
||||||
exclude = build,venv,.tox,.git,.pytest_cache
|
|
||||||
ignore = E402,E501,E731,E741,W503
|
|
||||||
max_line_length = 120
|
|
||||||
per_file_ignores =
|
|
||||||
devscripts/lazy_load_template.py: F401
|
|
||||||
|
|
||||||
|
|
||||||
[autoflake]
|
|
||||||
ignore-init-module-imports = true
|
|
||||||
ignore-pass-after-docstring = true
|
|
||||||
remove-all-unused-imports = true
|
|
||||||
remove-duplicate-keys = true
|
|
||||||
remove-unused-variables = true
|
|
||||||
|
|
||||||
|
|
||||||
[tox:tox]
|
|
||||||
skipsdist = true
|
|
||||||
envlist = py{39,310,311,312,313,314},pypy311
|
|
||||||
skip_missing_interpreters = true
|
|
||||||
|
|
||||||
[testenv] # tox
|
|
||||||
deps =
|
|
||||||
pytest
|
|
||||||
commands = pytest {posargs:"-m not download"}
|
|
||||||
passenv = HOME # For test_compat_expanduser
|
|
||||||
setenv =
|
|
||||||
# PYTHONWARNINGS = error # Catches PIP's warnings too
|
|
||||||
|
|
||||||
|
|
||||||
[isort]
|
|
||||||
py_version = 39
|
|
||||||
multi_line_output = VERTICAL_HANGING_INDENT
|
|
||||||
line_length = 80
|
|
||||||
reverse_relative = true
|
|
||||||
ensure_newline_before_comments = true
|
|
||||||
include_trailing_comma = true
|
|
||||||
known_first_party =
|
|
||||||
test
|
|
||||||
@ -17,7 +17,7 @@ from .traversal import traverse_obj
|
|||||||
def random_user_agent():
|
def random_user_agent():
|
||||||
USER_AGENT_TMPL = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{} Safari/537.36'
|
USER_AGENT_TMPL = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{} Safari/537.36'
|
||||||
# Target versions released within the last ~6 months
|
# Target versions released within the last ~6 months
|
||||||
CHROME_MAJOR_VERSION_RANGE = (132, 138)
|
CHROME_MAJOR_VERSION_RANGE = (134, 140)
|
||||||
return USER_AGENT_TMPL.format(f'{random.randint(*CHROME_MAJOR_VERSION_RANGE)}.0.0.0')
|
return USER_AGENT_TMPL.format(f'{random.randint(*CHROME_MAJOR_VERSION_RANGE)}.0.0.0')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user