From fc97929dee4f57ac634d9c2dcd5aa77d5c3f70e3 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sat, 6 Aug 2022 23:28:19 +0200 Subject: [PATCH 1/6] Bump android app version --- src/invidious/yt_backend/youtube_api.cr | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/invidious/yt_backend/youtube_api.cr b/src/invidious/yt_backend/youtube_api.cr index 2678ac6c0..d2073f73e 100644 --- a/src/invidious/yt_backend/youtube_api.cr +++ b/src/invidious/yt_backend/youtube_api.cr @@ -5,6 +5,8 @@ module YoutubeAPI extend self + private ANDROID_APP_VERSION = "17.29.35" + # Enumerate used to select one of the clients supported by the API enum ClientType Web @@ -45,19 +47,19 @@ module YoutubeAPI }, ClientType::Android => { name: "ANDROID", - version: "16.20", + version: ANDROID_APP_VERSION, api_key: "AIzaSyA8eiZmM1FaDVjRy-df2KTyQ_vz_yYM39w", screen: "", # ?? }, ClientType::AndroidEmbeddedPlayer => { name: "ANDROID_EMBEDDED_PLAYER", # 55 - version: "16.20", + version: ANDROID_APP_VERSION, api_key: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", screen: "", # None? }, ClientType::AndroidScreenEmbed => { name: "ANDROID", # 3 - version: "16.20", + version: ANDROID_APP_VERSION, api_key: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", screen: "EMBED", }, From f353589a5343448941eb3a7231c14fbff6cc00bf Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sat, 6 Aug 2022 23:47:16 +0200 Subject: [PATCH 2/6] Bump web clients versions --- src/invidious/yt_backend/youtube_api.cr | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/invidious/yt_backend/youtube_api.cr b/src/invidious/yt_backend/youtube_api.cr index d2073f73e..31be285a8 100644 --- a/src/invidious/yt_backend/youtube_api.cr +++ b/src/invidious/yt_backend/youtube_api.cr @@ -23,25 +23,25 @@ module YoutubeAPI HARDCODED_CLIENTS = { ClientType::Web => { name: "WEB", - version: "2.20210721.00.00", + version: "2.20220804.07.00", api_key: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", screen: "WATCH_FULL_SCREEN", }, ClientType::WebEmbeddedPlayer => { name: "WEB_EMBEDDED_PLAYER", # 56 - version: "1.20210721.1.0", + version: "1.20220803.01.00", api_key: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", screen: "EMBED", }, ClientType::WebMobile => { name: "MWEB", - version: "2.20210726.08.00", + version: "2.20220805.01.00", api_key: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", screen: "", # None }, ClientType::WebScreenEmbed => { name: "WEB", - version: "2.20210721.00.00", + version: "2.20220804.00.00", api_key: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", screen: "EMBED", }, From 9e7c2dcdbb9c7af4ae1e91c3322deda6615b8fcf Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sat, 6 Aug 2022 23:49:36 +0200 Subject: [PATCH 3/6] Move the default API key to a constant for clarity --- src/invidious/yt_backend/youtube_api.cr | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/invidious/yt_backend/youtube_api.cr b/src/invidious/yt_backend/youtube_api.cr index 31be285a8..b5b012864 100644 --- a/src/invidious/yt_backend/youtube_api.cr +++ b/src/invidious/yt_backend/youtube_api.cr @@ -5,6 +5,8 @@ module YoutubeAPI extend self + private DEFAULT_API_KEY = "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8" + private ANDROID_APP_VERSION = "17.29.35" # Enumerate used to select one of the clients supported by the API @@ -24,25 +26,25 @@ module YoutubeAPI ClientType::Web => { name: "WEB", version: "2.20220804.07.00", - api_key: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", + api_key: DEFAULT_API_KEY, screen: "WATCH_FULL_SCREEN", }, ClientType::WebEmbeddedPlayer => { name: "WEB_EMBEDDED_PLAYER", # 56 version: "1.20220803.01.00", - api_key: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", + api_key: DEFAULT_API_KEY, screen: "EMBED", }, ClientType::WebMobile => { name: "MWEB", version: "2.20220805.01.00", - api_key: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", + api_key: DEFAULT_API_KEY, screen: "", # None }, ClientType::WebScreenEmbed => { name: "WEB", version: "2.20220804.00.00", - api_key: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", + api_key: DEFAULT_API_KEY, screen: "EMBED", }, ClientType::Android => { @@ -54,19 +56,19 @@ module YoutubeAPI ClientType::AndroidEmbeddedPlayer => { name: "ANDROID_EMBEDDED_PLAYER", # 55 version: ANDROID_APP_VERSION, - api_key: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", + api_key: DEFAULT_API_KEY, screen: "", # None? }, ClientType::AndroidScreenEmbed => { name: "ANDROID", # 3 version: ANDROID_APP_VERSION, - api_key: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", + api_key: DEFAULT_API_KEY, screen: "EMBED", }, ClientType::TvHtml5ScreenEmbed => { name: "TVHTML5_SIMPLY_EMBEDDED_PLAYER", version: "2.0", - api_key: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", + api_key: DEFAULT_API_KEY, screen: "EMBED", }, } From 349d90b60e3cece2a125669688e978932d8d9795 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sun, 7 Aug 2022 00:24:35 +0200 Subject: [PATCH 4/6] Add IOS clients --- src/invidious/yt_backend/youtube_api.cr | 33 ++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/invidious/yt_backend/youtube_api.cr b/src/invidious/yt_backend/youtube_api.cr index b5b012864..c66b155ee 100644 --- a/src/invidious/yt_backend/youtube_api.cr +++ b/src/invidious/yt_backend/youtube_api.cr @@ -8,6 +8,7 @@ module YoutubeAPI private DEFAULT_API_KEY = "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8" private ANDROID_APP_VERSION = "17.29.35" + private IOS_APP_VERSION = "17.30.1" # Enumerate used to select one of the clients supported by the API enum ClientType @@ -15,9 +16,15 @@ module YoutubeAPI WebEmbeddedPlayer WebMobile WebScreenEmbed + Android AndroidEmbeddedPlayer AndroidScreenEmbed + + IOS + IOSEmbedded + IOSMusic + TvHtml5ScreenEmbed end @@ -47,6 +54,9 @@ module YoutubeAPI api_key: DEFAULT_API_KEY, screen: "EMBED", }, + + # Android + ClientType::Android => { name: "ANDROID", version: ANDROID_APP_VERSION, @@ -65,6 +75,27 @@ module YoutubeAPI api_key: DEFAULT_API_KEY, screen: "EMBED", }, + + # IOS + + ClientType::IOS => { + name: "IOS", # 5 + version: IOS_APP_VERSION, + api_key: "AIzaSyB-63vPrdThhKuerbB2N_l7Kwwcxj6yUAc", + }, + ClientType::IOSEmbedded => { + name: "IOS_MESSAGES_EXTENSION", # 66 + version: IOS_APP_VERSION, + api_key: DEFAULT_API_KEY, + }, + ClientType::IOSMusic => { + name: "IOS_MUSIC", # 26 + version: "4.32", + api_key: "AIzaSyBAETezhkwP0ZWA02RsqT1zu78Fpt0bC_s", + }, + + # TV app + ClientType::TvHtml5ScreenEmbed => { name: "TVHTML5_SIMPLY_EMBEDDED_PLAYER", version: "2.0", @@ -135,7 +166,7 @@ module YoutubeAPI # :ditto: def screen : String - HARDCODED_CLIENTS[@client_type][:screen] + HARDCODED_CLIENTS[@client_type][:screen]? || "" end # Convert to string, for logging purposes From 618ab01cd75fe43ff8c47fc2454e12eedd41b56e Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sun, 7 Aug 2022 00:36:22 +0200 Subject: [PATCH 5/6] Add TVHtml5 client --- src/invidious/yt_backend/youtube_api.cr | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/invidious/yt_backend/youtube_api.cr b/src/invidious/yt_backend/youtube_api.cr index c66b155ee..c8e61539c 100644 --- a/src/invidious/yt_backend/youtube_api.cr +++ b/src/invidious/yt_backend/youtube_api.cr @@ -25,6 +25,7 @@ module YoutubeAPI IOSEmbedded IOSMusic + TvHtml5 TvHtml5ScreenEmbed end @@ -96,8 +97,13 @@ module YoutubeAPI # TV app + ClientType::TvHtml5 => { + name: "TVHTML5", # 7 + version: "7.20220325", + api_key: DEFAULT_API_KEY, + }, ClientType::TvHtml5ScreenEmbed => { - name: "TVHTML5_SIMPLY_EMBEDDED_PLAYER", + name: "TVHTML5_SIMPLY_EMBEDDED_PLAYER", # 85 version: "2.0", api_key: DEFAULT_API_KEY, screen: "EMBED", From 23855c09dc2988947d7ee63ab4c3f8590660884b Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sun, 7 Aug 2022 00:37:09 +0200 Subject: [PATCH 6/6] Remove 'screen' where not required --- src/invidious/yt_backend/youtube_api.cr | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/invidious/yt_backend/youtube_api.cr b/src/invidious/yt_backend/youtube_api.cr index c8e61539c..2b3db7427 100644 --- a/src/invidious/yt_backend/youtube_api.cr +++ b/src/invidious/yt_backend/youtube_api.cr @@ -47,7 +47,6 @@ module YoutubeAPI name: "MWEB", version: "2.20220805.01.00", api_key: DEFAULT_API_KEY, - screen: "", # None }, ClientType::WebScreenEmbed => { name: "WEB", @@ -62,13 +61,11 @@ module YoutubeAPI name: "ANDROID", version: ANDROID_APP_VERSION, api_key: "AIzaSyA8eiZmM1FaDVjRy-df2KTyQ_vz_yYM39w", - screen: "", # ?? }, ClientType::AndroidEmbeddedPlayer => { name: "ANDROID_EMBEDDED_PLAYER", # 55 version: ANDROID_APP_VERSION, api_key: DEFAULT_API_KEY, - screen: "", # None? }, ClientType::AndroidScreenEmbed => { name: "ANDROID", # 3