From adc11ba5f1d60ef664266705b8d61132f5dd46bb Mon Sep 17 00:00:00 2001 From: Celso Date: Tue, 2 Aug 2022 07:48:31 -0300 Subject: [PATCH] initial commit --- display.awk | 3 +++ select.awk | 1 + ytsearchtompv.sh | 4 ++++ 3 files changed, 8 insertions(+) create mode 100644 display.awk create mode 100644 select.awk create mode 100755 ytsearchtompv.sh 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}"