minor changes, youtube-dl -> haruhi-dl

merge-requests/5/head
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
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

View File

@ -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

View File

@ -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

View File

@ -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/ <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
fi
fi

View File

@ -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))