about summary refs log tree commit diff stats
path: root/pkgs/by-name/yt
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--pkgs/by-name/yt/yt/package.nix22
-rw-r--r--pkgs/by-name/yt/yti/package.nix17
-rwxr-xr-xpkgs/by-name/yt/yti/yti.sh33
3 files changed, 9 insertions, 63 deletions
diff --git a/pkgs/by-name/yt/yt/package.nix b/pkgs/by-name/yt/yt/package.nix
index 90a70473..3c780374 100644
--- a/pkgs/by-name/yt/yt/package.nix
+++ b/pkgs/by-name/yt/yt/package.nix
@@ -10,18 +10,18 @@
   python3,
   rustPlatform,
   sqlite,
-  blake3,
+  fd,
 }: let
-  version = "1.4.1";
+  version = "1.5.0";
 
   src = fetchgit {
     url = "https://git.foss-syndicate.org/bpeetz/clients/yt";
     rev = "v${version}";
-    hash = "sha256-Zuc3hrhvYdz2ktQhfMcLX7E5W/ZneMMLJ6+CoJ/JZMs=";
+    hash = "sha256-P/mpF2KPjoC7XZ6juJubeGEHhL2ajdOeiuIEb5sYrS0=";
   };
 
   buildInputs = [
-    (python3.withPackages (ps: [ps.yt-dlp blake3]))
+    (python3.withPackages (ps: [ps.yt-dlp]))
     mpv-unwrapped.dev
     ffmpeg
   ];
@@ -33,6 +33,7 @@ in
     nativeBuildInputs = [
       makeWrapper
       sqlite
+      fd
     ];
 
     passthru.updateScript = gitUpdater {rev-prefix = "v";};
@@ -46,7 +47,7 @@ in
       PYO3_PYTHON = lib.getExe (python3.withPackages (ps: [ps.yt-dlp]));
 
       C_INCLUDE_PATH = "${glibc.dev}/include";
-      DATABASE_URL = "sqlite://target/database.sqlite";
+      DATABASE_URL = "sqlite://target/database.sqlx";
       LIBCLANG_INCLUDE_PATH = "${llvmPackages_latest.clang-unwrapped.lib}/lib/clang/${clang_version}/include";
       LIBCLANG_PATH = "${llvmPackages_latest.clang-unwrapped.lib}/lib/libclang.so";
     };
@@ -55,19 +56,14 @@ in
     doCheck = false;
 
     prePatch = ''
-      echo "$PATH"
       bash ./scripts/mkdb.sh
     '';
 
-    cargoHash = "sha256-QIAZb8twLxLm3TJOtb++pTWz98v49pt13auAEAeYFSk=";
-
-    postBuild = ''
-      install -m755 ./python_update/raw_update.py -D "$out/bin/raw_update.py"
-      patchShebangs "$out/bin/raw_update.py"
-    '';
+    useFetchCargoVendor = true;
+    cargoHash = "sha256-0XTbC+mFsczUFXqAtiQ+BIsCfKilerhlzE41pzVjLVs=";
 
     postInstall = ''
       wrapProgram $out/bin/yt \
-        --prefix PATH : ${lib.makeBinPath buildInputs}:$out/bin
+        --prefix PATH : ${lib.makeBinPath buildInputs}
     '';
   }
diff --git a/pkgs/by-name/yt/yti/package.nix b/pkgs/by-name/yt/yti/package.nix
deleted file mode 100644
index 5a39512a..00000000
--- a/pkgs/by-name/yt/yti/package.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{
-  sysLib,
-  gawk,
-  expect,
-  yt-dlp,
-}:
-sysLib.writeShellScript {
-  name = "yti";
-  src = ./yti.sh;
-  generateCompletions = false;
-  keepPath = false;
-  dependencies = [
-    gawk
-    expect
-    yt-dlp
-  ];
-}
diff --git a/pkgs/by-name/yt/yti/yti.sh b/pkgs/by-name/yt/yti/yti.sh
deleted file mode 100755
index a69ffa74..00000000
--- a/pkgs/by-name/yt/yti/yti.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#! /usr/bin/env dash
-
-# shellcheck source=/dev/null
-SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH
-
-DOWN_DIR=/home/soispha/media/music/down/youtube
-
-tmp=$(mktmp)
-config=$(mktmp)
-
-for e in "$DOWN_DIR"/*.opus; do echo "$e" >>"$tmp"; done
-[ "$(wc -l "$tmp" | awk '{print $1}')" -gt 2 ] && die "something is already downloaded"
-
-cat <<EO >"$config"
---paths home:"$DOWN_DIR"
-#--output %(fulltitle)
---restrict-filenames
---no-overwrites
---no-write-info-json
---clean-info-json
---prefer-free-formats
-#--format mp3
---extract-audio
---audio-quality 0
---audio-format best
-EO
-
-rm "$DOWN_DIR/yt-dlp.log"
-cd "$DOWN_DIR" || die "BUG: no $DOWN_DIR"
-
-unbuffer yt-dlp --config-location "$config" "$1" | tee "$DOWN_DIR/yt-dlp.log"
-
-# vim: ft=sh