-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor a bunch of output code to support live/upcoming streams
* Split the upload-date ("publishedAt") "parse" function into two, one that really *only* parses, and another that formats * Request additional video details pertaining to live-stream status from the YouTube API * Conditionally output certain pieces of information depending on whether the video is a scheduled or active live stream * For example, view count is irrelevant for a "live" video, but it's interesting to see how many people are currently watching * An "upcoming" stream has no viewer info available (YT doesn't expose the "waiting" count via the API, AFAICT), so the "views" info item can be skipped for these * Upload date, comments, and length/duration also adapt or skip themselves depending on the video's live status This patch contains Yet Another Reason why Sopel should make the prepositions outputted by `tools.time.seconds_to_human()` optional. Honestly, I can't remember ever writing code using that function *without* needing to remove the ' ago' or 'in ' from its output.
- Loading branch information
Showing
1 changed file
with
53 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters