* fixed `date` usage for busybox

merge-requests/6/head
Dominika Liberda 2021-08-29 10:34:19 +00:00
parent 1ea165dc70
commit 7b3c3b87e9
3 changed files with 20 additions and 13 deletions

View File

@ -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"

View File

@ -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 {

View File

@ -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 "<link" | grep -Eoh "watch\?v\=[A-Za-z0-9_\-]+" | sed -s 's/watch?v=//') <<< "$data"))
video_title+=($((grep "<media:title>" | sed -E 's/[</ ]+media:title>//g') <<< "$data"))
video_date+=($((grep "<published>" | tail -n 15 | sed -E 's/[ </]+published>//g' | xargs -L1 date "+%s" -d) <<< "$data"))
video_uploader+=($((grep -Poh "name>.*?</" | sed -E 's/name>//;s/<\///' | head -n 1) <<< "$data"))
video_id+=($(grep "<link" <<< "$data" | grep -Eoh "watch\?v\=[A-Za-z0-9_\-]+" | sed -s 's/watch?v=//'))
video_title+=($(grep "<media:title>" <<< "$data" | sed -E 's/[</ ]+media:title>//g'))
video_date+=($(grep "<published>" <<< "$data" | tail -n 15 | sed -E 's/[ </]+published>//g;s/T/\\ /;s/\+.*//' | xargs -L1 date "+%s" -d))
video_uploader+=($(grep -Poh "name>.*?</" <<< "$data" | sed -E 's/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]+="<a href='watch?v=${video_id[$i]}'><img src='http://i.ytimg.com/vi/${video_id[$i]}/mqdefault.jpg'><br>${video_title[$i]}</a>$(date -d "@${video_date[$i]}" "+%H:%M, %d %h %Y")<br>"
strings[feed]+="<div class='video-image-container'><a href='watch?v=${video_id[$i]}'><div class='video-image' style='background-image: url(http://i.ytimg.com/vi/${video_id[$i]}/mqdefault.jpg)'></div>${video_title[$i]}</a>$(date -d "@${video_date[$i]}" "+%H:%M, %d %h %Y")</div>"
done <<< "$queue"
else
strings[feed]="gtfo"
strings[feed]="You're not logged in!"
fi
source "${cfg[namespace]}/templates/header.shs"