A feature-rich command-line audio/video downloader
[core] Include build origin in verbose output
bashonly20314dd46f25
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex c9260eecac..c5bb76d8b2 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -30,6 +30,10 @@ on:meta_files:default: truetype: boolean+ origin:+ required: false+ default: ''+ type: stringsecrets:GPG_SIGNING_KEY:required: false@@ -37,11 +41,13 @@ on:workflow_dispatch:inputs:version:- description: Version tag (YYYY.MM.DD[.REV])+ description: |+ VERSION: yyyy.mm.dd[.rev] or revrequired: truetype: stringchannel:- description: Update channel (stable/nightly/...)+ description: |+ SOURCE of this build's updates: stable/nightly/master/<repo>required: truedefault: stabletype: string@@ -73,12 +79,30 @@ on:description: SHA2-256SUMS, SHA2-512SUMS, _update_specdefault: truetype: boolean+ origin:+ description: .+ required: false+ default: ''+ type: choice+ options:+ - ''permissions:contents: readjobs:+ process:+ runs-on: ubuntu-latest+ outputs:+ origin: ${{ steps.process_origin.outputs.origin }}+ steps:+ - name: Process origin+ id: process_origin+ run: |+ echo "origin=${{ inputs.origin || github.repository }}" >> "$GITHUB_OUTPUT"+unix:+ needs: processif: inputs.unixruns-on: ubuntu-lateststeps:@@ -109,7 +133,7 @@ jobs:- name: Preparerun: |- python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}+ python devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"python devscripts/make_lazy_extractors.py- name: Build Unix platform-independent binaryrun: |@@ -148,6 +172,7 @@ jobs:yt-dlp_linux.ziplinux_arm:+ needs: processif: inputs.linux_armpermissions:contents: read@@ -183,7 +208,7 @@ jobs:run: |cd repopython3.8 -m pip install -U Pyinstaller -r requirements.txt # Cached version may be out of date- python3.8 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}+ python3.8 devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"python3.8 devscripts/make_lazy_extractors.pypython3.8 pyinst.py@@ -204,6 +229,7 @@ jobs:repo/dist/yt-dlp_linux_${{ (matrix.architecture == 'armv7' && 'armv7l') || matrix.architecture }}macos:+ needs: processif: inputs.macosruns-on: macos-11@@ -219,7 +245,7 @@ jobs:- name: Preparerun: |- python3 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}+ python3 devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"python3 devscripts/make_lazy_extractors.py- name: Buildrun: |@@ -245,6 +271,7 @@ jobs:dist/yt-dlp_macos.zipmacos_legacy:+ needs: processif: inputs.macos_legacyruns-on: macos-latest@@ -270,7 +297,7 @@ jobs:- name: Preparerun: |- python3 devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}+ python3 devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"python3 devscripts/make_lazy_extractors.py- name: Buildrun: |@@ -294,6 +321,7 @@ jobs:dist/yt-dlp_macos_legacywindows:+ needs: processif: inputs.windowsruns-on: windows-latest@@ -309,7 +337,7 @@ jobs:- name: Preparerun: |- python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}+ python devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"python devscripts/make_lazy_extractors.py- name: Buildrun: |@@ -341,6 +369,7 @@ jobs:dist/yt-dlp_win.zipwindows32:+ needs: processif: inputs.windows32runs-on: windows-latest@@ -357,7 +386,7 @@ jobs:- name: Preparerun: |- python devscripts/update-version.py -c ${{ inputs.channel }} ${{ inputs.version }}+ python devscripts/update-version.py -c "${{ inputs.channel }}" -r "${{ needs.process.outputs.origin }}" "${{ inputs.version }}"python devscripts/make_lazy_extractors.py- name: Buildrun: |@@ -385,6 +414,7 @@ jobs:meta_files:if: inputs.meta_files && always() && !cancelled()needs:+ - process- unix- linux_arm- macosdiff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 0e50b74e08..262c935089 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -134,7 +134,8 @@ jobs:revision="${{ (inputs.prerelease || !vars.PUSH_VERSION_COMMIT) && '$(date -u +"%H%M%S")' || '' }}"version="$(- python devscripts/update-version.py -c "${resolved_source}" ${{ inputs.version || '$revision' }} | \+ python devscripts/update-version.py \+ -c "${resolved_source}" -r "${{ github.repository }}" ${{ inputs.version || '$revision' }} | \grep -Po "version=\K\d+\.\d+\.\d+(\.\d+)?")"if [[ "${target_repo}" ]]; then@@ -240,6 +241,7 @@ jobs:with:version: ${{ needs.prepare.outputs.version }}channel: ${{ needs.prepare.outputs.channel }}+ origin: ${{ needs.prepare.outputs.target_repo }}permissions:contents: readpackages: write # For package cachediff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.pyindex fb8e894433..1fb3e4ad2b 100644--- a/yt_dlp/YoutubeDL.py+++ b/yt_dlp/YoutubeDL.py@@ -158,7 +158,7 @@ from .utils.networking import (clean_proxies,std_headers,)-from .version import CHANNEL, RELEASE_GIT_HEAD, VARIANT, __version__+from .version import CHANNEL, ORIGIN, RELEASE_GIT_HEAD, VARIANT, __version__if compat_os_name == 'nt':import ctypes@@ -3544,7 +3544,7 @@ class YoutubeDL:'version': __version__,'current_git_head': current_git_head(),'release_git_head': RELEASE_GIT_HEAD,- 'repository': REPOSITORY,+ 'repository': ORIGIN,})if remove_private_keys:@@ -3927,8 +3927,9 @@ class YoutubeDL:source += '*'klass = type(self)write_debug(join_nonempty(- f'{"yt-dlp" if REPOSITORY == "yt-dlp/yt-dlp" else REPOSITORY} version',- f'{CHANNEL}@{__version__}',+ f'{REPOSITORY.rpartition("/")[2]} version',+ f'{CHANNEL.rpartition("@")[2]}@{__version__}',+ not ORIGIN.startswith('yt-dlp/') and f'from {ORIGIN}',f'[{RELEASE_GIT_HEAD[:9]}]' if RELEASE_GIT_HEAD else '','' if source == 'unknown' else f'({source})','' if _IN_CLI else 'API' if klass == YoutubeDL else f'API:{self.__module__}.{klass.__qualname__}',