From 9e7c2dcdbb9c7af4ae1e91c3322deda6615b8fcf Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sat, 6 Aug 2022 23:49:36 +0200 Subject: [PATCH] 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 31be285a..b5b01286 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", }, }