Skip to content

Commit

Permalink
Add IOS client
Browse files Browse the repository at this point in the history
  • Loading branch information
corny committed Dec 25, 2023
1 parent 2e06f1f commit ec1333b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ type innertubeClient struct {
ClientName string `json:"clientName"`
ClientVersion string `json:"clientVersion"`
AndroidSDKVersion int `json:"androidSDKVersion,omitempty"`
DeviceModel string `json:"deviceModel,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
TimeZone string `json:"timeZone"`
UTCOffset int `json:"utcOffsetMinutes"`
Expand All @@ -167,7 +168,8 @@ type clientInfo struct {
key string
version string
userAgent string
androidVersion int
deviceModel string // used for IOS
androidVersion int // used for Android
}

var (
Expand All @@ -188,6 +190,15 @@ var (
androidVersion: 30,
}

// AndroidClient, download go brrrrrr.
IosClient = clientInfo{
name: "IOS",
version: "17.33.2",
key: "AIzaSyA8eiZmM1FaDVjRy-df2KTyQ_vz_yYM39w",
userAgent: "com.google.ios.youtube/17.33.2 (iPhone14,3; U; CPU iOS 15_6 like Mac OS X)",
deviceModel: "iPhone14,3",
}

// EmbeddedClient, not really tested.
EmbeddedClient = clientInfo{
name: "WEB_EMBEDDED_PLAYER",
Expand Down Expand Up @@ -233,6 +244,7 @@ func prepareInnertubeContext(clientInfo clientInfo) inntertubeContext {
ClientName: clientInfo.name,
ClientVersion: clientInfo.version,
AndroidSDKVersion: clientInfo.androidVersion,
DeviceModel: clientInfo.deviceModel,
UserAgent: clientInfo.userAgent,
},
}
Expand Down

0 comments on commit ec1333b

Please sign in to comment.