diff --git a/templates/header.shs b/templates/header.shs
new file mode 100644
index 0000000..ed1fd05
--- /dev/null
+++ b/templates/header.shs
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+if ! session_verify "${cookies[sh_session]}"; then
+ echo "Log in | Register"
+else
+ echo "Logged in as ${cookies[username]} | Log out"
+fi
diff --git a/webroot/yt/channel.shs b/webroot/channel.shs
similarity index 100%
rename from webroot/yt/channel.shs
rename to webroot/channel.shs
diff --git a/webroot/yt/fav.shs b/webroot/fav.shs
similarity index 76%
rename from webroot/yt/fav.shs
rename to webroot/fav.shs
index e3db23a..48539d7 100644
--- a/webroot/yt/fav.shs
+++ b/webroot/fav.shs
@@ -2,7 +2,7 @@
if session_verify ${cookies[sh_session]} && [[ ${get_data[v]} != '' ]]; then
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 [[ $(grep -F "$title" storage/faves | grep "$(echo ${cookies[username]} | sed -E "s/\r//")") == '' ]]; then
echo "$(session_get_username ${cookies[sh_session]}):${get_data[v]}:$title" >> storage/faves
fi
fi
@@ -12,7 +12,7 @@ source templates/head.sh
echo "<--- back to main
Searching for '$query_nice'
" + + data=$(haruhi-dl "ytsearch30:${get_data[q]}" --flat-playlist -J | jq '.entries[]') + + IFS=$'\n' + id=($(jq -r '.id' <<< "$data")) + title=($(jq -r '.title' <<< "$data")) + runtime=($(jq -r '.duration' <<< "$data")) + views=($(jq -r '.view_count' <<< "$data")) + channel=($(jq -r '.channel' <<< "$data")) + channel_id=($(jq -r '.channel_id' <<< "$data")) + + unset IFS + + for (( i=0; i<${#id[@]}; i++ )); do + echo "Searching for '$query_nice'
" - - data=$(haruhi-dl "ytsearch30:${get_data[q]}" --flat-playlist -J | jq '.entries[]') - - IFS=$'\n' - id=($(jq -r '.id' <<< "$data")) - title=($(jq -r '.title' <<< "$data")) - runtime=($(jq -r '.duration' <<< "$data")) - views=($(jq -r '.view_count' <<< "$data")) - channel=($(jq -r '.channel' <<< "$data")) - channel_id=($(jq -r '.channel_id' <<< "$data")) - - unset IFS - - for (( i=0; i<${#id[@]}; i++ )); do - echo "