Skip to content

Commit

Permalink
Impersonate the IOS client to replace the deprecated `ANDROID_TESTS…
Browse files Browse the repository at this point in the history
…UITE` (#818)
  • Loading branch information
xBaank authored Sep 27, 2024
1 parent 1c66110 commit f1038b3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions YoutubeExplode/Videos/VideoController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,15 @@ public async ValueTask<PlayerResponse> GetPlayerResponseAsync(
"videoId": {{Json.Serialize(videoId)}},
"context": {
"client": {
"clientName": "ANDROID_TESTSUITE",
"clientVersion": "1.9",
"androidSdkVersion": 30,
"clientName": "IOS",
"clientVersion": "19.29.1",
"deviceMake": "Apple",
"deviceModel": "iPhone16,2",
"hl": "en",
"osName": "iPhone",
"osVersion": "17.5.1.21F90",
"timeZone": "UTC",
"userAgent": "com.google.ios.youtube/19.29.1 (iPhone16,2; U; CPU iOS 17_5_1 like Mac OS X;)",
"gl": "US",
"utcOffsetMinutes": 0
}
Expand All @@ -82,7 +87,7 @@ public async ValueTask<PlayerResponse> GetPlayerResponseAsync(
// https://github.com/iv-org/invidious/issues/3230#issuecomment-1226887639
request.Headers.Add(
"User-Agent",
"com.google.android.youtube/17.36.4 (Linux; U; Android 12; GB) gzip"
"com.google.ios.youtube/19.29.1 (iPhone16,2; U; CPU iOS 17_5_1 like Mac OS X)"
);

using var response = await Http.SendAsync(request, cancellationToken);
Expand Down

0 comments on commit f1038b3

Please sign in to comment.