Skip to content

Commit

Permalink
Update default clients + Fix pubspec.yaml version
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexer10 committed Oct 18, 2024
1 parent 8f678fc commit a2ea075
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions lib/src/videos/streams/stream_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class StreamClient {
///
/// See [YoutubeApiClient] for all the possible clients that can be set using the [ytClients] parameter.
/// If [ytClients] is null the library automatically manages the clients, otherwise only the clients provided are used.
/// Currently by default the [YoutubeApiClient.tv] and [YoutubeApiClient.ios] clients are used, if the extraction fails the [YoutubeApiClient.tvSimplyEmbedded] client is used instead.
/// Currently by default the [YoutubeApiClient.ios] clients is used, if the extraction fails [YoutubeApiClient.tvSimplyEmbedded] and [YoutubeApiClient.tv] clients are used instead.
///
/// If [requireWatchPage] (default: true) is set to false the watch page is not used to extract the streams (so the process can be faster) but
/// it COULD be less reliable (not tested thoroughly).
Expand All @@ -54,8 +54,7 @@ class StreamClient {
List<YoutubeApiClient>? ytClients,
bool requireWatchPage = true}) async {
videoId = VideoId.fromString(videoId);
final clients =
ytClients ?? [YoutubeApiClient.ios, YoutubeApiClient.tv];
final clients = ytClients ?? [YoutubeApiClient.ios];

final uniqueStreams = LinkedHashSet<StreamInfo>(
equals: (a, b) {
Expand Down Expand Up @@ -106,10 +105,10 @@ class StreamClient {
}
}

// If the user has not provided any client retry with the tvSimplyEmbedded client, which works also in some restricted videos.
// If the user has not provided any client retry with the tvSimplyEmbedded and client, which work also in some restricted videos.
if (uniqueStreams.isEmpty && ytClients == null) {
return getManifest(videoId,
ytClients: [YoutubeApiClient.tvSimplyEmbedded]);
ytClients: [YoutubeApiClient.tvSimplyEmbedded, YoutubeApiClient.tv]);
}
if (uniqueStreams.isEmpty) {
throw lastException ??
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
html: ^0.15.0
http: ^1.0.0
http_parser: ^4.0.0
json_annotation: '>=4.9.0'
json_annotation: ^4.9.0
meta: ^1.7.0
xml: ^6.1.0
logging: ^1.2.0
Expand Down

0 comments on commit a2ea075

Please sign in to comment.