Skip to content

Commit

Permalink
Update the ANDROID client params (#48)
Browse files Browse the repository at this point in the history
* Update android player params
from: LuanRT/YouTube.js#624
  • Loading branch information
kuylar committed Apr 2, 2024
1 parent b3c558c commit c08d882
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions InnerTube/InnerTube.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ public InnerTube(InnerTubeConfiguration? config = null)
hrm.Headers.Add("X-Youtube-Client-Version", client switch
{
RequestClient.WEB => "2.20220809.02.00",
RequestClient.ANDROID => "17.31.4",
RequestClient.IOS => "17.31.4",
RequestClient.ANDROID => "19.09.4",
RequestClient.IOS => "19.09.4",
var _ => ""
});
hrm.Headers.Add("Origin", "https://www.youtube.com");
if (client == RequestClient.ANDROID)
hrm.Headers.Add("User-Agent", "com.google.android.youtube/17.31.35 (Linux; U; Android 11) gzip");
hrm.Headers.Add("User-Agent", "com.google.android.youtube/19.09.4 (Linux; U; Android 11) gzip");

HttpResponseMessage ytPlayerRequest = await HttpClient.SendAsync(hrm);
if (!ytPlayerRequest.IsSuccessStatusCode)
Expand Down Expand Up @@ -138,7 +138,7 @@ public InnerTube(InnerTubeConfiguration? config = null)
.AddValue("racyCheckOk", contentCheckOk);

if (client == RequestClient.ANDROID)
postData.AddValue("params", "CgIQBg");
postData.AddValue("params", "CgIIAdgDAQ%3D%3D");

return await MakeRequest(client, "player", postData,
language, region, true);
Expand Down
4 changes: 2 additions & 2 deletions InnerTube/InnerTube.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<PackageLicenseUrl>https://github.com/kuylar/InnerTube/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/kuylar/InnerTube</RepositoryUrl>
<PackageTags>youtube, innertube</PackageTags>
<AssemblyVersion>1.1.2</AssemblyVersion>
<Version>1.1.2</Version>
<AssemblyVersion>1.1.4</AssemblyVersion>
<Version>1.1.4</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Remove/comment this while looking for missing XMLDocs -->
<NoWarn>$(NoWarn);1591</NoWarn>
Expand Down
4 changes: 2 additions & 2 deletions InnerTube/InnerTubeRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ private void UpdateContext(RequestClient requestClient, string language = "en",
break;
case RequestClient.ANDROID:
clientContext.Add("clientName", "ANDROID");
clientContext.Add("clientVersion", "17.31.35");
clientContext.Add("clientVersion", "19.09.4");
clientContext.Add("osName", "Android");
clientContext.Add("osVersion", "11");
clientContext.Add("androidSdkVersion", 30);
clientContext.Add("platform", "MOBILE");
clientContext.Add("userAgent", "com.google.android.youtube/17.31.35 (Linux; U; Android 11) gzip");
clientContext.Add("userAgent", "com.google.android.youtube/19.09.4 (Linux; U; Android 11) gzip");
break;
case RequestClient.IOS:
clientContext.Add("clientName", "IOS");
Expand Down

0 comments on commit c08d882

Please sign in to comment.