diff --git a/webroot/yt/channel.shs b/webroot/yt/channel.shs index cd9d3fe..71e78bb 100644 --- a/webroot/yt/channel.shs +++ b/webroot/yt/channel.shs @@ -4,9 +4,9 @@ meta[title]=$title source templates/head.sh 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 - 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 echo "Please specify either id or name" return diff --git a/webroot/yt/fav.shs b/webroot/yt/fav.shs index a09fc56..e3db23a 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=$(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 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 10fe96a..d210b15 100644 --- a/webroot/yt/playlist.shs +++ b/webroot/yt/playlist.shs @@ -4,9 +4,9 @@ meta[title]=$title source templates/head.sh 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 - echo "Please specify either `id`" + echo "Please specify id" return fi diff --git a/webroot/yt/watch.shs b/webroot/yt/watch.shs index a533b15..91bf515 100755 --- a/webroot/yt/watch.shs +++ b/webroot/yt/watch.shs @@ -14,9 +14,9 @@ if [[ ${get_data[v]} ]]; then meta[title]=$title source templates/head.sh 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 - 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 return fi @@ -74,7 +74,7 @@ if [[ ${get_data[v]} ]]; 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' video_title=($(jq -r '.title' <<< $playlist))