diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2024-11-10 17:41:54 +0100 |
|---|---|---|
| committer | Samantaz Fox <coding@samantaz.fr> | 2024-11-10 17:41:54 +0100 |
| commit | ec82c2f53949a078046910fd84d256adc7162d0e (patch) | |
| tree | aaeea60e3b8eaf1771cef6b0d4b78b061094f8c4 /src | |
| parent | 4b363e32fae8dcfe236112eff1566db8ec36c699 (diff) | |
| parent | 0f8f32bca8739dfc05edc70ac634bfebe763d927 (diff) | |
| download | invidious-ec82c2f53949a078046910fd84d256adc7162d0e.tar.gz invidious-ec82c2f53949a078046910fd84d256adc7162d0e.tar.bz2 invidious-ec82c2f53949a078046910fd84d256adc7162d0e.zip | |
Videos: use WEB client instead of WEB CREATOR (#4984)
Use the WEB client when a potoken is configured, otherwise try with Android
test suite if there is no potoken configured.
This PR reverts some of the changes made in 4928
Related to 4734
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/videos/parser.cr | 15 | ||||
| -rw-r--r-- | src/invidious/yt_backend/youtube_api.cr | 3 |
2 files changed, 3 insertions, 15 deletions
diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr index 70075da9..927b886a 100644 --- a/src/invidious/videos/parser.cr +++ b/src/invidious/videos/parser.cr @@ -53,10 +53,6 @@ end def extract_video_info(video_id : String) # Init client config for the API client_config = YoutubeAPI::ClientConfig.new - # Use the WEB_CREATOR when po_token is configured because it fully only works on this client - if CONFIG.po_token - client_config.client_type = YoutubeAPI::ClientType::WebCreator - end # Fetch data from the player endpoint player_response = YoutubeAPI.player(video_id: video_id, params: "2AMB", client_config: client_config) @@ -106,15 +102,8 @@ def extract_video_info(video_id : String) new_player_response = nil - # Second try in case WEB_CREATOR doesn't work with po_token. - # 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) - end - - # Don't use Android client if po_token is passed because po_token doesn't - # work for Android client. + # Don't use Android test suite client if po_token is passed because po_token doesn't + # work for Android test suite client. if reason.nil? && CONFIG.po_token.nil? # Fetch the video streams using an Android client in order to get the # decrypted URLs and maybe fix throttling issues (#2194). See the diff --git a/src/invidious/yt_backend/youtube_api.cr b/src/invidious/yt_backend/youtube_api.cr index e0a3181f..8f5aa61d 100644 --- a/src/invidious/yt_backend/youtube_api.cr +++ b/src/invidious/yt_backend/youtube_api.cr @@ -300,9 +300,8 @@ module YoutubeAPI end if client_config.screen == "EMBED" - # embedUrl https://www.google.com allow loading almost all 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 |
