4 ms·
For anyone who finds this, here's a much faster ytsearch: ytsearch ======== #! /bin/bash nresults=$1; shift query="$@" yt-dlp -j --flat-playlist
by kmstout 4y ago
For anyone who finds this, here's a much faster ytsearch:
ytsearch
========
#! /bin/bash
nresults=$1; shift
query="$@"
yt-dlp -j --flat-playlist ytsearch${nresults}:"${query// /+}"
I now also have
ytgetlist
=========
#! /bin/bash
yt-dlp -j --flat-playlist "$@"
which is handy for listing entire channels. The downside of using --flat-playlist is that the upload_date ends up null, so `ytplaylist` is modified to cope:
ytplaylist
==========
#! /bin/bash
jq -r '"\(.upload_date // .playlist_index) \(.id) \(.duration)\t\(.title)"' "$@" \
| sort -k1n | uniq \
| fzf --bind "enter:execute(ytplay {+2})"
The playlist indices so far reflect the order one would get by sorting on upload date.