l 5: add yt-next
This commit is contained in:
parent
3883a9fce7
commit
369c21ca59
|
@ -11,5 +11,6 @@
|
|||
xmonad-lass =
|
||||
let src = pkgs.writeNixFromCabal "xmonad-lass.nix" ./xmonad-lass; in
|
||||
pkgs.haskellPackages.callPackage src {};
|
||||
yt-next = pkgs.callPackage ./yt-next/default.nix {};
|
||||
};
|
||||
}
|
||||
|
|
13
lass/5pkgs/yt-next/default.nix
Normal file
13
lass/5pkgs/yt-next/default.nix
Normal file
|
@ -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,'
|
||||
''
|
Loading…
Reference in a new issue