diff --git a/src/invidious/routes/watch.cr b/src/invidious/routes/watch.cr index 8f244e92..1b2f6916 100644 --- a/src/invidious/routes/watch.cr +++ b/src/invidious/routes/watch.cr @@ -129,17 +129,20 @@ module Invidious::Routes::Watch video_streams = video.video_streams audio_streams = video.audio_streams - # Older videos may not have audio sources available. - # We redirect here so they're not unplayable - if audio_streams.empty? && !video.live_now - if params.quality == "dash" - env.params.query.delete_all("quality") - env.params.query["quality"] = "medium" - return env.redirect "/watch?#{env.params.query}" - elsif params.listen - env.params.query.delete_all("listen") - env.params.query["listen"] = "0" - return env.redirect "/watch?#{env.params.query}" + # Videos that are a premiere do not have audio streams. + if !video.premiere_timestamp.nil? + # Older videos may not have audio sources available. + # We redirect here so they're not unplayable + if audio_streams.empty? && !video.live_now + if params.quality == "dash" + env.params.query.delete_all("quality") + env.params.query["quality"] = "medium" + return env.redirect "/watch?#{env.params.query}" + elsif params.listen + env.params.query.delete_all("listen") + env.params.query["listen"] = "0" + return env.redirect "/watch?#{env.params.query}" + end end end diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr index 914c5963..20bdf3f9 100644 --- a/src/invidious/videos/parser.cr +++ b/src/invidious/videos/parser.cr @@ -109,7 +109,7 @@ module Invidious::Videos::Parser params = self.parse_video_info(video_id, player_response) params["reason"] = JSON::Any.new(reason) if reason - {"captions", "playabilityStatus", "playerConfig", "storyboards"}.each do |f| + {"captions", "playabilityStatus", "playerConfig", "storyboards", "microformat"}.each do |f| params[f] = player_response[f] if player_response[f]? end