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.
This commit is contained in:
parent
2839b8e2bc
commit
c619f884bd
1 changed files with 2 additions and 3 deletions
|
@ -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/<script[^>]*>/\n/g' -e 's/<\/script>/\n/g' | grep 'ytInitialData' | head -n 1 | grep -o '{.*}'
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue