commit adc11ba5f1d60ef664266705b8d61132f5dd46bb Author: Celso Date: Tue Aug 2 07:48:31 2022 -0300 initial commit diff --git a/display.awk b/display.awk new file mode 100644 index 0000000..3db355a --- /dev/null +++ b/display.awk @@ -0,0 +1,3 @@ +BEGIN{x="nigger"; y=1} +{if(x=="nigger"){buffer=$0;x=""} +else if(NR%3==0){print y" "buffer" |duration: "$0"|";x="nigger";y=y+1}} diff --git a/select.awk b/select.awk new file mode 100644 index 0000000..2631281 --- /dev/null +++ b/select.awk @@ -0,0 +1 @@ +{if(NR==2+((x-1)*3)){print}} diff --git a/ytsearchtompv.sh b/ytsearchtompv.sh new file mode 100755 index 0000000..c25fa20 --- /dev/null +++ b/ytsearchtompv.sh @@ -0,0 +1,4 @@ +#!/bin/bash +list="$(yt-dlp ytsearch5:"${1}" --get-title --get-id --get-duration)" +id="$(awk -v x=$(awk 'BEGIN{x="nigger"; y=1}{if(x=="nigger"){buffer=$0;x=""}else if(NR%3==0){print y" "buffer" |duration: "$0"|";x="nigger";y=y+1}}' <<< ${list} | dmenu -c -l 10 -bw 3 | awk '{print $1}') '{if(NR==2+((x-1)*3)){print}}' <<< "${list}")" +mpv "https://youtube.com/watch?v=${id}"