Compare commits

..

No commits in common. "6b43d9ef5fe29b7e36a99d2c04b6e5107d3ebe5d" and "3f79b9b48d5b70f65c90a02ffa175ac0959a2e8b" have entirely different histories.

4 changed files with 10 additions and 13 deletions

View file

@ -2,7 +2,6 @@
#router "/uwu" "owo"
router "/c/:c" "${cfg[namespace]}/webroot/channel.shs"
router "/channel/:id" "${cfg[namespace]}/webroot/channel.shs"
router "/user/:user" "${cfg[namespace]}/webroot/channel.shs"
router "/playlist" "${cfg[namespace]}/webroot/playlist.shs"

View file

@ -3,15 +3,13 @@
declare -A strings
if [[ "${params[id]}" ]]; then
data=$(haruhi-dl --ie-key YoutubeChannel -J --flat-playlist "https://www.youtube.com/channel/${params[id]}")
data=$(haruhi-dl -J --flat-playlist "https://www.youtube.com/channel/${params[id]}")
elif [[ "${params[user]}" ]]; then
data=$(haruhi-dl --ie-key YoutubeChannel -J --flat-playlist "https://www.youtube.com/user/${params[user]}")
elif [[ "${params[c]}" ]]; then
data=$(haruhi-dl --ie-key YoutubeChannel -J --flat-playlist "https://www.youtube.com/c/${params[c]}")
data=$(haruhi-dl -J --flat-playlist "https://www.youtube.com/user/${params[user]}")
elif [[ "${get_data[id]}" ]]; then
data=$(haruhi-dl --ie-key YoutubeChannel -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 --ie-key YoutubeChannel -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

View file

@ -13,7 +13,7 @@ if [[ "${get_data[q]}" ]]; then
fi
if [[ "${get_data[q]}" ]]; then
data=$(haruhi-dl --ie-key YoutubeSearch "ytsearch30:${get_data[q]}" --flat-playlist -J | jq '.entries[]')
data=$(haruhi-dl "ytsearch30:${get_data[q]}" --flat-playlist -J | jq '.entries[]')
IFS=$'\n'
id=($(jq -r '.id' <<< "$data"))
@ -32,7 +32,7 @@ else
strings[results]="search for something will 'ya?"
fi
if [[ ! "$(which haruhi-dl)" || $? != "0" ]]; then
if [[ ! $(which haruhi-dl) || $? != "0" ]]; then
strings[results]="Could not fetch search results"
fi

View file

@ -6,7 +6,7 @@ fi
declare -A strings
if [[ ! "$(which haruhi-dl)" ]]; then
if [[ ! $(which haruhi-dl) ]]; then
strings[error]='Could not load video'
source templates/head.sh
source "${cfg[namespace]}/templates/header.shs"
@ -28,10 +28,10 @@ if [[ "${get_data[v]}" ]]; then
fi
else
cd temp
video=$(haruhi-dl --ie-key Youtube --write-pages --cookies "${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
random_hash=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 24 | head -n 1)
video=$(haruhi-dl --ie-key Youtube --write-pages --cookies ${cfg[_cookies]} -J "http://youtube.com/watch?v=${get_data[v]}" &> output$random_hash.log)
video=$(haruhi-dl --write-pages --cookies ${cfg[_cookies]} -J "http://youtube.com/watch?v=${get_data[v]}" &> output$random_hash.log)
if [[ $video == '' ]]; then # seriously WHO DID THIS
output=$(cat output$random_hash.log)
rm output$random_hash.log
@ -147,7 +147,7 @@ if [[ "${get_data[v]}" ]]; then
strings[playlist]=""
if [[ "${get_data[playlist]}" ]]; then
playlist=$(haruhi-dl --ie-key YoutubePlaylist --cookies ${cfg[_cookies]} -j --flat-playlist "https://www.youtube.com/playlist?list=${get_data[playlist]}")
playlist=$(haruhi-dl --cookies ${cfg[_cookies]} -j --flat-playlist "https://www.youtube.com/playlist?list=${get_data[playlist]}")
IFS=$'\n'
video_title=($(jq -r '.title' <<< $playlist))