Schedule upcoming streams at their start time; fix is_upcoming check
yt-dlp reports scheduled premieres as live_status 'is_upcoming' (not 'upcoming'), and exposes release_timestamp with the stream's scheduled start time. For an upcoming stream with a known start, reschedule the job at start+2min without touching the wait counter, no matter how far away the start is — the bounded 10-minute wait clock (maxLiveWaits, ~4h) now only applies while a stream is actually running. Upcoming streams with an unknown start time keep the 10-minute wait behavior.
This commit is contained in:
+7
-1
@@ -81,7 +81,10 @@ type VideoInfo struct {
|
||||
Title string
|
||||
Duration float64 // seconds, 0 if unknown
|
||||
UploadDate time.Time
|
||||
LiveStatus string // "not_live", "is_live", "was_live", "upcoming", or "" if unknown
|
||||
LiveStatus string // "not_live", "is_live", "was_live", "is_upcoming", or "" if unknown
|
||||
// ReleaseTimestamp is the scheduled start time of a live stream in unix
|
||||
// seconds (from liveBroadcastDetails.startTimestamp); 0 if unknown.
|
||||
ReleaseTimestamp int64
|
||||
}
|
||||
|
||||
// Info resolves full metadata for a single video by ID.
|
||||
@@ -126,6 +129,9 @@ func Info(ctx context.Context, s Settings, videoID string) (VideoInfo, error) {
|
||||
}
|
||||
}
|
||||
info.LiveStatus, _ = data["live_status"].(string)
|
||||
if ts, ok := num(data["release_timestamp"]); ok {
|
||||
info.ReleaseTimestamp = int64(ts)
|
||||
}
|
||||
return info, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user