stockholm/lass/5pkgs/yt-next/default.nix

14 lines
227 B
Nix
Raw Normal View History

2016-03-19 21:01:16 +00:00
{ 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,'
''