diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr index d1baf4f3..ddad7056 100644 --- a/src/invidious/videos/parser.cr +++ b/src/invidious/videos/parser.cr @@ -102,23 +102,23 @@ module Invidious::Videos::Parser # Fetch the /next endpoint for additional data. begin - next_response = YoutubeAPI.next({"videoId": video_id, "params": ""}) - # Remove the microformat returned by the /next endpoint on some videos - # to prevent player_response microformat from being overwritten. - next_response.delete("microformat") - player_response = player_response.merge(next_response) - rescue ex - # If we're in an error state and /next fails, return what we have - if reason - LOGGER.debug("extract_video_info: /next failed for #{video_id}: #{ex.message}") - return { - "version" => JSON::Any.new(Video::SCHEMA_VERSION.to_i64), - "reason" => JSON::Any.new(reason), - "subreason" => JSON::Any.new(subreason), - } - end - raise ex + next_response = YoutubeAPI.next({"videoId": video_id, "params": ""}) + # Remove the microformat returned by the /next endpoint on some videos + # to prevent player_response microformat from being overwritten. + next_response.delete("microformat") + player_response = player_response.merge(next_response) + rescue ex + # If we're in an error state and /next fails, return what we have + if reason + LOGGER.debug("extract_video_info: /next failed for #{video_id}: #{ex.message}") + return { + "version" => JSON::Any.new(Video::SCHEMA_VERSION.to_i64), + "reason" => JSON::Any.new(reason), + "subreason" => JSON::Any.new(subreason), + } end + raise ex + end begin params = self.parse_video_info(video_id, player_response) diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 0911fceb..07a3344b 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -76,7 +76,7 @@ we're going to need to do it here in order to allow for translations. <%= rendered "components/player" %> <% else %> -
<%= I18n.translate(locale, "error_from_youtube_unplayable") %>