minor changes, youtube-dl -> haruhi-dl

This commit is contained in:
Dominika 2020-11-08 02:51:59 +01:00
parent 3b8d4e7e2d
commit 7f199e8b8f
5 changed files with 11 additions and 11 deletions

View file

@ -4,11 +4,11 @@ meta[title]=$title
source templates/head.sh source templates/head.sh
if [[ ${get_data[id]} ]]; then 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 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 else
echo "Please specify either `id` or `name`" echo "Please specify either id or name"
return return
fi fi

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
if session_verify ${cookies[sh_session]} && [[ ${get_data[v]} != '' ]]; then 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 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 echo "$(session_get_username ${cookies[sh_session]}):${get_data[v]}:$title" >> storage/faves
fi fi

View file

@ -4,7 +4,7 @@ meta[title]=$title
source templates/head.sh source templates/head.sh
if [[ ${get_data[id]} ]]; then 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 else
echo "Please specify either `id`" echo "Please specify either `id`"
return return

View file

@ -2,7 +2,7 @@
if session_verify ${cookies[sh_session]} && [[ ${get_data[id]} != '' ]]; then 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/ <title>//;s/<\/title>//') title=$(curl https://www.youtube.com/feeds/videos.xml?channel_id=${get_data[id]} | grep title | head -n 1 | sed -s 's/ <title>//;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 echo "$(session_get_username ${cookies[sh_session]}):${get_data[id]}:$title" >> storage/subscribed
fi fi
fi fi

View file

@ -3,7 +3,7 @@
# fetching recommended disabled for speed # 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 #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 #done
if [[ ${get_data[v]} ]]; then if [[ ${get_data[v]} ]]; then
@ -14,9 +14,9 @@ if [[ ${get_data[v]} ]]; then
meta[title]=$title meta[title]=$title
source templates/head.sh source templates/head.sh
else 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 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 if [[ $video == '' ]]; then
return return
fi fi
@ -70,11 +70,11 @@ if [[ ${get_data[v]} ]]; then
echo "<br><br> echo "<br><br>
</div> </div>
</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>"; </div>";
if [[ ${get_data[playlist]} ]]; then 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' IFS=$'\n'
video_title=($(jq -r '.title' <<< $playlist)) video_title=($(jq -r '.title' <<< $playlist))