Revert "use web screen embed for fixing potoken functionality (#4923)"
Some checks failed
Stale issue handler / stale (push) Failing after 1s
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.10.1, true) (push) Failing after 1s
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.11.2, true) (push) Failing after 1s
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.1, true) (push) Failing after 1s
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.9.2, true) (push) Failing after 1s
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Failing after 1s
Invidious CI / build-docker (push) Failing after 1s
Invidious CI / build-docker-arm64 (push) Failing after 1s
Invidious CI / ameba_lint (push) Failing after 1s

This reverts commit de918b9234.
The code doesn't work as expected. Reverting
This commit is contained in:
Emilien Devos 2024-09-17 00:22:06 +02:00
parent de918b9234
commit cec3cfba77
2 changed files with 5 additions and 11 deletions

View File

@ -102,12 +102,6 @@ def extract_video_info(video_id : String)
new_player_response = nil
# Use the WEB embed client when po_token is configured because it only works on this client
if CONFIG.po_token
client_config.client_type = YoutubeAPI::ClientType::WebEmbeddedPlayer
new_player_response = try_fetch_streaming_data(video_id, client_config)
end
# Don't use Android client if po_token is passed because po_token doesn't
# work for Android client.
if reason.nil? && CONFIG.po_token.nil?
@ -120,9 +114,10 @@ def extract_video_info(video_id : String)
end
# Last hope
# Only trigger if reason found or didn't work wth Android client.
# TvHtml5ScreenEmbed now requires sig helper for it to work but doesn't work with po_token.
if reason && CONFIG.po_token.nil?
# Only trigger if reason found and po_token or didn't work wth Android client.
# TvHtml5ScreenEmbed now requires sig helper for it to work but po_token is not required
# if the IP address is not blocked.
if CONFIG.po_token && reason || CONFIG.po_token.nil? && new_player_response.nil?
client_config.client_type = YoutubeAPI::ClientType::TvHtml5ScreenEmbed
new_player_response = try_fetch_streaming_data(video_id, client_config)
end

View File

@ -291,9 +291,8 @@ module YoutubeAPI
end
if client_config.screen == "EMBED"
# embedUrl https://www.google.com allow loading video that are configured not embeddable
client_context["thirdParty"] = {
"embedUrl" => "https://www.google.com/",
"embedUrl" => "https://www.youtube.com/embed/#{video_id}",
} of String => String | Int64
end