# This specfile is licensed under: # SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: Fedora Project Authors # SPDX-FileCopyrightText: 2022 Maxwell G # License text: https://spdx.org/licenses/MIT.html %bcond tests 1 Name: yt-dlp Version: 2026.06.09 Release: %mkrel 1 Summary: A command-line program to download videos from online video platforms Group: Video/Players License: Unlicense URL: https://github.com/yt-dlp/yt-dlp Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz # (tv) ship prebuild man pages as we don't have pandoc: Source10: yt-dlp.1 Patch0: yt-dlp-relax-dependencies.patch #From fedora Patch1: 0002-Restore-compatibility-with-pytest-9.patch BuildArch: noarch BuildRequires: python3-devel %if %{mgaver} < 10 BuildRequires: pyproject-rpm-macros BuildRequires: python3dist(setuptools) >= 40.8 BuildRequires: python3dist(wheel) #Automatic BuildRequires fail in mageia 9 BuildRequires: python3dist(brotli) BuildRequires: python3dist(certifi) BuildRequires: python3dist(hatchling) BuildRequires: python3dist(mutagen) BuildRequires: python3dist(pycryptodomex) BuildRequires: python3dist(websockets) BuildRequires: python3dist(yt-dlp-ejs) #Put here due fail in the generation #of runtime requires in mageia 9 and #I not generate the default subpackage Requires: python3dist(brotli) Requires: python3dist(certifi) Requires: python3dist(requests) Requires: python3dist(mutagen) Requires: python3dist(pycryptodomex) Requires: python3dist(urllib3) Requires: python3dist(websockets) Requires: python3dist(yt-dlp-ejs) %endif %if %{with tests} # Needed for %%check BuildRequires: python3dist(pytest) %endif # Needed for docs #BuildRequires: pandoc BuildRequires: make %if %{mgaver} >= 10 Requires: yt-dlp+default = %{version}-%{release} %endif Recommends: ffmpeg Suggests: python3dist(keyring) %description yt-dlp is a command-line program to download videos from many different online video platforms, such as youtube.com. The project is a fork of youtube-dl with additional features and fixes. %package bash-completion Summary: Bash completion for %{name} Requires: %{name} >= %{version}-%{release} Requires: bash-completion Supplements: (%{name} and bash-completion) %description bash-completion Bash command line completion support for %{name}. %package zsh-completion Summary: Zsh completion for %{name} Requires: %{name} >= %{version}-%{release} Requires: zsh Supplements: (%{name} and zsh) %description zsh-completion Zsh command line completion support for %{name}. %package fish-completion Summary: Fish completion for %{name} Requires: %{name} >= %{version}-%{release} Requires: fish Supplements: (%{name} and fish) %description fish-completion Fish command line completion support for %{name}. %prep %autosetup -p1 find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{}' + # change default to node sed -i "s/default=\['deno'\]/default=['node']/" yt_dlp/options.py %generate_buildrequires %if %{mgaver} >= 10 %pyproject_buildrequires -x default,secretstorage %else #TODO: Build fail now in mageia 9 with below or above macros #pyproject_buildrequires -r %endif %build # Docs and shell completions #make yt-dlp.1 completion-bash completion-zsh completion-fish make completion-bash completion-zsh completion-fish # Docs and shell completions are also included in the wheel. %pyproject_wheel %install %pyproject_install %pyproject_save_files yt_dlp mkdir -p %{buildroot}%{_mandir}/man1 install -m644 %{SOURCE10} %{buildroot}%{_mandir}/man1/ %check %if %{with tests} # See https://github.com/yt-dlp/yt-dlp/blob/master/devscripts/run_tests.sh %pytest -k "not download and not test_verify_cert[Websockets] and not test_networking and not test_clean_pot " %endif %files -f %{pyproject_files} %{_bindir}/%{name} %{_mandir}/man1/%{name}.1* %doc README.md %license LICENSE %files bash-completion %{_datadir}/bash-completion/completions/%{name} %files zsh-completion %{_datadir}/zsh/site-functions/_%{name} %files fish-completion %{_datadir}/fish/vendor_completions.d/%{name}.fish %if %{mgaver} < 10 %pyproject_extras_subpkg -n yt-dlp secretstorage %else %pyproject_extras_subpkg -n yt-dlp default,secretstorage %endif