Skip to content

Commit

Permalink
Impersonate ios client to extract manifest.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexer10 committed Oct 8, 2024
1 parent e1d0c26 commit 41e4475
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.2.3
- Impersonate ios client to extract manifest.

## 2.2.2
- Fix video extraction. Thanks to @bigzhu #287.

Expand Down
2 changes: 1 addition & 1 deletion lib/src/videos/streams/stream_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class StreamClient {
try {
// Use await for instead of yield* to catch exceptions
await for (final stream
in _getStream(videoId, VideoController.androidTestSuiteClient)) {
in _getStream(videoId, VideoController.iosClient)) {
yield stream;
}
if (fullManifest) {
Expand Down
27 changes: 15 additions & 12 deletions lib/src/videos/video_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@ import '../reverse_engineering/player/player_response.dart';
@internal
class VideoController {
/// Used to fetch streams without signature deciphering, but has limited streams.
static const androidTestSuiteClient = {
'context': {
'client': {
'clientName': 'ANDROID_CREATOR',
'clientVersion': '24.24.100',
'androidSdkVersion': 30,
// 'userAgent':
// 'com.google.android.youtube/17.36.4 (Linux; U; Android 12; GB) gzip',
'hl': 'en',
'gl': 'US',
'utcOffsetMinutes': 0,
},
static const iosClient = {
"context": {
"client": {
"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 Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: youtube_explode_dart
description: A port in dart of the youtube explode library. Supports several API functions without the need of Youtube API Key.
version: 2.2.2
version: 2.2.3
homepage: https://github.com/Hexer10/youtube_explode_dart

topics:
Expand Down

0 comments on commit 41e4475

Please sign in to comment.