diff --git a/webroot/yt/channel.shs b/webroot/yt/channel.shs
index 71e78bb..c4bac65 100644
--- a/webroot/yt/channel.shs
+++ b/webroot/yt/channel.shs
@@ -1,23 +1,23 @@
#!/bin/bash
-title=$(curl https://www.youtube.com/feeds/videos.xml?channel_id=${get_data[id]} | grep title | head -n 1 | sed -s 's/
//;s/<\/title>//')
-meta[title]=$title
-source templates/head.sh
-
if [[ ${get_data[id]} ]]; then
- data=$(haruhi-dl $([[ ${cfg[_cookies]} != "" ]] && echo -n -- "-c ${cfg[_cookies]}") -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=$(haruhi-dl $([[ ${cfg[_cookies]} != "" ]] && echo -n -- "-c ${cfg[_cookies]}") -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"
return
fi
+title=$(jq -r '.title' <<< $data)
+
+meta[title]="$title"
+source templates/head.sh
IFS=$'\n'
-video_title=($(jq -r '.title' <<< $data))
-video_id=($(jq -r '.id' <<< $data))
+video_title=($(jq -r '.entries[].title' <<< $data))
+video_id=($(jq -r '.entries[].id' <<< $data))
echo "$title
Subscribe!
"
for (( i=0; i<${#video_id[@]}; i++ )); do
echo "
${video_title[$i]}
"
-done
\ No newline at end of file
+done
diff --git a/webroot/yt/search.shs b/webroot/yt/search.shs
index f42ad3d..b1a86c9 100755
--- a/webroot/yt/search.shs
+++ b/webroot/yt/search.shs
@@ -6,44 +6,37 @@ source templates/head.sh
# GOOD LUCK FIXING IT WHEN GOOGLE BREAKS IT LOL
-cat webroot/yt/webarchive/search_top.htm
+#cat webroot/yt/webarchive/search_top.htm
-#echo "
-#"
+echo "
+"
if [[ ${get_data[q]} ]]; then
query=${get_data[q]}
query_nice=$(echo ${get_data[q]} | sed -s 's/+/ /g')
echo "Searching for '$query_nice'
"
- data=''
- while [[ $data == '' ]]; do
- data=$(curl -s "https://m.youtube.com/results?search_query=$query&app=m&hl=en" | sed 's//\n/g;s/><\/div>