Update workaround used to fetch streaming URLs (#4552)

Thanks to LuanRT (From youtube.js) for the fix!

Closes issue 4498
pull/4296/head^2
Samantaz Fox 2 months ago
commit 08390acd0c
No known key found for this signature in database
GPG Key ID: F42821059186176E

@ -142,8 +142,9 @@ end
def try_fetch_streaming_data(id : String, client_config : YoutubeAPI::ClientConfig) : Hash(String, JSON::Any)?
LOGGER.debug("try_fetch_streaming_data: [#{id}] Using #{client_config.client_type} client.")
# 2AMBCgIQBg is a workaround for streaming URLs that returns a 403.
response = YoutubeAPI.player(video_id: id, params: "2AMBCgIQBg", client_config: client_config)
# CgIIAdgDAQ%3D%3D is a workaround for streaming URLs that returns a 403.
# https://github.com/LuanRT/YouTube.js/pull/624
response = YoutubeAPI.player(video_id: id, params: "CgIIAdgDAQ%3D%3D", client_config: client_config)
playability_status = response["playabilityStatus"]["status"]
LOGGER.debug("try_fetch_streaming_data: [#{id}] Got playabilityStatus == #{playability_status}.")

Loading…
Cancel
Save