yt-dlp: make deno available to python dependents

This commit is contained in:
Mynacol
2025-11-29 21:04:00 +00:00
parent 695c875c8d
commit 89b0cab3ee

View File

@@ -38,6 +38,13 @@ python3Packages.buildPythonApplication rec {
substituteInPlace yt_dlp/networking/_curlcffi.py \
--replace-fail "if curl_cffi_version != (0, 5, 10) and not (0, 10) <= curl_cffi_version < (0, 14)" \
"if curl_cffi_version != (0, 5, 10) and not (0, 10) <= curl_cffi_version"
${lib.optionalString javascriptSupport ''
# deno is required for full YouTube support (since 2025.11.12).
# This makes yt-dlp find deno even if it is used as a python dependency, i.e. in kodiPackages.sendtokodi.
# Crafted so people can replace deno with one of the other JS runtimes.
substituteInPlace yt_dlp/utils/_jsruntime.py \
--replace-fail "path = _determine_runtime_path(self._path, '${deno.meta.mainProgram}')" "path = '${lib.getExe deno}'"
''}
'';
build-system = with python3Packages; [ hatchling ];
@@ -87,7 +94,6 @@ python3Packages.buildPythonApplication rec {
# Ensure these utilities are available in $PATH:
# - ffmpeg: post-processing & transcoding support
# - deno: required for full YouTube support (since 2025.11.12)
# - rtmpdump: download files over RTMP
# - atomicparsley: embedding thumbnails
makeWrapperArgs =
@@ -95,7 +101,6 @@ python3Packages.buildPythonApplication rec {
packagesToBinPath =
lib.optional atomicparsleySupport atomicparsley
++ lib.optional ffmpegSupport ffmpeg-headless
++ lib.optional javascriptSupport deno
++ lib.optional rtmpSupport rtmpdump;
in
lib.optionals (packagesToBinPath != [ ]) [