From 45ff0b7b62af9f231588e9b0899f11296f7b9077 Mon Sep 17 00:00:00 2001 From: Alexander Eichhorn Date: Sat, 22 Jun 2024 12:10:34 +0200 Subject: [PATCH] include `deviceModel` to innertube ios clients to get more formats --- Sources/YouTubeKit/InnerTube.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/YouTubeKit/InnerTube.swift b/Sources/YouTubeKit/InnerTube.swift index 0c4816b..e64cf45 100644 --- a/Sources/YouTubeKit/InnerTube.swift +++ b/Sources/YouTubeKit/InnerTube.swift @@ -19,9 +19,10 @@ class InnerTube { var playerParams: String? = nil var androidSdkVersion: Int? = nil + var deviceModel: String? = nil var context: Context { - return Context(client: InnerTube.Context.ContextClient(clientName: name, clientVersion: version, clientScreen: screen, androidSdkVersion: androidSdkVersion)) + return Context(client: InnerTube.Context.ContextClient(clientName: name, clientVersion: version, clientScreen: screen, androidSdkVersion: androidSdkVersion, deviceModel: deviceModel)) } var headers: [String: String] { @@ -37,6 +38,7 @@ class InnerTube { let clientVersion: String let clientScreen: String? let androidSdkVersion: Int? + let deviceModel: String? } } @@ -48,8 +50,8 @@ class InnerTube { ClientType.webEmbed: Client(name: "WEB_EMBEDDED_PLAYER", version: "1.20220731.00.00", screen: "EMBED", apiKey: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", userAgent: "Mozilla/5.0"), ClientType.androidEmbed: Client(name: "ANDROID_EMBEDDED_PLAYER", version: "18.11.34", screen: "EMBED", apiKey: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", userAgent: "com.google.android.youtube/18.11.34 (Linux; U; Android 11) gzip"), ClientType.tvEmbed: Client(name: "TVHTML5_SIMPLY_EMBEDDED_PLAYER", version: "2.0", screen: "EMBED", apiKey: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", userAgent: "Mozilla/5.0"), - ClientType.ios: Client(name: "IOS", version: "19.09.3", screen: nil, apiKey: "AIzaSyB-63vPrdThhKuerbB2N_l7Kwwcxj6yUAc", userAgent: "com.google.ios.youtube/19.09.3 (iPhone14,3; U; CPU iOS 15_6 like Mac OS X)"), - ClientType.iosMusic: Client(name: "IOS_MUSIC", version: "5.21", screen: nil, apiKey: "AIzaSyBAETezhkwP0ZWA02RsqT1zu78Fpt0bC_s", userAgent: "com.google.ios.youtubemusic/5.21 (iPhone14,3; U; CPU iOS 15_6 like Mac OS X)"), + ClientType.ios: Client(name: "IOS", version: "19.09.3", screen: nil, apiKey: "AIzaSyB-63vPrdThhKuerbB2N_l7Kwwcxj6yUAc", userAgent: "com.google.ios.youtube/19.09.3 (iPhone14,3; U; CPU iOS 15_6 like Mac OS X)", deviceModel: "iPhone14,3"), + ClientType.iosMusic: Client(name: "IOS_MUSIC", version: "5.21", screen: nil, apiKey: "AIzaSyBAETezhkwP0ZWA02RsqT1zu78Fpt0bC_s", userAgent: "com.google.ios.youtubemusic/5.21 (iPhone14,3; U; CPU iOS 15_6 like Mac OS X)", deviceModel: "iPhone14,3"), ClientType.mediaConnectFrontend: Client(name: "MEDIA_CONNECT_FRONTEND", version: "0.1", screen: nil, apiKey: "", userAgent: nil) ]