Unverified Commit 7302c517 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

yt-dlp: 2025.10.22 -> 2025.11.12, add JS runtime (#460892)

parents aaed8bfd 9937d910
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
{
  lib,
  python3Packages,
  atomicparsley,
  deno,
  fetchFromGitHub,
  ffmpeg-headless,
  rtmpdump,
  atomicparsley,
  pandoc,
  installShellFiles,
  pandoc,
  rtmpdump,
  atomicparsleySupport ? true,
  ffmpegSupport ? true,
  javascriptSupport ? true,
  rtmpSupport ? true,
  withAlias ? false, # Provides bin/youtube-dl for backcompat
  nix-update-script,
@@ -19,14 +21,14 @@ python3Packages.buildPythonApplication rec {
  # The websites yt-dlp deals with are a very moving target. That means that
  # downloads break constantly. Because of that, updates should always be backported
  # to the latest stable release.
  version = "2025.10.22";
  version = "2025.11.12";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "yt-dlp";
    repo = "yt-dlp";
    tag = version;
    hash = "sha256-jQaENEflaF9HzY/EiMXIHgUehAJ3nnDT9IbaN6bDcac=";
    hash = "sha256-Em8FLcCizSfvucg+KPuJyhFZ5MJ8STTjSpqaTD5xeKI=";
  };

  postPatch = ''
@@ -57,6 +59,7 @@ python3Packages.buildPythonApplication rec {
      requests
      urllib3
      websockets
      yt-dlp-ejs # keep pinned version in sync!
    ];
    curl-cffi = [ python3Packages.curl-cffi ];
    secretstorage = with python3Packages; [
@@ -84,14 +87,15 @@ 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 =
    let
      packagesToBinPath =
        [ ]
        ++ lib.optional atomicparsleySupport atomicparsley
        lib.optional atomicparsleySupport atomicparsley
        ++ lib.optional ffmpegSupport ffmpeg-headless
        ++ lib.optional javascriptSupport deno
        ++ lib.optional rtmpSupport rtmpdump;
    in
    lib.optionals (packagesToBinPath != [ ]) [
@@ -121,11 +125,13 @@ python3Packages.buildPythonApplication rec {
    ln -s "$out/bin/yt-dlp" "$out/bin/youtube-dl"
  '';

  passthru.updateScript = nix-update-script { };
  passthru = {
    updateScript = nix-update-script { };
  };

  meta = {
    changelog = "https://github.com/yt-dlp/yt-dlp/blob/${version}/Changelog.md";
    description = "Command-line tool to download videos from YouTube.com and other sites (youtube-dl fork)";
    description = "Feature-rich command-line audio/video downloader";
    homepage = "https://github.com/yt-dlp/yt-dlp/";
    license = lib.licenses.unlicense;
    longDescription = ''
+62 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchNpmDeps,
  hatch-vcs,
  hatchling,
  nodejs,
  npmHooks,
}:

buildPythonPackage rec {
  pname = "yt-dlp-ejs";
  version = "0.3.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "yt-dlp";
    repo = "ejs";
    tag = version;
    hash = "sha256-PoZ7qmrf8en254im2D7fWy9jYiaJwFpq6ZXZP9ouOOQ=";
  };

  postPatch = ''
    # remove when upstream has a lock file we support https://github.com/yt-dlp/ejs/issues/29
    cp ${./package-lock.json} package-lock.json

    # we already ran npm install
    substituteInPlace hatch_build.py \
      --replace-fail 'subprocess.run(["npm", "install"], check=True, shell=requires_shell)' ""
  '';

  npmDeps = fetchNpmDeps {
    inherit src postPatch;
    hash = "sha256-2Xzetr2pb8J2w+ghfoTVP6oZTeVbHV7EcovwxElnUbA=";
  };

  build-system = [
    hatch-vcs
    hatchling
  ];

  nativeBuildInputs = [
    nodejs
    npmHooks.npmConfigHook
  ];

  meta = {
    changelog = "https://github.com/yt-dlp/ejs/releases/tag/${version}";
    description = "External JavaScript for yt-dlp supporting many runtimes";
    homepage = "https://github.com/yt-dlp/ejs/";
    license = with lib.licenses; [
      unlicense
      mit
      isc
    ];
    maintainers = with lib.maintainers; [
      SuperSandro2000
      FlameFlag
    ];
  };
}
+3186 −0

File added.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -12767,6 +12767,7 @@ with pkgs;
  yt-dlp-light = yt-dlp.override {
    atomicparsleySupport = false;
    ffmpegSupport = false;
    javascriptSupport = false;
    rtmpSupport = false;
  };

+2 −0
Original line number Diff line number Diff line
@@ -20707,6 +20707,8 @@ self: super: with self; {
  yt-dlp-dearrow = callPackage ../development/python-modules/yt-dlp-dearrow { };
  yt-dlp-ejs = callPackage ../development/python-modules/yt-dlp-ejs { };
  yt-dlp-light = toPythonModule (pkgs.yt-dlp-light.override { python3Packages = self; });
  yte = callPackage ../development/python-modules/yte { };