adding old changes

This commit is contained in:
Dominika Liberda 2020-12-29 03:04:44 +01:00
parent 7f199e8b8f
commit 46072b54bc
4 changed files with 8 additions and 8 deletions

View file

@ -4,9 +4,9 @@ meta[title]=$title
source templates/head.sh source templates/head.sh
if [[ ${get_data[id]} ]]; then if [[ ${get_data[id]} ]]; then
data=$(haruhi-dl -j --flat-playlist https://www.youtube.com/channel/${get_data[id]}) data=$(haruhi-dl $([[ ${cfg[_cookies]} != "" ]] && echo -n -- "-c ${cfg[_cookies]}") -j --flat-playlist https://www.youtube.com/channel/${get_data[id]})
elif [[ ${get_data[name]} ]]; then elif [[ ${get_data[name]} ]]; then
data=$(haruhi-dl -j --flat-playlist https://www.youtube.com/user/${get_data[name]}) data=$(haruhi-dl $([[ ${cfg[_cookies]} != "" ]] && echo -n -- "-c ${cfg[_cookies]}") -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

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=$(haruhi-dl -e "https://youtube.com/watch?v=${get_data[v]}") title=$(haruhi-dl $([[ ${cfg[_cookies]} != "" ]] && echo -n -- "-c ${cfg[_cookies]}") -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,9 +4,9 @@ meta[title]=$title
source templates/head.sh source templates/head.sh
if [[ ${get_data[id]} ]]; then if [[ ${get_data[id]} ]]; then
data=$(haruhi-dl -j --flat-playlist https://www.youtube.com/playlist?list=${get_data[id]}) data=$(haruhi-dl $([[ ${cfg[_cookies]} != "" ]] && echo -n -- "-c ${cfg[_cookies]}") -j --flat-playlist https://www.youtube.com/playlist?list=${get_data[id]})
else else
echo "Please specify either `id`" echo "Please specify id"
return return
fi fi

View file

@ -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=$(haruhi-dl -J "http://youtube.com/watch?v=${get_data[v]}") video=$(haruhi-dl $([[ ${cfg[_cookies]} != "" ]] && echo -n -- "-c ${cfg[_cookies]}") -J "http://youtube.com/watch?v=${get_data[v]}")
if [[ $video == '' ]]; then if [[ $video == '' ]]; then
video=$(haruhi-dl -J "http://youtube.com/watch?v=${get_data[v]}") video=$(haruhi-dl $([[ ${cfg[_cookies]} != "" ]] && echo -n -- "-c ${cfg[_cookies]}") -J "http://youtube.com/watch?v=${get_data[v]}")
if [[ $video == '' ]]; then if [[ $video == '' ]]; then
return return
fi fi
@ -74,7 +74,7 @@ if [[ ${get_data[v]} ]]; then
</div>"; </div>";
if [[ ${get_data[playlist]} ]]; then if [[ ${get_data[playlist]} ]]; then
playlist=$(haruhi-dl -j --flat-playlist https://www.youtube.com/playlist?list=${get_data[playlist]}) playlist=$(haruhi-dl $([[ ${cfg[_cookies]} != "" ]] && echo -n -- "-c ${cfg[_cookies]}") -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))