* unifying URL schema fixes

This commit is contained in:
Dominika Liberda 2021-06-18 14:05:15 +00:00
parent 4761a3f747
commit 8a70900512
3 changed files with 9 additions and 7 deletions

View file

@ -8,7 +8,7 @@ echo "<a href='/'><img src='/img/bashtube.png'></a><br>"
# we'll need to figure out conditional templates first tho
if ! session_verify "${cookies[sh_session]}"; then
echo "<a href='/login.shs'</a>Log in</a> | <a href='/register.shs'>Register</a>"
echo "<a href='/login.shs'>Log in</a> | <a href='/register.shs'>Register</a>"
else
echo "Logged in as ${cookies[username]} | <a href='/logout.shs'>Log out</a> | <a href='/feed.shs'>Your feed</a> | <a href='/fav.shs'>Your favourites</a>"
fi

View file

@ -1,4 +1,4 @@
<form action='/search.shs'>
<form action='/results'>
<input name='search_query' type='text' value='{{.query_nice}}'>
<input type='submit' value='Search'>
</form>

View file

@ -41,7 +41,7 @@ if [[ "${get_data[v]}" ]]; then
}
}]'
if [[ "${r[host]}" == "${cfg[flash_host]}" ]]; then
url='//f.sakamoto.pl/videoplayback_.flv'
url='http://f.sakamoto.pl/videoplayback_.flv'
fi
if [[ ${cfg[template]} == 'default' ]]; then
meta[title]="${strings[title]}"
@ -86,10 +86,12 @@ if [[ "${get_data[v]}" ]]; then
IFS=$'\n'
urls=($(jq -r '.formats[] | select(.format_id == "22" or .format_id == "18").url' <<< "$video"))
unset IFS
if [[ ${urls[1]} != '' ]]; then
url=${urls[1]}
else
url=${urls[0]}
if [[ "$url" == '' ]]; then
if [[ ${urls[1]} != '' ]]; then
url=${urls[1]}
else
url=${urls[0]}
fi
fi
strings[player]=$(source "${cfg[namespace]}/webroot/player_flash.shs")
else