From 7b3c3b87e9bb93c6b738a2c7a582f38b2929f77d Mon Sep 17 00:00:00 2001 From: Dominika Liberda Date: Sun, 29 Aug 2021 10:34:19 +0000 Subject: [PATCH] * fixed `date` usage for busybox --- routes.sh | 14 +++++++------- webroot/css/style.css | 7 +++++++ webroot/feed.shs | 12 ++++++------ 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/routes.sh b/routes.sh index 360ff5a..9babd7a 100644 --- a/routes.sh +++ b/routes.sh @@ -2,10 +2,10 @@ #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" -router "/watch" "${cfg[namespace]}/webroot/watch.shs" -router "/proxy" "${cfg[namespace]}/webroot/proxy.shs" -router "/results" "${cfg[namespace]}/webroot/search.shs" +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" +router "/watch/" "${cfg[namespace]}/webroot/watch.shs" +router "/proxy" "${cfg[namespace]}/webroot/proxy.shs" +router "/results" "${cfg[namespace]}/webroot/search.shs" diff --git a/webroot/css/style.css b/webroot/css/style.css index 2280398..f3b789a 100644 --- a/webroot/css/style.css +++ b/webroot/css/style.css @@ -19,6 +19,13 @@ pre { .hide-cursor { cursor: none; } +.video-image { + width: 320px; + height: 180px; +} +.video-image-container { + width: 320px; +} /* Unimplemented buttons */ .ytp-button-watch-later, .ytp-subtitles-button, .ytp-size-toggle-large { diff --git a/webroot/feed.shs b/webroot/feed.shs index 95b9e6b..3f5449a 100644 --- a/webroot/feed.shs +++ b/webroot/feed.shs @@ -13,19 +13,19 @@ if session_verify "${cookies[sh_session]}"; then IFS=$'\n' data=$(curl -s "https://www.youtube.com/feeds/videos.xml?channel_id=${y[1]}"); - video_id+=($((grep "" | sed -E 's/[//g') <<< "$data")) - video_date+=($((grep "" | tail -n 15 | sed -E 's/[ //g' | xargs -L1 date "+%s" -d) <<< "$data")) - video_uploader+=($((grep -Poh "name>.*?//;s/<\///' | head -n 1) <<< "$data")) + video_id+=($(grep "" <<< "$data" | sed -E 's/[//g')) + video_date+=($(grep "" <<< "$data" | tail -n 15 | sed -E 's/[ //g;s/T/\\ /;s/\+.*//' | xargs -L1 date "+%s" -d)) + video_uploader+=($(grep -Poh "name>.*?//;s/<\///' | head -n 1)) done <<< "$(cat storage/subscribed | grep -P "^$(session_get_username ${cookies[sh_session]}):")" queue=$(for (( i=0; i<${#video_id[@]}; i++ )); do echo "$i ${video_date[i]}"; done | sort -k2r | awk '{print $1}') while read i; do - strings[feed]+="
${video_title[$i]}
$(date -d "@${video_date[$i]}" "+%H:%M, %d %h %Y")
" + strings[feed]+="
${video_title[$i]}
$(date -d "@${video_date[$i]}" "+%H:%M, %d %h %Y")
" done <<< "$queue" else - strings[feed]="gtfo" + strings[feed]="You're not logged in!" fi source "${cfg[namespace]}/templates/header.shs"