about summary refs log tree commit diff
path: root/pkgs/applications/video/mpv/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/video/mpv/scripts')
-rw-r--r--pkgs/applications/video/mpv/scripts/autosubsync-mpv.nix38
-rw-r--r--pkgs/applications/video/mpv/scripts/buildLua.nix147
-rw-r--r--pkgs/applications/video/mpv/scripts/chapterskip.nix24
-rw-r--r--pkgs/applications/video/mpv/scripts/convert.nix33
-rw-r--r--pkgs/applications/video/mpv/scripts/cutter.nix14
-rw-r--r--pkgs/applications/video/mpv/scripts/default.nix220
-rw-r--r--pkgs/applications/video/mpv/scripts/dynamic-crop.nix15
-rw-r--r--pkgs/applications/video/mpv/scripts/evafast.nix28
-rw-r--r--pkgs/applications/video/mpv/scripts/inhibit-gnome.nix19
-rw-r--r--pkgs/applications/video/mpv/scripts/manga-reader.nix2
-rw-r--r--pkgs/applications/video/mpv/scripts/memo.nix13
-rw-r--r--pkgs/applications/video/mpv/scripts/modernx-zydezu.nix22
-rw-r--r--pkgs/applications/video/mpv/scripts/modernx.nix13
-rw-r--r--pkgs/applications/video/mpv/scripts/mpris.nix21
-rw-r--r--pkgs/applications/video/mpv/scripts/mpv-cheatsheet.nix16
-rw-r--r--pkgs/applications/video/mpv/scripts/mpv-notify-send.nix24
-rw-r--r--pkgs/applications/video/mpv/scripts/mpv-osc-modern.nix11
-rw-r--r--pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix14
-rw-r--r--pkgs/applications/video/mpv/scripts/mpv-slicing.nix2
-rw-r--r--pkgs/applications/video/mpv/scripts/mpv-webm.nix17
-rw-r--r--pkgs/applications/video/mpv/scripts/mpv.nix41
-rw-r--r--pkgs/applications/video/mpv/scripts/mpvacious.nix31
-rw-r--r--pkgs/applications/video/mpv/scripts/occivink.nix68
-rw-r--r--pkgs/applications/video/mpv/scripts/quack.nix18
-rw-r--r--pkgs/applications/video/mpv/scripts/quality-menu.nix17
-rw-r--r--pkgs/applications/video/mpv/scripts/reload.nix18
-rw-r--r--pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix24
-rw-r--r--pkgs/applications/video/mpv/scripts/sponsorblock-minimal.nix12
-rw-r--r--pkgs/applications/video/mpv/scripts/sponsorblock.nix17
-rw-r--r--pkgs/applications/video/mpv/scripts/thumbfast.nix15
-rw-r--r--pkgs/applications/video/mpv/scripts/thumbnail.nix16
-rw-r--r--pkgs/applications/video/mpv/scripts/uosc.nix16
-rw-r--r--pkgs/applications/video/mpv/scripts/videoclip.nix39
-rw-r--r--pkgs/applications/video/mpv/scripts/visualizer.nix4
-rw-r--r--pkgs/applications/video/mpv/scripts/vr-reversal.nix16
-rw-r--r--pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix17
-rw-r--r--pkgs/applications/video/mpv/scripts/youtube-upnext.nix12
37 files changed, 652 insertions, 422 deletions
diff --git a/pkgs/applications/video/mpv/scripts/autosubsync-mpv.nix b/pkgs/applications/video/mpv/scripts/autosubsync-mpv.nix
new file mode 100644
index 0000000000000..d162da18c018a
--- /dev/null
+++ b/pkgs/applications/video/mpv/scripts/autosubsync-mpv.nix
@@ -0,0 +1,38 @@
+{
+  lib,
+  fetchFromGitHub,
+  buildLua,
+  alass,
+}:
+
+buildLua {
+  pname = "autosubsync-mpv";
+  version = "0-unstable-2022-12-26";
+
+  src = fetchFromGitHub {
+    owner = "joaquintorres";
+    repo = "autosubsync-mpv";
+    rev = "22cb928ecd94cc8cadaf8c354438123c43e0c70d";
+    sha256 = "sha256-XQPFC7l9MTZAW5FfULRQJfu/7FuGj9bbjQUZhNv0rlc=";
+  };
+
+  # While nixpkgs only packages alass, we might as well make that the default
+  patchPhase = ''
+    runHook prePatch
+    substituteInPlace autosubsync.lua                                            \
+      --replace-warn 'alass_path = ""' 'alass_path = "${alass}/bin/alass-cli"'   \
+      --replace-warn 'audio_subsync_tool = "ask"' 'audio_subsync_tool = "alass"' \
+      --replace-warn 'altsub_subsync_tool = "ask"' 'altsub_subsync_tool = "alass"'
+    runHook postPatch
+  '';
+
+  scriptPath = "./";
+  passthru.scriptName = "autosubsync-mpv";
+
+  meta = with lib; {
+    description = "Automatically sync subtitles in mpv using the `n` button";
+    homepage = "https://github.com/joaquintorres/autosubsync-mpv";
+    maintainers = with maintainers; [ kovirobi ];
+    license = licenses.mit;
+  };
+}
diff --git a/pkgs/applications/video/mpv/scripts/buildLua.nix b/pkgs/applications/video/mpv/scripts/buildLua.nix
index 8db7d4b1aa3c9..2e25ee55b28a0 100644
--- a/pkgs/applications/video/mpv/scripts/buildLua.nix
+++ b/pkgs/applications/video/mpv/scripts/buildLua.nix
@@ -1,5 +1,4 @@
-{ lib
-, stdenvNoCC }:
+{ lib, stdenvNoCC }:
 
 let
   # Escape strings for embedding in shell scripts
@@ -10,74 +9,90 @@ let
   scriptsDir = "$out/share/mpv/scripts";
 
   # similar to `lib.extends`, but with inverted precedence and recursive update
-  extendedBy = args: orig: self:
-    let super = args self;
-    in lib.recursiveUpdate (orig super) super
-  ;
+  extendedBy =
+    args: orig: self:
+    let
+      super = args self;
+    in
+    lib.recursiveUpdate (orig super) super;
 in
 
-lib.makeOverridable (args: stdenvNoCC.mkDerivation (extendedBy
-  (if lib.isFunction args then args else (_: args)) (
-  { pname
-  , extraScripts ? []
-  , ... }@args:
-  let
-    strippedName = with builtins;
-      let groups = match "mpv[-_](.*)" pname; in
-      if groups != null
-      then head groups
-      else pname
-    ;
-    # either passthru.scriptName, inferred from scriptPath, or from pname
-    scriptName = (args.passthru or {}).scriptName or (
-      if args ? scriptPath
-      then fileName args.scriptPath
-      else "${strippedName}.lua"
-    );
-    scriptPath = args.scriptPath or "./${scriptName}";
-  in {
-    dontBuild = true;
-    preferLocalBuild = true;
+lib.makeOverridable (
+  args:
+  stdenvNoCC.mkDerivation (
+    extendedBy (if lib.isFunction args then args else (_: args)) (
+      {
+        pname,
+        extraScripts ? [ ],
+        ...
+      }@args:
+      let
+        strippedName =
+          with builtins;
+          let
+            groups = match "mpv[-_](.*)" pname;
+          in
+          if groups != null then head groups else pname;
+        # either passthru.scriptName, inferred from scriptPath, or from pname
+        scriptName =
+          (args.passthru or { }).scriptName
+            or (if args ? scriptPath then fileName args.scriptPath else "${strippedName}.lua");
+        scriptPath = args.scriptPath or "./${scriptName}";
+      in
+      {
+        dontBuild = true;
+        preferLocalBuild = true;
 
-    # Prevent `patch` from emitting `.orig` files (that end up in the output)
-    patchFlags = [ "--no-backup-if-mismatch" "-p1" ];
+        # Prevent `patch` from emitting `.orig` files (that end up in the output)
+        patchFlags = [
+          "--no-backup-if-mismatch"
+          "-p1"
+        ];
 
-    outputHashMode = "recursive";
-    installPhase = ''
-      runHook preInstall
+        outputHashMode = "recursive";
+        installPhase = ''
+          runHook preInstall
 
-      if [ -d "${scriptPath}" ]; then
-        [ -f "${scriptPath}/main.lua" ] || {
-          echo "Script directory '${scriptPath}' does not contain 'main.lua'" >&2
-          exit 1
-        }
-        [ ${with builtins; toString (length extraScripts)} -eq 0 ] || {
-          echo "mpvScripts.buildLua does not support 'extraScripts'" \
-               "when 'scriptPath' is a directory" >&2
-          exit 1
-        }
-        mkdir -p "${scriptsDir}"
-        cp -a "${scriptPath}" "${scriptsDir}/${scriptName}"
-      else
-        install -m644 -Dt "${scriptsDir}" ${escaped scriptPath}
-        ${lib.optionalString (extraScripts != []) ''cp -at "${scriptsDir}/" ${escapedList extraScripts}''}
-      fi
+          if [ -d "${scriptPath}" ]; then
+            [ -f "${scriptPath}/main.lua" ] || {
+              echo "Script directory '${scriptPath}' does not contain 'main.lua'" >&2
+              exit 1
+            }
+            [ ${with builtins; toString (length extraScripts)} -eq 0 ] || {
+              echo "mpvScripts.buildLua does not support 'extraScripts'" \
+                   "when 'scriptPath' is a directory" >&2
+              exit 1
+            }
+            mkdir -p "${scriptsDir}"
+            cp -a "${scriptPath}" "${scriptsDir}/${scriptName}"
+          else
+            install -m644 -Dt "${scriptsDir}" ${escaped scriptPath}
+            ${
+              lib.optionalString (extraScripts != [ ]) ''cp -at "${scriptsDir}/" ${escapedList extraScripts}''
+            }
+          fi
 
-      runHook postInstall
-    '';
+          runHook postInstall
+        '';
 
-    passthru = { inherit scriptName; };
-    meta = {
-      platforms = lib.platforms.all;
-    } // (
-      let pos =
-        if (args.meta or {}) ? description then
-          builtins.unsafeGetAttrPos "description" args.meta
-        else
-          builtins.unsafeGetAttrPos "pname" args;
-      in lib.optionalAttrs
-        (pos != null)
-        { position = "${pos.file}:${toString pos.line}"; }
-    );
-  })
-))
+        passthru = {
+          inherit scriptName;
+        };
+        meta =
+          {
+            platforms = lib.platforms.all;
+          }
+          // (
+            let
+              pos =
+                if (args.meta or { }) ? description then
+                  builtins.unsafeGetAttrPos "description" args.meta
+                else
+                  builtins.unsafeGetAttrPos "pname" args;
+            in
+            lib.optionalAttrs (pos != null) { position = "${pos.file}:${toString pos.line}"; }
+          );
+      }
+    )
+  )
+)
diff --git a/pkgs/applications/video/mpv/scripts/chapterskip.nix b/pkgs/applications/video/mpv/scripts/chapterskip.nix
index 6c6fc4ba51fee..b1b993df3692a 100644
--- a/pkgs/applications/video/mpv/scripts/chapterskip.nix
+++ b/pkgs/applications/video/mpv/scripts/chapterskip.nix
@@ -1,7 +1,9 @@
-{ lib
-, fetchFromGitHub
-, unstableGitUpdater
-, buildLua }:
+{
+  lib,
+  fetchFromGitHub,
+  unstableGitUpdater,
+  buildLua,
+}:
 
 buildLua {
   pname = "chapterskip";
@@ -9,20 +11,20 @@ buildLua {
   version = "0-unstable-2022-09-08";
   src = fetchFromGitHub {
     owner = "po5";
-    repo  = "chapterskip";
-    rev   = "b26825316e3329882206ae78dc903ebc4613f039";
-    hash  = "sha256-OTrLQE3rYvPQamEX23D6HttNjx3vafWdTMxTiWpDy90=";
+    repo = "chapterskip";
+    rev = "b26825316e3329882206ae78dc903ebc4613f039";
+    hash = "sha256-OTrLQE3rYvPQamEX23D6HttNjx3vafWdTMxTiWpDy90=";
   };
-  passthru.updateScript = unstableGitUpdater {};
+  passthru.updateScript = unstableGitUpdater { };
 
   meta = {
     description = "Automatically skips chapters based on title";
     longDescription = ''
-    MPV script that skips chapters based on their title, categorized using regexes.
-    The set of skipped categories can be configured globally, or by an auto-profile.
+      MPV script that skips chapters based on their title, categorized using regexes.
+      The set of skipped categories can be configured globally, or by an auto-profile.
     '';
     homepage = "https://github.com/po5/chapterskip";
-    license = lib.licenses.unfree;  # https://github.com/po5/chapterskip/issues/10
+    license = lib.licenses.unfree; # https://github.com/po5/chapterskip/issues/10
     maintainers = with lib.maintainers; [ nicoo ];
   };
 }
diff --git a/pkgs/applications/video/mpv/scripts/convert.nix b/pkgs/applications/video/mpv/scripts/convert.nix
index d1fdc9c801bb7..1df83df46d8c4 100644
--- a/pkgs/applications/video/mpv/scripts/convert.nix
+++ b/pkgs/applications/video/mpv/scripts/convert.nix
@@ -1,11 +1,12 @@
-{ lib
-, fetchgit
-, unstableGitUpdater
+{
+  lib,
+  fetchgit,
+  unstableGitUpdater,
 
-, buildLua
-, libnotify
-, mkvtoolnix-cli
-, yad
+  buildLua,
+  libnotify,
+  mkvtoolnix-cli,
+  yad,
 }:
 
 buildLua {
@@ -16,20 +17,20 @@ buildLua {
     rev = "f95cee43e390e843a47e8ec9d1711a12a8cd343d";
     sha256 = "13m7l4sy2r8jv2sfrb3vvqvnim4a9ilnv28q5drlg09v298z3mck";
   };
-  passthru.updateScript = unstableGitUpdater {};
+  passthru.updateScript = unstableGitUpdater { };
 
   patches = [ ./convert.patch ];
 
   postPatch = ''
     substituteInPlace convert_script.lua \
-      --replace 'mkvpropedit_exe = "mkvpropedit"' \
-                'mkvpropedit_exe = "${mkvtoolnix-cli}/bin/mkvpropedit"' \
-      --replace 'mkvmerge_exe = "mkvmerge"' \
-                'mkvmerge_exe = "${mkvtoolnix-cli}/bin/mkvmerge"' \
-      --replace 'yad_exe = "yad"' \
-                'yad_exe = "${yad}/bin/yad"' \
-      --replace 'notify_send_exe = "notify-send"' \
-                'notify_send_exe = "${libnotify}/bin/notify-send"' \
+      --replace-fail 'mkvpropedit_exe = "mkvpropedit"' \
+                'mkvpropedit_exe = "${lib.getExe' mkvtoolnix-cli "mkvpropedit"}"' \
+      --replace-fail 'mkvmerge_exe = "mkvmerge"' \
+                'mkvmerge_exe = "${lib.getExe' mkvtoolnix-cli "mkvmerge"}"' \
+      --replace-fail 'yad_exe = "yad"' \
+                'yad_exe = "${lib.getExe yad}"' \
+      --replace-fail 'notify_send_exe = "notify-send"' \
+                'notify_send_exe = "${lib.getExe libnotify}"' \
   '';
 
   scriptPath = "convert_script.lua";
diff --git a/pkgs/applications/video/mpv/scripts/cutter.nix b/pkgs/applications/video/mpv/scripts/cutter.nix
index ac2f518a9b5ab..b051c08a85470 100644
--- a/pkgs/applications/video/mpv/scripts/cutter.nix
+++ b/pkgs/applications/video/mpv/scripts/cutter.nix
@@ -1,4 +1,10 @@
-{ lib, buildLua, fetchFromGitHub, makeWrapper, unstableGitUpdater }:
+{
+  lib,
+  buildLua,
+  fetchFromGitHub,
+  makeWrapper,
+  unstableGitUpdater,
+}:
 
 buildLua {
   pname = "video-cutter";
@@ -10,19 +16,19 @@ buildLua {
     rev = "01a0396c075d5f8bbd1de5b571e6231f8899ab65";
     sha256 = "sha256-veoRFzUCRH8TrvR7x+WWoycpDyxqrJZ/bnp61dVc0pE=";
   };
-  passthru.updateScript = unstableGitUpdater {};
+  passthru.updateScript = unstableGitUpdater { };
 
   nativeBuildInputs = [ makeWrapper ];
 
   postPatch = ''
     substituteInPlace cutter.lua \
-      --replace '~/.config/mpv/scripts/c_concat.sh' '${placeholder "out"}/share/mpv/scripts/c_concat.sh'
+      --replace-fail '~/.config/mpv/scripts/c_concat.sh' '${placeholder "out"}/share/mpv/scripts/c_concat.sh'
 
     # needs to be ran separately so that we can replace everything, and not every single mention explicitly
     # original script places them in the scripts folder, just spawning unnecessary errors
     # i know that hardcoding .config and especially the .mpv directory isn't best practice, but I didn't want to deviate too much from upstream
     substituteInPlace cutter.lua \
-      --replace '~/.config/mpv/scripts' "''${XDG_CONFIG_HOME:-~/.config}/mpv/cutter"
+      --replace-fail '~/.config/mpv/scripts' "''${XDG_CONFIG_HOME:-~/.config}/mpv/cutter"
   '';
 
   passthru.scriptName = "cutter.lua";
diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix
index ce5188c09d294..c9e433e6fe00d 100644
--- a/pkgs/applications/video/mpv/scripts/default.nix
+++ b/pkgs/applications/video/mpv/scripts/default.nix
@@ -1,111 +1,147 @@
-{ lib
-, config
-, newScope
-, runCommand
+{
+  lib,
+  config,
+  newScope,
+  runCommand,
 }:
 
 let
-  unionOfDisjoints = lib.fold lib.attrsets.unionOfDisjoint {};
+  unionOfDisjoints = lib.fold lib.attrsets.unionOfDisjoint { };
 
-  addTests = name: drv:
-    if ! lib.isDerivation drv then
+  addTests =
+    name: drv:
+    if !lib.isDerivation drv then
       drv
-    else let
-      inherit (drv) scriptName;
-      scriptPath = "share/mpv/scripts/${scriptName}";
-      fullScriptPath = "${drv}/${scriptPath}";
-    in drv.overrideAttrs (old: { passthru = (old.passthru or {}) // { tests = unionOfDisjoints [
-      (old.passthru.tests or {})
+    else
+      let
+        inherit (drv) scriptName;
+        scriptPath = "share/mpv/scripts/${scriptName}";
+        fullScriptPath = "${drv}/${scriptPath}";
+      in
+      drv.overrideAttrs (old: {
+        passthru = (old.passthru or { }) // {
+          tests = unionOfDisjoints [
+            (old.passthru.tests or { })
 
-      {
-        scriptName-is-valid = runCommand "mpvScripts.${name}.passthru.tests.scriptName-is-valid" {
-          meta.maintainers = with lib.maintainers; [ nicoo ];
-          preferLocalBuild = true;
-        } ''
-          if [ -e "${fullScriptPath}" ]; then
-            touch $out
-          else
-            echo "mpvScripts.\"${name}\" does not contain a script named \"${scriptName}\"" >&2
-            exit 1
-          fi
-        '';
-      }
+            {
+              scriptName-is-valid =
+                runCommand "mpvScripts.${name}.passthru.tests.scriptName-is-valid"
+                  {
+                    meta.maintainers = with lib.maintainers; [ nicoo ];
+                    preferLocalBuild = true;
+                  }
+                  ''
+                    if [ -e "${fullScriptPath}" ]; then
+                      touch $out
+                    else
+                      echo "mpvScripts.\"${name}\" does not contain a script named \"${scriptName}\"" >&2
+                      exit 1
+                    fi
+                  '';
+            }
 
-      # can't check whether `fullScriptPath` is a directory, in pure-evaluation mode
-      (with lib; optionalAttrs (! any (s: hasSuffix s drv.passthru.scriptName) [ ".js" ".lua" ".so" ]) {
-        single-main-in-script-dir = runCommand "mpvScripts.${name}.passthru.tests.single-main-in-script-dir" {
-          meta.maintainers = with lib.maintainers; [ nicoo ];
-          preferLocalBuild = true;
-        } ''
-          die() {
-            echo "$@" >&2
-            exit 1
-          }
+            # can't check whether `fullScriptPath` is a directory, in pure-evaluation mode
+            (
+              with lib;
+              optionalAttrs
+                (
+                  !any (s: hasSuffix s drv.passthru.scriptName) [
+                    ".js"
+                    ".lua"
+                    ".so"
+                  ]
+                )
+                {
+                  single-main-in-script-dir =
+                    runCommand "mpvScripts.${name}.passthru.tests.single-main-in-script-dir"
+                      {
+                        meta.maintainers = with lib.maintainers; [ nicoo ];
+                        preferLocalBuild = true;
+                      }
+                      ''
+                        die() {
+                          echo "$@" >&2
+                          exit 1
+                        }
 
-          cd "${drv}/${scriptPath}"  # so the glob expands to filenames only
-          mains=( main.* )
-          if [ "''${#mains[*]}" -eq 1 ]; then
-            touch $out
-          elif [ "''${#mains[*]}" -eq 0 ]; then
-            die "'${scriptPath}' contains no 'main.*' file"
-          else
-            die "'${scriptPath}' contains multiple 'main.*' files:" "''${mains[*]}"
-          fi
-        '';
-      })
-    ]; }; });
+                        cd "${drv}/${scriptPath}"  # so the glob expands to filenames only
+                        mains=( main.* )
+                        if [ "''${#mains[*]}" -eq 1 ]; then
+                          touch $out
+                        elif [ "''${#mains[*]}" -eq 0 ]; then
+                          die "'${scriptPath}' contains no 'main.*' file"
+                        else
+                          die "'${scriptPath}' contains multiple 'main.*' files:" "''${mains[*]}"
+                        fi
+                      '';
+                }
+            )
+          ];
+        };
+      });
 
-  scope = self: let
-    inherit (self) callPackage;
-  in lib.mapAttrs addTests {
-    inherit (callPackage ./mpv.nix { })
-      acompressor autocrop autodeint autoload;
-    inherit (callPackage ./occivink.nix { })
-      blacklistExtensions seekTo;
+  scope =
+    self:
+    let
+      inherit (self) callPackage;
+    in
+    lib.mapAttrs addTests {
+      inherit (callPackage ./mpv.nix { })
+        acompressor
+        autocrop
+        autodeint
+        autoload
+        ;
+      inherit (callPackage ./occivink.nix { }) blacklistExtensions seekTo;
 
-    buildLua = callPackage ./buildLua.nix { };
-    chapterskip = callPackage ./chapterskip.nix { };
-    convert = callPackage ./convert.nix { };
-    cutter = callPackage ./cutter.nix { };
-    dynamic-crop = callPackage ./dynamic-crop.nix { };
-    inhibit-gnome = callPackage ./inhibit-gnome.nix { };
-    memo = callPackage ./memo.nix { };
-    manga-reader = callPackage ./manga-reader.nix { };
-    modernx = callPackage ./modernx.nix { };
-    modernx-zydezu = callPackage ./modernx-zydezu.nix { };
-    mpris = callPackage ./mpris.nix { };
-    mpv-cheatsheet = callPackage ./mpv-cheatsheet.nix { };
-    mpv-notify-send = callPackage ./mpv-notify-send.nix { };
-    mpv-osc-modern = callPackage ./mpv-osc-modern.nix { };
-    mpv-playlistmanager = callPackage ./mpv-playlistmanager.nix { };
-    mpv-slicing = callPackage ./mpv-slicing.nix { };
-    mpv-webm = callPackage ./mpv-webm.nix { };
-    mpvacious = callPackage ./mpvacious.nix { };
-    quack = callPackage ./quack.nix { };
-    quality-menu = callPackage ./quality-menu.nix { };
-    reload = callPackage ./reload.nix { };
-    simple-mpv-webui = callPackage ./simple-mpv-webui.nix { };
-    sponsorblock = callPackage ./sponsorblock.nix { };
-    sponsorblock-minimal = callPackage ./sponsorblock-minimal.nix { };
-    thumbfast = callPackage ./thumbfast.nix { };
-    thumbnail = callPackage ./thumbnail.nix { };
-    uosc = callPackage ./uosc.nix { };
-    videoclip = callPackage ./videoclip.nix { };
-    visualizer = callPackage ./visualizer.nix { };
-    vr-reversal = callPackage ./vr-reversal.nix { };
-    webtorrent-mpv-hook = callPackage ./webtorrent-mpv-hook.nix { };
-    youtube-upnext = callPackage ./youtube-upnext.nix { };
-  };
+      buildLua = callPackage ./buildLua.nix { };
+      autosubsync-mpv = callPackage ./autosubsync-mpv.nix { };
+      chapterskip = callPackage ./chapterskip.nix { };
+      convert = callPackage ./convert.nix { };
+      cutter = callPackage ./cutter.nix { };
+      dynamic-crop = callPackage ./dynamic-crop.nix { };
+      evafast = callPackage ./evafast.nix { };
+      inhibit-gnome = callPackage ./inhibit-gnome.nix { };
+      memo = callPackage ./memo.nix { };
+      manga-reader = callPackage ./manga-reader.nix { };
+      modernx = callPackage ./modernx.nix { };
+      modernx-zydezu = callPackage ./modernx-zydezu.nix { };
+      mpris = callPackage ./mpris.nix { };
+      mpv-cheatsheet = callPackage ./mpv-cheatsheet.nix { };
+      mpv-notify-send = callPackage ./mpv-notify-send.nix { };
+      mpv-osc-modern = callPackage ./mpv-osc-modern.nix { };
+      mpv-playlistmanager = callPackage ./mpv-playlistmanager.nix { };
+      mpv-slicing = callPackage ./mpv-slicing.nix { };
+      mpv-webm = callPackage ./mpv-webm.nix { };
+      mpvacious = callPackage ./mpvacious.nix { };
+      quack = callPackage ./quack.nix { };
+      quality-menu = callPackage ./quality-menu.nix { };
+      reload = callPackage ./reload.nix { };
+      simple-mpv-webui = callPackage ./simple-mpv-webui.nix { };
+      sponsorblock = callPackage ./sponsorblock.nix { };
+      sponsorblock-minimal = callPackage ./sponsorblock-minimal.nix { };
+      thumbfast = callPackage ./thumbfast.nix { };
+      thumbnail = callPackage ./thumbnail.nix { };
+      uosc = callPackage ./uosc.nix { };
+      videoclip = callPackage ./videoclip.nix { };
+      visualizer = callPackage ./visualizer.nix { };
+      vr-reversal = callPackage ./vr-reversal.nix { };
+      webtorrent-mpv-hook = callPackage ./webtorrent-mpv-hook.nix { };
+      youtube-upnext = callPackage ./youtube-upnext.nix { };
+    };
 
   aliases = {
     youtube-quality = throw "'youtube-quality' is no longer maintained, use 'quality-menu' instead"; # added 2023-07-14
   };
 in
 
-with lib; pipe scope [
+with lib;
+pipe scope [
   (makeScope newScope)
-  (self:
-    assert builtins.intersectAttrs self aliases == {};
-    self // optionalAttrs config.allowAliases aliases)
+  (
+    self:
+    assert builtins.intersectAttrs self aliases == { };
+    self // optionalAttrs config.allowAliases aliases
+  )
   recurseIntoAttrs
 ]
diff --git a/pkgs/applications/video/mpv/scripts/dynamic-crop.nix b/pkgs/applications/video/mpv/scripts/dynamic-crop.nix
index f2cd7dc070166..541c83d5258ff 100644
--- a/pkgs/applications/video/mpv/scripts/dynamic-crop.nix
+++ b/pkgs/applications/video/mpv/scripts/dynamic-crop.nix
@@ -1,17 +1,18 @@
-{ lib
-, fetchFromGitHub
-, unstableGitUpdater
-, buildLua
+{
+  lib,
+  fetchFromGitHub,
+  unstableGitUpdater,
+  buildLua,
 }:
 buildLua {
   pname = "dynamic-crop";
 
-  version = "0-unstable-2023-12-22";
+  version = "0-unstable-2024-06-22";
   src = fetchFromGitHub {
     owner = "Ashyni";
     repo = "mpv-scripts";
-    rev = "c79a46ba03631eb2a9b4f598aab0b723f03fc531";
-    hash = "sha256-W4Dj2tyJHeHLqAndrzllKs4iwMe3Tu8rfzEGBHuke6s=";
+    rev = "1fadd5ea3e31818db33c9372c40161db6fc1bdd3";
+    hash = "sha256-nC0Iw+9PSGxc3OdYhEmFVa49Sw+rIbuFhgZvAphP4cM=";
   };
   passthru.scriptName = "dynamic-crop.lua";
 
diff --git a/pkgs/applications/video/mpv/scripts/evafast.nix b/pkgs/applications/video/mpv/scripts/evafast.nix
new file mode 100644
index 0000000000000..5260adb1a8efd
--- /dev/null
+++ b/pkgs/applications/video/mpv/scripts/evafast.nix
@@ -0,0 +1,28 @@
+{
+  fetchFromGitHub,
+  buildLua,
+  lib,
+  unstableGitUpdater,
+}:
+
+buildLua {
+  pname = "evafast";
+  version = "0-unstable-2024-02-09";
+
+  src = fetchFromGitHub {
+    owner = "po5";
+    repo = "evafast";
+    rev = "92af3e2e1c756ce83f9d0129c780caeef1131a0b";
+    hash = "sha256-BGWD2XwVu8zOSiDJ+9oWi8aPN2Wkw0Y0gF58X4f+tdI=";
+  };
+
+  # Drop the `branch` parameter once upstream merges `rewrite` back into `master`
+  passthru.updateScript = unstableGitUpdater { branch = "rewrite"; };
+
+  meta = with lib; {
+    description = "Seeking and hybrid fastforwarding like VHS";
+    homepage = "https://github.com/po5/evafast";
+    license = licenses.unfree; # no license; see https://github.com/po5/evafast/issues/15
+    maintainers = with lib.maintainers; [ purrpurrn ];
+  };
+}
diff --git a/pkgs/applications/video/mpv/scripts/inhibit-gnome.nix b/pkgs/applications/video/mpv/scripts/inhibit-gnome.nix
index 618c74adea930..02a54a2cf4751 100644
--- a/pkgs/applications/video/mpv/scripts/inhibit-gnome.nix
+++ b/pkgs/applications/video/mpv/scripts/inhibit-gnome.nix
@@ -1,4 +1,12 @@
-{ lib, stdenv, fetchFromGitHub, gitUpdater, pkg-config, dbus, mpv-unwrapped }:
+{
+  lib,
+  stdenv,
+  fetchFromGitHub,
+  gitUpdater,
+  pkg-config,
+  dbus,
+  mpv-unwrapped,
+}:
 
 stdenv.mkDerivation rec {
   pname = "mpv-inhibit-gnome";
@@ -10,13 +18,14 @@ stdenv.mkDerivation rec {
     rev = "v${version}";
     hash = "sha256-LSGg5gAQE2JpepBqhz6D6d3NlqYaU4bjvYf1F+oLphQ=";
   };
-  passthru.updateScript = gitUpdater {
-    rev-prefix = "v";
-  };
+  passthru.updateScript = gitUpdater { rev-prefix = "v"; };
 
   nativeBuildInputs = [ pkg-config ];
 
-  buildInputs = [ dbus mpv-unwrapped ];
+  buildInputs = [
+    dbus
+    mpv-unwrapped
+  ];
 
   passthru.scriptName = "mpv_inhibit_gnome.so";
 
diff --git a/pkgs/applications/video/mpv/scripts/manga-reader.nix b/pkgs/applications/video/mpv/scripts/manga-reader.nix
index 9a9621cb34d0e..4d8007d98d8d7 100644
--- a/pkgs/applications/video/mpv/scripts/manga-reader.nix
+++ b/pkgs/applications/video/mpv/scripts/manga-reader.nix
@@ -22,7 +22,7 @@ buildLua rec {
     longDescription = ''
       mpv-manga-reader is a script aimed at making mpv a usable manga reader.
     '';
-    homepage = "https://github.com//mpv-manga-reader";
+    homepage = "https://github.com/Dudemanguy/mpv-manga-reader";
     license = lib.licenses.gpl3;
     maintainers = with lib.maintainers; [ idlip ];
   };
diff --git a/pkgs/applications/video/mpv/scripts/memo.nix b/pkgs/applications/video/mpv/scripts/memo.nix
index 5361b796268e1..5d9e2b50fae27 100644
--- a/pkgs/applications/video/mpv/scripts/memo.nix
+++ b/pkgs/applications/video/mpv/scripts/memo.nix
@@ -1,7 +1,8 @@
-{ fetchFromGitHub
-, buildLua
-, lib
-, unstableGitUpdater
+{
+  fetchFromGitHub,
+  buildLua,
+  lib,
+  unstableGitUpdater,
 }:
 
 buildLua {
@@ -15,10 +16,10 @@ buildLua {
     hash = "sha256-m8ikXuw7PM4Btg8w7ufLneKA4fnYjMyfVJYueZILMw8=";
   };
 
-  passthru.updateScript = unstableGitUpdater {};
+  passthru.updateScript = unstableGitUpdater { };
 
   meta = with lib; {
-    description = "A recent files menu for mpv";
+    description = "Recent files menu for mpv";
     homepage = "https://github.com/po5/memo";
     license = licenses.gpl3Only;
     maintainers = with lib.maintainers; [ purrpurrn ];
diff --git a/pkgs/applications/video/mpv/scripts/modernx-zydezu.nix b/pkgs/applications/video/mpv/scripts/modernx-zydezu.nix
index 36b20fe11205c..3ef673ab518f3 100644
--- a/pkgs/applications/video/mpv/scripts/modernx-zydezu.nix
+++ b/pkgs/applications/video/mpv/scripts/modernx-zydezu.nix
@@ -1,19 +1,20 @@
-{ lib
-, buildLua
-, fetchFromGitHub
-, makeFontsConf
-, nix-update-script
+{
+  lib,
+  buildLua,
+  fetchFromGitHub,
+  makeFontsConf,
+  nix-update-script,
 }:
 buildLua (finalAttrs: {
   pname = "modernx-zydezu";
-  version = "0.2.9";
+  version = "0.3.5.5";
 
   scriptPath = "modernx.lua";
   src = fetchFromGitHub {
     owner = "zydezu";
     repo = "ModernX";
     rev = finalAttrs.version;
-    hash = "sha256-Tq/v8EbojvOSSwbu8kdbLVxZWZNi1UH6zAPTcsUcgog";
+    hash = "sha256-sPpVwI8w5JsP/jML0viOSqhyYBVKfxWuKbxHkX3GVug=";
   };
 
   postInstall = ''
@@ -31,9 +32,12 @@ buildLua (finalAttrs: {
   passthru.updateScript = nix-update-script { };
 
   meta = with lib; {
-    description = "A modern OSC UI replacement for MPV that retains the functionality of the default OSC";
+    description = "Modern OSC UI replacement for MPV that retains the functionality of the default OSC";
     homepage = "https://github.com/zydezu/ModernX";
     license = licenses.lgpl21Plus;
-    maintainers = with maintainers; [ Guanran928 ];
+    maintainers = with maintainers; [
+      luftmensch-luftmensch
+      Guanran928
+    ];
   };
 })
diff --git a/pkgs/applications/video/mpv/scripts/modernx.nix b/pkgs/applications/video/mpv/scripts/modernx.nix
index 340b169a0c03d..28a50e15d5d83 100644
--- a/pkgs/applications/video/mpv/scripts/modernx.nix
+++ b/pkgs/applications/video/mpv/scripts/modernx.nix
@@ -1,8 +1,9 @@
-{ lib
-, buildLua
-, fetchFromGitHub
-, makeFontsConf
-, nix-update-script
+{
+  lib,
+  buildLua,
+  fetchFromGitHub,
+  makeFontsConf,
+  nix-update-script,
 }:
 buildLua (finalAttrs: {
   pname = "modernx";
@@ -31,7 +32,7 @@ buildLua (finalAttrs: {
   passthru.updateScript = nix-update-script { };
 
   meta = with lib; {
-    description = "A modern OSC UI replacement for MPV that retains the functionality of the default OSC";
+    description = "Modern OSC UI replacement for MPV that retains the functionality of the default OSC";
     homepage = "https://github.com/cyl0/ModernX";
     license = licenses.lgpl21Plus;
     maintainers = with maintainers; [ Guanran928 ];
diff --git a/pkgs/applications/video/mpv/scripts/mpris.nix b/pkgs/applications/video/mpv/scripts/mpris.nix
index 338f0a8dd482f..fbb1a8f685838 100644
--- a/pkgs/applications/video/mpv/scripts/mpris.nix
+++ b/pkgs/applications/video/mpv/scripts/mpris.nix
@@ -1,4 +1,13 @@
-{ lib, stdenv, fetchFromGitHub, gitUpdater, pkg-config, glib, mpv-unwrapped, ffmpeg }:
+{
+  lib,
+  stdenv,
+  fetchFromGitHub,
+  gitUpdater,
+  pkg-config,
+  glib,
+  mpv-unwrapped,
+  ffmpeg,
+}:
 
 stdenv.mkDerivation rec {
   pname = "mpv-mpris";
@@ -10,14 +19,18 @@ stdenv.mkDerivation rec {
     rev = version;
     hash = "sha256-vZIO6ILatIWa9nJYOp4AMKwvaZLahqYWRLMDOizyBI0=";
   };
-  passthru.updateScript = gitUpdater {};
+  passthru.updateScript = gitUpdater { };
 
   nativeBuildInputs = [ pkg-config ];
 
-  buildInputs = [ glib mpv-unwrapped ffmpeg ];
+  buildInputs = [
+    glib
+    mpv-unwrapped
+    ffmpeg
+  ];
 
   postPatch = ''
-    substituteInPlace Makefile --replace 'PKG_CONFIG =' 'PKG_CONFIG ?='
+    substituteInPlace Makefile --replace-fail 'PKG_CONFIG =' 'PKG_CONFIG ?='
   '';
 
   installFlags = [ "SCRIPTS_DIR=${placeholder "out"}/share/mpv/scripts" ];
diff --git a/pkgs/applications/video/mpv/scripts/mpv-cheatsheet.nix b/pkgs/applications/video/mpv/scripts/mpv-cheatsheet.nix
index a15f54d01ef22..c0c62867c1ee2 100644
--- a/pkgs/applications/video/mpv/scripts/mpv-cheatsheet.nix
+++ b/pkgs/applications/video/mpv/scripts/mpv-cheatsheet.nix
@@ -1,8 +1,9 @@
-{ lib
-, fetchFromGitHub
-, gitUpdater
-, nodePackages
-, stdenvNoCC
+{
+  lib,
+  fetchFromGitHub,
+  gitUpdater,
+  nodePackages,
+  stdenvNoCC,
 }:
 stdenvNoCC.mkDerivation (finalAttrs: {
   pname = "mpv-cheatsheet";
@@ -16,9 +17,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
   };
   passthru.updateScript = gitUpdater { rev-prefix = "v"; };
 
-  nativeBuildInputs = [
-    nodePackages.browserify
-  ];
+  nativeBuildInputs = [ nodePackages.browserify ];
 
   buildPhase = ''
     runHook preBuild
@@ -36,7 +35,6 @@ stdenvNoCC.mkDerivation (finalAttrs: {
     runHook postInstall
   '';
 
-
   passthru.scriptName = "cheatsheet.js";
 
   meta = with lib; {
diff --git a/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix b/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix
index 04b03670b79f2..b103a45d275bf 100644
--- a/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix
+++ b/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix
@@ -1,9 +1,11 @@
-{ lib
-, buildLua
-, fetchFromGitHub
-, fetchpatch
-, unstableGitUpdater
-, libnotify }:
+{
+  lib,
+  buildLua,
+  fetchFromGitHub,
+  fetchpatch,
+  unstableGitUpdater,
+  libnotify,
+}:
 
 buildLua rec {
   pname = "mpv-notify-send";
@@ -19,19 +21,23 @@ buildLua rec {
   patches = [
     # show title of online videos instead of url
     (fetchpatch {
-      url = "https://github.com/emilazy/mpv-notify-send/pull/6.patch";
+      name = "6.patch"; # https://github.com/emilazy/mpv-notify-send/pull/6
+      url = "https://github.com/emilazy/mpv-notify-send/commit/948347e14890e15e89cd1e069beb1140e2d01dce.patch";
       hash = "sha256-7aXQ8qeqG4yX0Uyn09xCIESnwPZsb6Frd7C49XgbpFw=";
     })
   ];
 
   passthru.extraWrapperArgs = [
-    "--prefix" "PATH" ":" (lib.makeBinPath libnotify)
+    "--prefix"
+    "PATH"
+    ":"
+    (lib.makeBinPath libnotify)
   ];
 
   passthru.updateScript = unstableGitUpdater { };
 
   meta = with lib; {
-    description = "A Lua script for mpv to send notifications with notify-send";
+    description = "Lua script for mpv to send notifications with notify-send";
     homepage = "https://github.com/emilazy/mpv-notify-send";
     license = licenses.wtfpl;
     maintainers = with maintainers; [ r3n3gad3p3arl ];
diff --git a/pkgs/applications/video/mpv/scripts/mpv-osc-modern.nix b/pkgs/applications/video/mpv/scripts/mpv-osc-modern.nix
index ce32622d64d8f..0d2c292d702a0 100644
--- a/pkgs/applications/video/mpv/scripts/mpv-osc-modern.nix
+++ b/pkgs/applications/video/mpv/scripts/mpv-osc-modern.nix
@@ -1,8 +1,9 @@
-{ lib
-, buildLua
-, fetchFromGitHub
-, makeFontsConf
-, nix-update-script
+{
+  lib,
+  buildLua,
+  fetchFromGitHub,
+  makeFontsConf,
+  nix-update-script,
 }:
 buildLua (finalAttrs: {
   pname = "mpv-osc-modern";
diff --git a/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix b/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix
index 44f09b8f21fe8..00e44d1f94474 100644
--- a/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix
+++ b/pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix
@@ -1,4 +1,10 @@
-{ lib, buildLua, fetchFromGitHub, unstableGitUpdater, yt-dlp }:
+{
+  lib,
+  buildLua,
+  fetchFromGitHub,
+  unstableGitUpdater,
+  yt-dlp,
+}:
 
 buildLua rec {
   pname = "mpv-playlistmanager";
@@ -10,12 +16,12 @@ buildLua rec {
     rev = "1911dc053951169c98cfcfd9f44ef87d9122ca80";
     hash = "sha256-pcdOMhkivLF5B86aNuHrqj77DuYLAFGlwFwY7jxkDkE=";
   };
-  passthru.updateScript = unstableGitUpdater {};
+  passthru.updateScript = unstableGitUpdater { };
 
   postPatch = ''
     substituteInPlace playlistmanager.lua \
-      --replace 'youtube_dl_executable = "youtube-dl",' \
-      'youtube_dl_executable = "${lib.getBin yt-dlp}/bin/yt-dlp"',
+      --replace-fail 'youtube_dl_executable = "yt-dlp",' \
+      'youtube_dl_executable = "${lib.getExe yt-dlp}"',
   '';
 
   meta = with lib; {
diff --git a/pkgs/applications/video/mpv/scripts/mpv-slicing.nix b/pkgs/applications/video/mpv/scripts/mpv-slicing.nix
index cf66a6c78a297..c46388f7ebea4 100644
--- a/pkgs/applications/video/mpv/scripts/mpv-slicing.nix
+++ b/pkgs/applications/video/mpv/scripts/mpv-slicing.nix
@@ -26,7 +26,7 @@ buildLua {
   passthru.scriptName = "slicing.lua";
 
   meta = {
-    description = "A lua script to cut fragments of the video in uncompressed RGB format";
+    description = "Lua script to cut fragments of the video in uncompressed RGB format";
     homepage = "https://github.com/Kagami/mpv_slicing";
     license = lib.licenses.cc0;
     maintainers = with lib.maintainers; [ tomasajt ];
diff --git a/pkgs/applications/video/mpv/scripts/mpv-webm.nix b/pkgs/applications/video/mpv/scripts/mpv-webm.nix
index efff9fa8ee169..409d86c193f42 100644
--- a/pkgs/applications/video/mpv/scripts/mpv-webm.nix
+++ b/pkgs/applications/video/mpv/scripts/mpv-webm.nix
@@ -1,19 +1,20 @@
-{ lib
-, buildLua
-, fetchFromGitHub
-, luaPackages
-, unstableGitUpdater
+{
+  lib,
+  buildLua,
+  fetchFromGitHub,
+  luaPackages,
+  unstableGitUpdater,
 }:
 
 buildLua {
   pname = "mpv-webm";
-  version = "0-unstable-2024-04-22";
+  version = "0-unstable-2024-05-13";
 
   src = fetchFromGitHub {
     owner = "ekisu";
     repo = "mpv-webm";
-    rev = "225e8e53842f7da6f77034309c1e54293dc629a4";
-    hash = "sha256-82xWiuOChxfzX6e0+cGFxTqyuiPefyVwpvLM5ka7nPk=";
+    rev = "8d4902b2aec92f40e4595ec9a411ab90488dcf4e";
+    hash = "sha256-aPPVAZu9reDdyovSpDklYZYLaapKBclAx3lCYUMJt+w=";
   };
   passthru.updateScript = unstableGitUpdater {
     # only "latest" tag pointing at HEAD
diff --git a/pkgs/applications/video/mpv/scripts/mpv.nix b/pkgs/applications/video/mpv/scripts/mpv.nix
index 06e9ccb4d74a8..ddf22e5dd03cf 100644
--- a/pkgs/applications/video/mpv/scripts/mpv.nix
+++ b/pkgs/applications/video/mpv/scripts/mpv.nix
@@ -1,24 +1,31 @@
-{ lib
-, buildLua
-, mpv-unwrapped
+{
+  lib,
+  buildLua,
+  mpv-unwrapped,
 }:
 
-let mkBuiltin = name: args:
-  let srcPath = "TOOLS/lua/${name}.lua";
-  in buildLua (lib.attrsets.recursiveUpdate rec {
-    inherit (mpv-unwrapped) src version;
-    pname = "mpv-${name}";
+let
+  mkBuiltin =
+    name: args:
+    let
+      srcPath = "TOOLS/lua/${name}.lua";
+    in
+    buildLua (
+      lib.attrsets.recursiveUpdate rec {
+        inherit (mpv-unwrapped) src version;
+        pname = "mpv-${name}";
 
-    dontUnpack = true;
-    scriptPath = "${src}/${srcPath}";
+        dontUnpack = true;
+        scriptPath = "${src}/${srcPath}";
 
-    meta = with lib; {
-      inherit (mpv-unwrapped.meta) license;
-      homepage = "https://github.com/mpv-player/mpv/blob/v${version}/${srcPath}";
-    };
-  } args);
-
-in lib.mapAttrs (name: lib.makeOverridable (mkBuiltin name)) {
+        meta = with lib; {
+          inherit (mpv-unwrapped.meta) license;
+          homepage = "https://github.com/mpv-player/mpv/blob/v${version}/${srcPath}";
+        };
+      } args
+    );
+in
+lib.mapAttrs (name: lib.makeOverridable (mkBuiltin name)) {
   acompressor.meta = {
     description = "Script to toggle and control ffmpeg's dynamic range compression filter.";
     maintainers = with lib.maintainers; [ nicoo ];
diff --git a/pkgs/applications/video/mpv/scripts/mpvacious.nix b/pkgs/applications/video/mpv/scripts/mpvacious.nix
index adac4d1d60692..34776679aa257 100644
--- a/pkgs/applications/video/mpv/scripts/mpvacious.nix
+++ b/pkgs/applications/video/mpv/scripts/mpvacious.nix
@@ -1,33 +1,32 @@
-{ lib
-, buildLua
-, fetchFromGitHub
-, gitUpdater
-, curl
-, wl-clipboard
-, xclip
+{
+  lib,
+  buildLua,
+  fetchFromGitHub,
+  gitUpdater,
+  curl,
+  wl-clipboard,
+  xclip,
 }:
 
 buildLua rec {
   pname = "mpvacious";
-  version = "0.33";
+  version = "0.35";
 
   src = fetchFromGitHub {
     owner = "Ajatt-Tools";
     repo = "mpvacious";
     rev = "v${version}";
-    sha256 = "sha256-VHMXW2AzgX88EDnNshxo9Gh8mpXzRoTAq+58HKasUdo=";
-  };
-  passthru.updateScript = gitUpdater {
-    rev-prefix = "v";
+    sha256 = "sha256-LcO17zkGkXWqSjWPTA3cVwRnmSrhTlS3W4RhhYaKgY4=";
   };
+  passthru.updateScript = gitUpdater { rev-prefix = "v"; };
 
   postPatch = ''
     substituteInPlace utils/forvo.lua \
-      --replace "'curl" "'${curl}/bin/curl"
+      --replace-fail "'curl" "'${lib.getExe curl}"
     substituteInPlace platform/nix.lua \
-      --replace "'curl" "'${curl}/bin/curl" \
-      --replace "'wl-copy" "'${wl-clipboard}/bin/wl-copy" \
-      --replace "'xclip" "'${xclip}/bin/xclip"
+      --replace-fail "'curl" "'${lib.getExe curl}" \
+      --replace-fail "'wl-copy" "'${lib.getExe' wl-clipboard "wl-copy"}" \
+      --replace-fail "'xclip" "'${lib.getExe xclip}"
   '';
 
   installPhase = ''
diff --git a/pkgs/applications/video/mpv/scripts/occivink.nix b/pkgs/applications/video/mpv/scripts/occivink.nix
index be3bdb07db8da..948a90c0d89b3 100644
--- a/pkgs/applications/video/mpv/scripts/occivink.nix
+++ b/pkgs/applications/video/mpv/scripts/occivink.nix
@@ -1,45 +1,49 @@
-{ lib
-, fetchFromGitHub
-, unstableGitUpdater
-, buildLua
+{
+  lib,
+  fetchFromGitHub,
+  unstableGitUpdater,
+  buildLua,
 }:
 
 let
-  camelToKebab = let
-    inherit (lib.strings) match stringAsChars toLower;
-    isUpper = match "[A-Z]";
-  in stringAsChars (c: if isUpper c != null then "-${toLower c}" else c);
+  camelToKebab =
+    let
+      inherit (lib.strings) match stringAsChars toLower;
+      isUpper = match "[A-Z]";
+    in
+    stringAsChars (c: if isUpper c != null then "-${toLower c}" else c);
 
-  mkScript = name: args:
-    let self = rec {
-      pname = camelToKebab name;
-      version = "0-unstable-2024-01-11";
-      src = fetchFromGitHub {
-        owner = "occivink";
-        repo = "mpv-scripts";
-        rev = "d0390c8e802c2e888ff4a2e1d5e4fb040f855b89";
-        hash = "sha256-pc2aaO7lZaoYMEXv5M0WI7PtmqgkNbdtNiLZZwVzppM=";
-      };
-      passthru.updateScript = unstableGitUpdater {};
-
-      scriptPath = "scripts/${pname}.lua";
+  mkScript =
+    name: args:
+    let
+      self = rec {
+        pname = camelToKebab name;
+        version = "0-unstable-2024-01-11";
+        src = fetchFromGitHub {
+          owner = "occivink";
+          repo = "mpv-scripts";
+          rev = "d0390c8e802c2e888ff4a2e1d5e4fb040f855b89";
+          hash = "sha256-pc2aaO7lZaoYMEXv5M0WI7PtmqgkNbdtNiLZZwVzppM=";
+        };
+        passthru.updateScript = unstableGitUpdater { };
 
-      meta = with lib; {
-        homepage = "https://github.com/occivink/mpv-scripts";
-        license = licenses.unlicense;
-        maintainers = with maintainers; [ nicoo ];
-      };
+        scriptPath = "scripts/${pname}.lua";
 
-      # Sadly needed to make `common-updaters` work here
-      pos = builtins.unsafeGetAttrPos "version" self;
-    };
-    in buildLua (lib.attrsets.recursiveUpdate self args);
+        meta = with lib; {
+          homepage = "https://github.com/occivink/mpv-scripts";
+          license = licenses.unlicense;
+          maintainers = with maintainers; [ nicoo ];
+        };
 
+        # Sadly needed to make `common-updaters` work here
+        pos = builtins.unsafeGetAttrPos "version" self;
+      };
+    in
+    buildLua (lib.attrsets.recursiveUpdate self args);
 in
 lib.mapAttrs (name: lib.makeOverridable (mkScript name)) {
 
   # Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.seekTo ]; }`
   seekTo.meta.description = "Mpv script for seeking to a specific position";
-  blacklistExtensions.meta.description =
-    "Automatically remove playlist entries based on their extension.";
+  blacklistExtensions.meta.description = "Automatically remove playlist entries based on their extension.";
 }
diff --git a/pkgs/applications/video/mpv/scripts/quack.nix b/pkgs/applications/video/mpv/scripts/quack.nix
index 646a7a524d18f..a1b32f2911811 100644
--- a/pkgs/applications/video/mpv/scripts/quack.nix
+++ b/pkgs/applications/video/mpv/scripts/quack.nix
@@ -1,7 +1,9 @@
-{ lib
-, fetchFromGitHub
-, unstableGitUpdater
-, buildLua }:
+{
+  lib,
+  fetchFromGitHub,
+  unstableGitUpdater,
+  buildLua,
+}:
 
 buildLua rec {
   pname = "mpv-quack";
@@ -9,11 +11,11 @@ buildLua rec {
   version = "0-unstable-2020-05-27";
   src = fetchFromGitHub {
     owner = "CounterPillow";
-    repo  = "mpv-quack";
-    rev   = "1c87f36f9726d462dd112188c04be54d85692cf3";
-    hash  = "sha256-dEnJbS8RJoAxpKINdoMHN4l7vpEdf7+C5JVWpK0VXMw=";
+    repo = "mpv-quack";
+    rev = "1c87f36f9726d462dd112188c04be54d85692cf3";
+    hash = "sha256-dEnJbS8RJoAxpKINdoMHN4l7vpEdf7+C5JVWpK0VXMw=";
   };
-  passthru.updateScript = unstableGitUpdater {};
+  passthru.updateScript = unstableGitUpdater { };
 
   meta = {
     description = "Reduce audio volume after seeking";
diff --git a/pkgs/applications/video/mpv/scripts/quality-menu.nix b/pkgs/applications/video/mpv/scripts/quality-menu.nix
index c75e810687132..36e5024b6aa8e 100644
--- a/pkgs/applications/video/mpv/scripts/quality-menu.nix
+++ b/pkgs/applications/video/mpv/scripts/quality-menu.nix
@@ -1,8 +1,9 @@
-{ lib
-, buildLua
-, fetchFromGitHub
-, gitUpdater
-, oscSupport ? false
+{
+  lib,
+  buildLua,
+  fetchFromGitHub,
+  gitUpdater,
+  oscSupport ? false,
 }:
 
 buildLua rec {
@@ -15,14 +16,12 @@ buildLua rec {
     rev = "v${version}";
     hash = "sha256-yrcTxqpLnOI1Tq3khhflO3wzhyeTPuvKifyH5/P57Ns=";
   };
-  passthru.updateScript = gitUpdater {
-    rev-prefix = "v";
-  };
+  passthru.updateScript = gitUpdater { rev-prefix = "v"; };
 
   extraScripts = lib.optional oscSupport "quality-menu-osc.lua";
 
   meta = with lib; {
-    description = "A userscript for MPV that allows you to change youtube video quality (ytdl-format) on the fly";
+    description = "Userscript for MPV that allows you to change youtube video quality (ytdl-format) on the fly";
     homepage = "https://github.com/christoph-heinrich/mpv-quality-menu";
     license = licenses.gpl2Only;
     maintainers = with maintainers; [ lunik1 ];
diff --git a/pkgs/applications/video/mpv/scripts/reload.nix b/pkgs/applications/video/mpv/scripts/reload.nix
index 426aabd7fe495..b9d9b4c43b05d 100644
--- a/pkgs/applications/video/mpv/scripts/reload.nix
+++ b/pkgs/applications/video/mpv/scripts/reload.nix
@@ -1,7 +1,9 @@
-{ lib
-, fetchFromGitHub
-, unstableGitUpdater
-, buildLua }:
+{
+  lib,
+  fetchFromGitHub,
+  unstableGitUpdater,
+  buildLua,
+}:
 
 buildLua rec {
   pname = "mpv-reload";
@@ -9,11 +11,11 @@ buildLua rec {
   version = "0-unstable-2024-03-22";
   src = fetchFromGitHub {
     owner = "4e6";
-    repo  = pname;
-    rev   = "1a6a9383ba1774708fddbd976e7a9b72c3eec938";
-    hash  = "sha256-BshxCjec/UNGyiC0/g1Rai2NvG2qOIHXDDEUYwwdij0=";
+    repo = pname;
+    rev = "1a6a9383ba1774708fddbd976e7a9b72c3eec938";
+    hash = "sha256-BshxCjec/UNGyiC0/g1Rai2NvG2qOIHXDDEUYwwdij0=";
   };
-  passthru.updateScript = unstableGitUpdater {};
+  passthru.updateScript = unstableGitUpdater { };
 
   meta = {
     description = "Manual & automatic reloading of videos";
diff --git a/pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix b/pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix
index bf973c9206c71..55d55fdf59f83 100644
--- a/pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix
+++ b/pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix
@@ -1,6 +1,8 @@
-{ lib, buildLua
-, fetchFromGitHub
-, gitUpdater
+{
+  lib,
+  buildLua,
+  fetchFromGitHub,
+  gitUpdater,
 }:
 buildLua rec {
   pname = "simple-mpv-ui";
@@ -11,19 +13,23 @@ buildLua rec {
     repo = "simple-mpv-webui";
     rev = "v${version}";
     hash = "sha256-I8lwpo3Hfpy3UnPMmHEJCdArVQnNL245NkxsYVmnMF0=";
-    sparseCheckout = [ "main.lua" "webui-page" ];
-  };
-  passthru.updateScript = gitUpdater {
-    rev-prefix = "v";
+    sparseCheckout = [
+      "main.lua"
+      "webui-page"
+    ];
   };
+  passthru.updateScript = gitUpdater { rev-prefix = "v"; };
 
   scriptPath = ".";
   passthru.scriptName = "webui";
 
   meta = with lib; {
-    description = "A web based user interface with controls for the mpv mediaplayer";
+    description = "Web based user interface with controls for the mpv mediaplayer";
     homepage = "https://github.com/open-dynaMIX/simple-mpv-webui";
-    maintainers = with maintainers; [ cript0nauta zopieux ];
+    maintainers = with maintainers; [
+      cript0nauta
+      zopieux
+    ];
     longDescription = ''
       You can access the webui when accessing http://127.0.0.1:8080 or
       http://[::1]:8080 in your webbrowser. By default it listens on
diff --git a/pkgs/applications/video/mpv/scripts/sponsorblock-minimal.nix b/pkgs/applications/video/mpv/scripts/sponsorblock-minimal.nix
index 2557db8313d6d..6818154590917 100644
--- a/pkgs/applications/video/mpv/scripts/sponsorblock-minimal.nix
+++ b/pkgs/applications/video/mpv/scripts/sponsorblock-minimal.nix
@@ -1,4 +1,11 @@
-{ lib, buildLua, fetchFromGitea, unstableGitUpdater, curl, coreutils }:
+{
+  lib,
+  buildLua,
+  fetchFromGitea,
+  unstableGitUpdater,
+  curl,
+  coreutils,
+}:
 
 buildLua {
   pname = "mpv_sponsorblock_minimal";
@@ -21,8 +28,7 @@ buildLua {
   '';
 
   meta = with lib; {
-    description =
-      "A minimal script to skip sponsored segments of YouTube videos";
+    description = "Minimal script to skip sponsored segments of YouTube videos";
     homepage = "https://codeberg.org/jouni/mpv_sponsorblock_minimal";
     license = licenses.gpl3Only;
     platforms = platforms.all;
diff --git a/pkgs/applications/video/mpv/scripts/sponsorblock.nix b/pkgs/applications/video/mpv/scripts/sponsorblock.nix
index 56ac2575ecdea..16e8841abf5b6 100644
--- a/pkgs/applications/video/mpv/scripts/sponsorblock.nix
+++ b/pkgs/applications/video/mpv/scripts/sponsorblock.nix
@@ -1,4 +1,11 @@
-{ lib, buildLua, fetchFromGitHub, fetchpatch, python3, nix-update-script }:
+{
+  lib,
+  buildLua,
+  fetchFromGitHub,
+  fetchpatch,
+  python3,
+  nix-update-script,
+}:
 
 # Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.sponsorblock ]; }`
 buildLua {
@@ -28,15 +35,13 @@ buildLua {
 
   postPatch = ''
     substituteInPlace sponsorblock.lua \
-      --replace "python3" "${python3}/bin/python3" \
-      --replace 'mp.find_config_file("scripts")' "\"$out/share/mpv/scripts\""
+      --replace-fail "python3" "${lib.getExe python3}" \
+      --replace-fail 'mp.find_config_file("scripts")' "\"$out/share/mpv/scripts\""
   '';
 
   extraScripts = [ "sponsorblock_shared" ];
 
-  passthru.updateScript = nix-update-script {
-    extraArgs = [ "--version=branch" ];
-  };
+  passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; };
 
   meta = with lib; {
     description = "Script for mpv to skip sponsored segments of YouTube videos";
diff --git a/pkgs/applications/video/mpv/scripts/thumbfast.nix b/pkgs/applications/video/mpv/scripts/thumbfast.nix
index e30c62774b759..158e1f38b32b3 100644
--- a/pkgs/applications/video/mpv/scripts/thumbfast.nix
+++ b/pkgs/applications/video/mpv/scripts/thumbfast.nix
@@ -1,4 +1,10 @@
-{ lib, fetchFromGitHub, unstableGitUpdater, buildLua, mpv-unwrapped }:
+{
+  lib,
+  fetchFromGitHub,
+  unstableGitUpdater,
+  buildLua,
+  mpv-unwrapped,
+}:
 
 buildLua {
   pname = "mpv-thumbfast";
@@ -10,10 +16,13 @@ buildLua {
     rev = "03e93feee5a85bf7c65db953ada41b4826e9f905";
     hash = "sha256-5u5WBvWOEydJrnr/vilEgW4+fxkxM6wNjb9Fyyxx/1c=";
   };
-  passthru.updateScript = unstableGitUpdater {};
+  passthru.updateScript = unstableGitUpdater { };
 
   passthru.extraWrapperArgs = [
-    "--prefix" "PATH" ":" "${lib.getBin mpv-unwrapped}/bin"
+    "--prefix"
+    "PATH"
+    ":"
+    (lib.makeBinPath [ mpv-unwrapped ])
   ];
 
   meta = {
diff --git a/pkgs/applications/video/mpv/scripts/thumbnail.nix b/pkgs/applications/video/mpv/scripts/thumbnail.nix
index 40c4fa8776d84..fc37b1a50dea8 100644
--- a/pkgs/applications/video/mpv/scripts/thumbnail.nix
+++ b/pkgs/applications/video/mpv/scripts/thumbnail.nix
@@ -1,16 +1,22 @@
-{ lib, buildLua, fetchFromGitHub, gitUpdater, python3 }:
+{
+  lib,
+  buildLua,
+  fetchFromGitHub,
+  gitUpdater,
+  python3,
+}:
 
 buildLua rec {
   pname = "mpv-thumbnail-script";
-  version = "0.5.3";
+  version = "0.5.4";
 
   src = fetchFromGitHub {
     owner = "marzzzello";
     repo = "mpv_thumbnail_script";
     rev = version;
-    sha256 = "sha256-J24Rou7BTE7zoiPlBkWuO9dtYJiuzkuwB4FROuzXzag=";
+    sha256 = "sha256-nflavx25skLj9kitneL6Uz3zI2DyMMhQC595npofzbQ=";
   };
-  passthru.updateScript = gitUpdater {};
+  passthru.updateScript = gitUpdater { };
 
   nativeBuildInputs = [ python3 ];
   postPatch = "patchShebangs concat_files.py";
@@ -21,7 +27,7 @@ buildLua rec {
   passthru.scriptName = "mpv_thumbnail_script_{client_osc,server}.lua";
 
   meta = with lib; {
-    description = "A lua script to show preview thumbnails in mpv's OSC seekbar";
+    description = "Lua script to show preview thumbnails in mpv's OSC seekbar";
     homepage = "https://github.com/marzzzello/mpv_thumbnail_script";
     changelog = "https://github.com/marzzzello/mpv_thumbnail_script/releases/tag/${version}";
     license = licenses.gpl3Plus;
diff --git a/pkgs/applications/video/mpv/scripts/uosc.nix b/pkgs/applications/video/mpv/scripts/uosc.nix
index 61eb65f9bf9f3..45b359a42a83d 100644
--- a/pkgs/applications/video/mpv/scripts/uosc.nix
+++ b/pkgs/applications/video/mpv/scripts/uosc.nix
@@ -1,10 +1,10 @@
-{ lib
-, fetchFromGitHub
-, fetchpatch
-, gitUpdater
-, makeFontsConf
-, buildLua
-, buildGoModule
+{
+  lib,
+  fetchFromGitHub,
+  gitUpdater,
+  makeFontsConf,
+  buildLua,
+  buildGoModule,
 }:
 
 buildLua (finalAttrs: {
@@ -18,7 +18,7 @@ buildLua (finalAttrs: {
     rev = finalAttrs.version;
     hash = "sha256-0GPDna9uOuhFDhA9A1fbkoKkgSB76qiDzJVQ9gjGcWo=";
   };
-  passthru.updateScript = gitUpdater {};
+  passthru.updateScript = gitUpdater { };
 
   tools = buildGoModule {
     pname = "uosc-bin";
diff --git a/pkgs/applications/video/mpv/scripts/videoclip.nix b/pkgs/applications/video/mpv/scripts/videoclip.nix
index fff5b788b0286..82f912677f14c 100644
--- a/pkgs/applications/video/mpv/scripts/videoclip.nix
+++ b/pkgs/applications/video/mpv/scripts/videoclip.nix
@@ -1,30 +1,33 @@
-{ lib
-, fetchFromGitHub
-, curl
-, xclip
-, wl-clipboard
-, stdenv
-, buildLua
-, unstableGitUpdater
+{
+  lib,
+  fetchFromGitHub,
+  curl,
+  xclip,
+  wl-clipboard,
+  stdenv,
+  buildLua,
+  unstableGitUpdater,
 }:
 buildLua {
   pname = "videoclip";
-  version = "0-unstable-2024-03-08";
+  version = "0-unstable-2024-05-26";
 
   src = fetchFromGitHub {
     owner = "Ajatt-Tools";
     repo = "videoclip";
-    rev = "0e3f2245b03e888c14c093a50261e0f54ecdf8e8";
-    hash = "sha256-Sg6LHU9OVmVx3cTs8Y0WL8wACb5BlVyeBRccoX+7BXY=";
+    rev = "4fd40d66c95905ed828ca77b7120732014b93ac5";
+    hash = "sha256-Q40a7BBY4c7I5g9HkeV6Twv/PDPBDKTlnxkILw99pxU=";
   };
 
-  patchPhase = ''
-    substituteInPlace platform.lua \
-    --replace \'curl\' \'${lib.getExe curl}\' \
-  '' + lib.optionalString stdenv.isLinux ''
-    --replace xclip ${lib.getExe xclip} \
-    --replace wl-copy ${lib.getExe' wl-clipboard "wl-copy"}
-  '';
+  patchPhase =
+    ''
+      substituteInPlace platform.lua \
+      --replace \'curl\' \'${lib.getExe curl}\' \
+    ''
+    + lib.optionalString stdenv.isLinux ''
+      --replace xclip ${lib.getExe xclip} \
+      --replace wl-copy ${lib.getExe' wl-clipboard "wl-copy"}
+    '';
 
   scriptPath = ".";
   passthru.scriptName = "videoclip";
diff --git a/pkgs/applications/video/mpv/scripts/visualizer.nix b/pkgs/applications/video/mpv/scripts/visualizer.nix
index 332604286847a..0308e6477d79f 100644
--- a/pkgs/applications/video/mpv/scripts/visualizer.nix
+++ b/pkgs/applications/video/mpv/scripts/visualizer.nix
@@ -14,11 +14,11 @@ buildLua {
     rev = "b4246984ba6dc6820adef5c8bbf793af85c9ab8e";
     sha256 = "ZNUzw4OW7z+yGTxim7CCWJdWmihDFOQAQk3bC5Ijcbs=";
   };
-  passthru.updateScript = unstableGitUpdater {};
+  passthru.updateScript = unstableGitUpdater { };
 
   meta = with lib; {
     description = "various audio visualization";
     homepage = "https://github.com/mfcc64/mpv-scripts";
-    maintainers = with maintainers; [kmein];
+    maintainers = with maintainers; [ kmein ];
   };
 }
diff --git a/pkgs/applications/video/mpv/scripts/vr-reversal.nix b/pkgs/applications/video/mpv/scripts/vr-reversal.nix
index 9a7b335a6591d..6fb91e9ad780a 100644
--- a/pkgs/applications/video/mpv/scripts/vr-reversal.nix
+++ b/pkgs/applications/video/mpv/scripts/vr-reversal.nix
@@ -1,4 +1,10 @@
-{ lib, stdenvNoCC, fetchFromGitHub, gitUpdater, ffmpeg }:
+{
+  lib,
+  stdenvNoCC,
+  fetchFromGitHub,
+  gitUpdater,
+  ffmpeg,
+}:
 
 stdenvNoCC.mkDerivation rec {
   pname = "vr-reversal";
@@ -10,15 +16,13 @@ stdenvNoCC.mkDerivation rec {
     rev = "v${version}";
     sha256 = "1wn2ngcvn7wcsl3kmj782x5q9130qw951lj6ilrkafp6q6zscpqr";
   };
-  passthru.updateScript = gitUpdater {
-    rev-prefix = "v";
-  };
+  passthru.updateScript = gitUpdater { rev-prefix = "v"; };
 
   dontBuild = true;
 
   # reset_rot is only available in ffmpeg 5.0, see 5bcc61ce87922ecccaaa0bd303a7e195929859a8
   postPatch = lib.optionalString (lib.versionOlder ffmpeg.version "5.0") ''
-    substituteInPlace 360plugin.lua --replace ":reset_rot=1:" ":"
+    substituteInPlace 360plugin.lua --replace-fail ":reset_rot=1:" ":"
   '';
 
   installPhase = ''
@@ -29,7 +33,7 @@ stdenvNoCC.mkDerivation rec {
   passthru.scriptName = "360plugin.lua";
 
   meta = with lib; {
-    description = "Script for mpv to play VR video with optional saving of head tracking data.";
+    description = "Script for mpv to play VR video with optional saving of head tracking data";
     homepage = "https://github.com/dfaker/VR-reversal";
     license = licenses.unlicense;
     platforms = platforms.all;
diff --git a/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix b/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix
index 10fe3d0cdce03..b423281a3ba38 100644
--- a/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix
+++ b/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix
@@ -1,4 +1,11 @@
-{ lib, buildNpmPackage, fetchFromGitHub, gitUpdater, nodejs, python3 }:
+{
+  lib,
+  buildNpmPackage,
+  fetchFromGitHub,
+  gitUpdater,
+  nodejs,
+  python3,
+}:
 
 buildNpmPackage rec {
   pname = "webtorrent-mpv-hook";
@@ -10,14 +17,12 @@ buildNpmPackage rec {
     rev = "v${version}";
     hash = "sha256-/dMtXcIyfAs++Zgz2CxRW0tkzn5QjS+WVGChlCyrU0U=";
   };
-  passthru.updateScript = gitUpdater {
-    rev-prefix = "v";
-  };
+  passthru.updateScript = gitUpdater { rev-prefix = "v"; };
 
   postPatch = ''
-    substituteInPlace src/webtorrent.ts --replace "node_path: 'node'" "node_path: '${nodejs}/bin/node'"
+    substituteInPlace src/webtorrent.ts --replace-fail "node_path: 'node'" "node_path: '${lib.getExe nodejs}'"
     # This executable is just for telling non-Nix users how to install
-    substituteInPlace package.json --replace '"bin": "build/bin.mjs",' ""
+    substituteInPlace package.json --replace-fail '"bin": "build/bin.mjs",' ""
     rm -rf src/bin.ts
   '';
 
diff --git a/pkgs/applications/video/mpv/scripts/youtube-upnext.nix b/pkgs/applications/video/mpv/scripts/youtube-upnext.nix
index cdd7ea66a1763..ecd71353d6a3b 100644
--- a/pkgs/applications/video/mpv/scripts/youtube-upnext.nix
+++ b/pkgs/applications/video/mpv/scripts/youtube-upnext.nix
@@ -1,4 +1,10 @@
-{ buildLua, fetchFromGitHub, curl, unstableGitUpdater, lib }:
+{
+  buildLua,
+  fetchFromGitHub,
+  curl,
+  unstableGitUpdater,
+  lib,
+}:
 
 buildLua rec {
   pname = "youtube-upnext";
@@ -13,13 +19,13 @@ buildLua rec {
 
   postPatch = ''
     substituteInPlace youtube-upnext.lua \
-      --replace '"curl"' '"${lib.getExe curl}"'
+      --replace-fail '"curl"' '"${lib.getExe curl}"'
   '';
 
   passthru.updateScript = unstableGitUpdater { };
 
   meta = with lib; {
-    description = "A userscript that allows you to play 'up next'/recommended youtube videos";
+    description = "Userscript that allows you to play 'up next'/recommended youtube videos";
     homepage = "https://github.com/cvzi/mpv-youtube-upnext";
     maintainers = with maintainers; [ bddvlpr ];
     license = licenses.unfree;