This commit is contained in:
parent
3bb2eafa4a
commit
e62e6fd7e4
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue