diff --git a/config.sh b/config.sh
index 0ea4b88..5f59400 100644
--- a/config.sh
+++ b/config.sh
@@ -1 +1,2 @@
-cfg[title]='BashTube'
\ No newline at end of file
+cfg[title]='BashTube'
+cfg[_cookies]='cookiejar'
diff --git a/webroot/fav.shs b/webroot/fav.shs
index e5550f5..e3c7d7f 100644
--- a/webroot/fav.shs
+++ b/webroot/fav.shs
@@ -1,7 +1,7 @@
#!/bin/bash
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]}")
+ title=$(haruhi-dl --cookies ${cfg[_cookies]} -e "https://youtube.com/watch?v=${get_data[v]}")
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
diff --git a/webroot/playlist.shs b/webroot/playlist.shs
index d948872..3c53c75 100644
--- a/webroot/playlist.shs
+++ b/webroot/playlist.shs
@@ -4,7 +4,7 @@ meta[title]="$title"
source templates/head.sh
if [[ "${get_data[list]}" ]]; then
- data=$(haruhi-dl $([[ ${cfg[_cookies]} != "" ]] && echo -n -- "-c ${cfg[_cookies]}") -j --flat-playlist "https://www.youtube.com/playlist?list=${get_data[list]}")
+ data=$(haruhi-dl --cookies ${cfg[_cookies]} -j --flat-playlist "https://www.youtube.com/playlist?list=${get_data[list]}")
else
echo "Please specify id"
return
diff --git a/webroot/watch.shs b/webroot/watch.shs
index 82fbaad..36e132c 100755
--- a/webroot/watch.shs
+++ b/webroot/watch.shs
@@ -9,9 +9,9 @@ if [[ "${get_data[v]}" ]]; then
source templates/head.sh
else
cd temp
- video=$(haruhi-dl --write-pages $([[ ${cfg[_cookies]} != "" ]] && echo -n -- "-c ${cfg[_cookies]}") -J "http://youtube.com/watch?v=${get_data[v]}")
+ video=$(haruhi-dl --write-pages --cookies ${cfg[_cookies]} -J "http://youtube.com/watch?v=${get_data[v]}")
if [[ $video == '' ]]; then # okay who did this
- video=$(haruhi-dl --write-pages $([[ ${cfg[_cookies]} != "" ]] && echo -n -- "-c ${cfg[_cookies]}") -J "http://youtube.com/watch?v=${get_data[v]}")
+ video=$(haruhi-dl --write-pages --cookies ${cfg[_cookies]} -J "http://youtube.com/watch?v=${get_data[v]}")
if [[ $video == '' ]]; then # seriously WHO DID THIS
return
fi
@@ -69,24 +69,27 @@ if [[ "${get_data[v]}" ]]; then
Description:
$(echo "$video" | jq -r '.description' | sed -E 's/$/
/g')
";
- vid="$(cat "temp/${get_data[v]}_https_-_"*"watch"*".dump" | tr -d '\n' | grep -Poh "ytInitialData.*?" | sed 's/ytInitialData = //;s/<\/script>//')"
-
+ vid="$(cat "temp/${get_data[v]}_https_-_"*"watch"*".dump")"
+ vid_json="$(tr -d '\n' <<< "$vid" | grep -Poh "ytInitialData.*?" | sed 's/ytInitialData = //;s/<\/script>//')"
echo "