This cron job will run twice per live WNL segment to update the view
count of the stream from exactly 10 days ago. This gives every stream
exactly the same amount of time to mature before we record its view
count for the last time. Ten days gives even notable streams plenty of
time to get most of its views before the rewatch per day rate drops to
nearly nothing.
Now every caster schedule entry will get assigned data from its
corresponding video, no matter what unusual scheduled time it has.
Videos are known well advance, so updating every 3 hours, or once per
stream, should be enough to record new streams, even if the youtube json
request fails once or twice.
Upcoming streams are now assigned a null rather than 0 view count so
zeros aren't accidentally included in view count calculations.
Upcoming streams now have their jst derived from their start time rather
than titles, in case staff initially makes a copy-paste error to the
title.
Momo's Sunshine stream on 2024-05-03 got buried under 25 newer streams
just before the cron job could record its view count after it got
unprivatized. A cutoff at 30 should always be ample enough.
For two reasons:
1. Youtube is the primary source.
Apparently staff manually copies the video id youtube gives them,
since they sometimes forget to update their json. With this commit,
I'm practically implementing the automation they should have
implemented themselves.
2. Make links available ahead of time for convenience.
Currently on our site, links aren't available until the moment the
program starts. So in practice, I have to open youtube to copy the
next stream's url for playing in mpv, lest I miss the first several
seconds of the show. (I know staff puts the next stream's link in
chat, but since it's manual, occasionally they forget, and the url is
usually in "/live/" rather than "/watch?v=" format: the latter makes
clearer screenshot filenames, imo.
yt-dlp becomes a required dependency. The same information could be
sourced with Julia code to scrape an invidious instance, but that would
incur more code to produce the same array of per-video dictionaries,
which could be desireable later as exercise in Julia.