summaryrefslogtreecommitdiffstats
path: root/lass/5pkgs/yt-next/default.nix
diff options
context:
space:
mode:
authormakefu <makefu@nixos.dev>2016-05-02 16:08:30 +0200
committermakefu <makefu@nixos.dev>2016-05-02 16:08:30 +0200
commit64aa4f6912fb7425d8063e5d143f59c43fb31b8f (patch)
tree07fe7c386d32bd5e1375a7d01f623cd357a1d09d /lass/5pkgs/yt-next/default.nix
parent3f77b6c89f4a3a28d62e9117712481489ac56fa1 (diff)
parent6f4bc4b34c3cbac56f6a23740dca566980823990 (diff)
Merge branch 'master' of gum:stockholm
Diffstat (limited to 'lass/5pkgs/yt-next/default.nix')
-rw-r--r--lass/5pkgs/yt-next/default.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/lass/5pkgs/yt-next/default.nix b/lass/5pkgs/yt-next/default.nix
new file mode 100644
index 000000000..8132b4f05
--- /dev/null
+++ b/lass/5pkgs/yt-next/default.nix
@@ -0,0 +1,13 @@
+{ pkgs, ... }:
+
+pkgs.writeScriptBin "yt-next" ''
+ #! ${pkgs.bash}/bin/bash
+
+ vid=$1
+ num=''${NUM:-1}
+
+ curl -Ls $1 \
+ | grep 'href="/watch?v=' \
+ | head -n$num \
+ | sed 's,.*href="\([^"]*\)".*,https://youtube.com\1,'
+''