lol
All checks were successful
Invidious CI / build (push) Successful in 5m39s

This commit is contained in:
Fijxu 2024-11-01 20:50:19 -03:00
parent 3bb2eafa4a
commit e62e6fd7e4
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -112,7 +112,7 @@ def extract_video_info(video_id : String, user_po_token, user_visitor_data)
# Only trigger if reason found and po_token configured.
if reason && CONFIG.po_token
client_config.client_type = YoutubeAPI::ClientType::WebEmbeddedPlayer
new_player_response = try_fetch_streaming_data(video_id, client_config)
new_player_response = try_fetch_streaming_data(video_id, client_config, po_token, visitor_data)
end
# Don't use Android client if po_token is passed because po_token doesn't
@ -123,7 +123,7 @@ def extract_video_info(video_id : String, user_po_token, user_visitor_data)
# following issue for an explanation about decrypted URLs:
# https://github.com/TeamNewPipe/NewPipeExtractor/issues/562
client_config.client_type = YoutubeAPI::ClientType::AndroidTestSuite
new_player_response = try_fetch_streaming_data(video_id, client_config, po_token, visitor_data)
new_player_response = try_fetch_streaming_data(video_id, client_config)
end
# Last hope
@ -131,7 +131,7 @@ def extract_video_info(video_id : String, user_po_token, user_visitor_data)
# TvHtml5ScreenEmbed now requires sig helper for it to work but doesn't work with po_token.
if reason && CONFIG.po_token.nil?
client_config.client_type = YoutubeAPI::ClientType::TvHtml5ScreenEmbed
new_player_response = try_fetch_streaming_data(video_id, client_config, po_token, visitor_data)
new_player_response = try_fetch_streaming_data(video_id, client_config)
end
# Replace player response and reset reason
@ -170,7 +170,7 @@ def extract_video_info(video_id : String, user_po_token, user_visitor_data)
return params
end
def try_fetch_streaming_data(id : String, client_config : YoutubeAPI::ClientConfig, po_token, visitor_data) : Hash(String, JSON::Any)?
def try_fetch_streaming_data(id : String, client_config : YoutubeAPI::ClientConfig, po_token = "", visitor_data = "") : Hash(String, JSON::Any)?
LOGGER.debug("try_fetch_streaming_data: [#{id}] Using #{client_config.client_type} client.")
response = YoutubeAPI.player(video_id: id, params: "2AMB", client_config: client_config, po_token: po_token, visitor_data: visitor_data)