summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsyeopite <syeopite@syeopite.dev>2023-08-08 15:20:48 -0700
committersyeopite <syeopite@syeopite.dev>2023-08-08 15:28:01 -0700
commit6b17bb525095a62b163489c565edb0ca29eb1a93 (patch)
tree001adc4c17a0c983cd6ee56b683c2ba1c459e05b /src
parenta81c0f329cfe0ef343c31636b74615e91e613f72 (diff)
downloadinvidious-6b17bb525095a62b163489c565edb0ca29eb1a93.tar.gz
invidious-6b17bb525095a62b163489c565edb0ca29eb1a93.tar.bz2
invidious-6b17bb525095a62b163489c565edb0ca29eb1a93.zip
Regression from #4037 | Fix storyboards
PR #4037 introduced a workaround around YouTube's new integrity checks on streaming URLs. However, the usage of this workaround prevents storyboard data from being returned by InnerTube. This commit fixes that by only using the workaround when calling try_fetch_streaming_data
Diffstat (limited to 'src')
-rw-r--r--src/invidious/videos/parser.cr7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr
index 2a09d187..06ff96b1 100644
--- a/src/invidious/videos/parser.cr
+++ b/src/invidious/videos/parser.cr
@@ -55,9 +55,7 @@ def extract_video_info(video_id : String, proxy_region : String? = nil)
client_config = YoutubeAPI::ClientConfig.new(proxy_region: proxy_region)
# Fetch data from the player endpoint
- # CgIQBg is a workaround for streaming URLs that returns a 403.
- # See https://github.com/iv-org/invidious/issues/4027#issuecomment-1666944520
- player_response = YoutubeAPI.player(video_id: video_id, params: "CgIQBg", client_config: client_config)
+ player_response = YoutubeAPI.player(video_id: video_id, params: "", client_config: client_config)
playability_status = player_response.dig?("playabilityStatus", "status").try &.as_s
@@ -120,6 +118,9 @@ def extract_video_info(video_id : String, proxy_region : String? = nil)
# Replace player response and reset reason
if !new_player_response.nil?
+ # Preserve storyboard data before replacement
+ new_player_response["storyboards"] = player_response["storyboards"] if player_response["storyboards"]?
+
player_response = new_player_response
params.delete("reason")
end