stockholm/lass/5pkgs/yt-next/default.nix
2016-03-19 22:01:16 +01:00

14 lines
227 B
Nix

{ 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,'
''