summaryrefslogtreecommitdiffstats
path: root/lass/5pkgs/yt-next/default.nix
blob: 8132b4f05131cc504d9608e08e8360299c504bf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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,'
''