From 7f199e8b8ff16885c22c9d970e036baddafc02bd Mon Sep 17 00:00:00 2001 From: Dominika Date: Sun, 8 Nov 2020 02:51:59 +0100 Subject: [PATCH] minor changes, youtube-dl -> haruhi-dl --- webroot/yt/channel.shs | 6 +++--- webroot/yt/fav.shs | 2 +- webroot/yt/playlist.shs | 2 +- webroot/yt/subscribe.shs | 2 +- webroot/yt/watch.shs | 10 +++++----- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/webroot/yt/channel.shs b/webroot/yt/channel.shs index e5acca3..cd9d3fe 100644 --- a/webroot/yt/channel.shs +++ b/webroot/yt/channel.shs @@ -4,11 +4,11 @@ meta[title]=$title source templates/head.sh if [[ ${get_data[id]} ]]; then - data=$(youtube-dl -j --flat-playlist https://www.youtube.com/channel/${get_data[id]}) + data=$(haruhi-dl -j --flat-playlist https://www.youtube.com/channel/${get_data[id]}) elif [[ ${get_data[name]} ]]; then - data=$(youtube-dl -j --flat-playlist https://www.youtube.com/user/${get_data[name]}) + data=$(haruhi-dl -j --flat-playlist https://www.youtube.com/user/${get_data[name]}) else - echo "Please specify either `id` or `name`" + echo "Please specify either id or name" return fi diff --git a/webroot/yt/fav.shs b/webroot/yt/fav.shs index b6092c5..a09fc56 100644 --- a/webroot/yt/fav.shs +++ b/webroot/yt/fav.shs @@ -1,7 +1,7 @@ #!/bin/bash if session_verify ${cookies[sh_session]} && [[ ${get_data[v]} != '' ]]; then - title=$(youtube-dl -e "https://youtube.com/watch?v=${get_data[v]}") + title=$(haruhi-dl -e "https://youtube.com/watch?v=${get_data[v]}") if [[ $(cat storage/faves | grep -F "$title" | grep "$(echo ${cookies[username]} | sed -E "s/\r//")") == '' ]]; then echo "$(session_get_username ${cookies[sh_session]}):${get_data[v]}:$title" >> storage/faves fi diff --git a/webroot/yt/playlist.shs b/webroot/yt/playlist.shs index 5dd353a..10fe96a 100644 --- a/webroot/yt/playlist.shs +++ b/webroot/yt/playlist.shs @@ -4,7 +4,7 @@ meta[title]=$title source templates/head.sh if [[ ${get_data[id]} ]]; then - data=$(youtube-dl -j --flat-playlist https://www.youtube.com/playlist?list=${get_data[id]}) + data=$(haruhi-dl -j --flat-playlist https://www.youtube.com/playlist?list=${get_data[id]}) else echo "Please specify either `id`" return diff --git a/webroot/yt/subscribe.shs b/webroot/yt/subscribe.shs index 5021315..ba91381 100644 --- a/webroot/yt/subscribe.shs +++ b/webroot/yt/subscribe.shs @@ -2,7 +2,7 @@ if session_verify ${cookies[sh_session]} && [[ ${get_data[id]} != '' ]]; then title=$(curl https://www.youtube.com/feeds/videos.xml?channel_id=${get_data[id]} | grep title | head -n 1 | sed -s 's/ //;s/<\/title>//') - if [[ $(cat storage/subscribed | grep -F "$title" | grep "$(echo ${cookies[username]} | sed -E "s/\r//")") == '' ]]; then + if [[ $(cat storage/subscribed | grep -PF ":$title$" | grep "$(echo ${cookies[username]} | sed -E "s/\r//")") == '' ]]; then echo "$(session_get_username ${cookies[sh_session]}):${get_data[id]}:$title" >> storage/subscribed fi fi diff --git a/webroot/yt/watch.shs b/webroot/yt/watch.shs index fbdac38..a533b15 100755 --- a/webroot/yt/watch.shs +++ b/webroot/yt/watch.shs @@ -3,7 +3,7 @@ # fetching recommended disabled for speed #for i in $(curl https://www.youtube.com/watch?v=${get_data[v]} | grep -ohE "watch\?v\=[A-zaz0-9]{11}" | uniq | cut -c 9-19); do -# echo "<div><img src='http://i.ytimg.com/vi/$i/hqdefault.jpg'><br><audio src='$(youtube-dl -g -f 251 $i)' controls></audio></div>"; +# echo "<div><img src='http://i.ytimg.com/vi/$i/hqdefault.jpg'><br><audio src='$(haruhi-dl -g -f 251 $i)' controls></audio></div>"; #done if [[ ${get_data[v]} ]]; then @@ -14,9 +14,9 @@ if [[ ${get_data[v]} ]]; then meta[title]=$title source templates/head.sh else - video=$(youtube-dl -J "http://youtube.com/watch?v=${get_data[v]}") + video=$(haruhi-dl -J "http://youtube.com/watch?v=${get_data[v]}") if [[ $video == '' ]]; then - video=$(youtube-dl -J "http://youtube.com/watch?v=${get_data[v]}") + video=$(haruhi-dl -J "http://youtube.com/watch?v=${get_data[v]}") if [[ $video == '' ]]; then return fi @@ -70,11 +70,11 @@ if [[ ${get_data[v]} ]]; then echo "<br><br> </div> </div> - <span><i>Description</i>:<br>$(echo $video | jq -r '.description' | sed -E 's/$/<br>/g')</span> + <span><i>Description</i>:<br>$(echo "$video" | jq -r '.description' | sed -E 's/$/<br>/g')</span> </div>"; if [[ ${get_data[playlist]} ]]; then - playlist=$(youtube-dl -j --flat-playlist https://www.youtube.com/playlist?list=${get_data[playlist]}) + playlist=$(haruhi-dl -j --flat-playlist https://www.youtube.com/playlist?list=${get_data[playlist]}) IFS=$'\n' video_title=($(jq -r '.title' <<< $playlist))