Attempt to fix playback errors
All checks were successful
Invidious CI / build (push) Successful in 5m11s
All checks were successful
Invidious CI / build (push) Successful in 5m11s
This commit is contained in:
parent
46041f5b60
commit
2f3266cd01
1 changed files with 9 additions and 6 deletions
|
@ -74,7 +74,10 @@ def extract_video_info(video_id : String, *, level = 0, client_type = YoutubeAPI
|
||||||
reason ||= subreason.try &.[]("runs").as_a.map(&.[]("text")).join("")
|
reason ||= subreason.try &.[]("runs").as_a.map(&.[]("text")).join("")
|
||||||
reason ||= player_response.dig("playabilityStatus", "reason").as_s
|
reason ||= player_response.dig("playabilityStatus", "reason").as_s
|
||||||
|
|
||||||
if playability_status == "UNPLAYABLE" && reason.includes?("Get the YouTube app")
|
# Show the playability status in the reason message
|
||||||
|
reason = "#{reason} (#{playability_status})"
|
||||||
|
|
||||||
|
if (playability_status == "UNPLAYABLE" && reason.includes?("Get the YouTube app")) || reason.includes?("protect our community")
|
||||||
return extract_video_info(video_id: video_id, level: level, client_type: YoutubeAPI::ClientType::IOS)
|
return extract_video_info(video_id: video_id, level: level, client_type: YoutubeAPI::ClientType::IOS)
|
||||||
elsif !{"LIVE_STREAM_OFFLINE", "LOGIN_REQUIRED"}.any?(playability_status) ||
|
elsif !{"LIVE_STREAM_OFFLINE", "LOGIN_REQUIRED"}.any?(playability_status) ||
|
||||||
playability_status == "LOGIN_REQUIRED" && !player_response.dig?("videoDetails")
|
playability_status == "LOGIN_REQUIRED" && !player_response.dig?("videoDetails")
|
||||||
|
|
Loading…
Reference in a new issue