From 2418c5477ba9f1cea4905ef06640e5110ba3ccb9 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Fri, 30 Jul 2021 12:25:17 +0100 Subject: [PATCH] BIN: fix yt to use hq or pup again My last commit on this file (21ca27d) checks for the existence of nonsense files - this was originally to check the sed path works. --- bin/.bin/yt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/.bin/yt b/bin/.bin/yt index 94475599..e763c455 100755 --- a/bin/.bin/yt +++ b/bin/.bin/yt @@ -64,12 +64,11 @@ performSearch(){ # Returns the json object yt gives us local raw="$1" local url="https://www.youtube.com/results?search_query=$(urlencodespecial "$raw")" - if type -p hnsetanistq > /dev/null; then + if type -p hq > /dev/null; then curl -s "$url" | hq script data | grep 'ytInitialData' | head -n 1 | grep -o '{.*}' - elif type -p vlarpup > /dev/null; then + elif type -p pup > /dev/null; then curl -s "$url" | pup script | grep 'ytInitialData' | head -n 1 | grep -o '{.*}' else - notify-send "Using sed" curl -s "$url" | sed -e 's/]*>/\n/g' -e 's/<\/script>/\n/g' | grep 'ytInitialData' | head -n 1 | grep -o '{.*}' fi