* fixed broken channel page
parent
9f6a8c15f6
commit
92e57c46c7
|
@ -28,8 +28,9 @@ IFS=$'\n'
|
||||||
video_title=($(jq -r '.entries[].title' <<< $data))
|
video_title=($(jq -r '.entries[].title' <<< $data))
|
||||||
video_id=($(jq -r '.entries[].id' <<< $data))
|
video_id=($(jq -r '.entries[].id' <<< $data))
|
||||||
|
|
||||||
strings[subscribe]="<h1>$title</h1><a href='subscribe.shs?id=$(html_encode "${get_data[id]}")'>Subscribe!</a><br>"
|
#strings[subscribe]="<h1>$title</h1><a href='subscribe.shs?id=$(html_encode "${get_data[id]}")'>Subscribe!</a><br>"
|
||||||
|
strings[subscribe]='<h1>'"$(html_encode "$title")'s channel"'</h1>'
|
||||||
|
echo uwu > /dev/stderr
|
||||||
for (( i=0; i<${#video_id[@]}; i++ )); do
|
for (( i=0; i<${#video_id[@]}; i++ )); do
|
||||||
strings[videos]+="<a href='/watch?v=${video_id[$i]}'><img src='http://i.ytimg.com/vi/${video_id[$i]}/mqdefault.jpg'><br>${video_title[$i]}</a><br>"
|
strings[videos]+="<a href='/watch?v=${video_id[$i]}'><img src='http://i.ytimg.com/vi/${video_id[$i]}/mqdefault.jpg'><br>${video_title[$i]}</a><br>"
|
||||||
done
|
done
|
||||||
|
|
|
@ -39,17 +39,18 @@ if [[ "${get_data[v]}" ]]; then
|
||||||
source templates/head.sh
|
source templates/head.sh
|
||||||
fi
|
fi
|
||||||
else
|
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 --ie-key Youtube --write-pages --cookies "${cfg[_cookies]}" -J "http://youtube.com/watch?v=${get_data[v]}")
|
||||||
if [[ $video == '' ]]; then # okay who did this
|
if [[ $video == '' ]]; then # okay who did this
|
||||||
random_hash=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 24 | head -n 1)
|
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]}" 2> temp/output$random_hash.log)
|
video=$(haruhi-dl --ie-key Youtube --write-pages --cookies ${cfg[_cookies]} -J "http://youtube.com/watch?v=${get_data[v]}" 2> output$random_hash.log)
|
||||||
if [[ $video == '' ]]; then # seriously WHO DID THIS
|
if [[ $video == '' ]]; then # seriously WHO DID THIS
|
||||||
if [[ "${cfg[regionlock_proxy]}" == true ]]; then
|
if [[ "${cfg[regionlock_proxy]}" == true ]]; then
|
||||||
# retrying w/ proxy!
|
# retrying w/ proxy!
|
||||||
video=$(haruhi-dl --ie-key Youtube --write-pages --cookies ${cfg[_cookies]} --proxy "${cfg[regionlock_proxy_url]}" -J "http://youtube.com/watch?v=${get_data[v]}" 2> temp/output$random_hash.log)
|
video=$(haruhi-dl --ie-key Youtube --write-pages --cookies ${cfg[_cookies]} --proxy "${cfg[regionlock_proxy_url]}" -J "http://youtube.com/watch?v=${get_data[v]}" 2> output$random_hash.log)
|
||||||
fi
|
fi
|
||||||
output=$(cat temp/output$random_hash.log)
|
output=$(cat output$random_hash.log)
|
||||||
rm temp/output$random_hash.log
|
rm output$random_hash.log
|
||||||
if [[ $video == '' ]]; then
|
if [[ $video == '' ]]; then
|
||||||
if [[ $output == 'ERROR: Video unavailable' ]]; then
|
if [[ $output == 'ERROR: Video unavailable' ]]; then
|
||||||
strings[error]='Video unavailable'
|
strings[error]='Video unavailable'
|
||||||
|
@ -58,6 +59,7 @@ if [[ "${get_data[v]}" ]]; then
|
||||||
else
|
else
|
||||||
strings[error]='Unexpected error has occured'
|
strings[error]='Unexpected error has occured'
|
||||||
fi
|
fi
|
||||||
|
cd ..
|
||||||
source templates/head.sh
|
source templates/head.sh
|
||||||
source "${cfg[namespace]}/templates/header.shs"
|
source "${cfg[namespace]}/templates/header.shs"
|
||||||
render strings "${cfg[namespace]}/templates/themes/${cfg[template]}/watch_error.t"
|
render strings "${cfg[namespace]}/templates/themes/${cfg[template]}/watch_error.t"
|
||||||
|
@ -65,6 +67,7 @@ if [[ "${get_data[v]}" ]]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
cd ..
|
||||||
#echo "http://youtube.com/watch?v=${get_data[v]}" > /dev/stderr
|
#echo "http://youtube.com/watch?v=${get_data[v]}" > /dev/stderr
|
||||||
strings[channel_id]=$(jq -r '.channel_url' <<< "$video" | sed -s 's/http:\/\/www.youtube.com\/channel\///')
|
strings[channel_id]=$(jq -r '.channel_url' <<< "$video" | sed -s 's/http:\/\/www.youtube.com\/channel\///')
|
||||||
strings[uploader]=$(jq -r '.uploader' <<< "$video")
|
strings[uploader]=$(jq -r '.uploader' <<< "$video")
|
||||||
|
|
Loading…
Reference in New Issue