From 721ad7e2d535812e0e90fbe4c4b6175717c44bc5 Mon Sep 17 00:00:00 2001 From: Mattia Date: Thu, 20 May 2021 10:21:22 +0200 Subject: [PATCH] Version 1.9.4 Fix #126 --- CHANGELOG.md | 3 ++ .../responses/video_info_response.dart | 2 +- pubspec.yaml | 3 +- test/streams_test.dart | 34 ++++++++++++------- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d00433..ed3f761 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 1.9.4 +- Fix issue #126 + ## 1.9.3+2 - Fix `ChannelUploadsList`. diff --git a/lib/src/reverse_engineering/responses/video_info_response.dart b/lib/src/reverse_engineering/responses/video_info_response.dart index d6884f2..097eff8 100644 --- a/lib/src/reverse_engineering/responses/video_info_response.dart +++ b/lib/src/reverse_engineering/responses/video_info_response.dart @@ -54,7 +54,7 @@ class VideoInfoResponse { [String? sts]) { var eurl = Uri.encodeFull('https://youtube.googleapis.com/v/$videoId'); var url = - 'https://youtube.com/get_video_info?video_id=$videoId&el=embedded&eurl=$eurl&hl=en${sts != null ? '&sts=$sts' : ''}'; + 'https://youtube.com/get_video_info?video_id=$videoId&el=embedded&eurl=$eurl&hl=en${sts != null ? '&sts=$sts' : ''}&html5=1'; return retry(() async { var raw = await httpClient.getString(url); var result = VideoInfoResponse.parse(raw); diff --git a/pubspec.yaml b/pubspec.yaml index 34b2282..fdbdf62 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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: 1.9.3+2 +version: 1.9.4 homepage: https://github.com/Hexer10/youtube_explode_dart @@ -18,7 +18,6 @@ dependencies: xml: ^5.0.2 dev_dependencies: -#TODO: Add build_runner when is nnbd build_runner: ^1.12.2 console: ^4.0.0 grinder: ^0.9.0-nullsafety.0 diff --git a/test/streams_test.dart b/test/streams_test.dart index 886fca7..56e2919 100644 --- a/test/streams_test.dart +++ b/test/streams_test.dart @@ -48,23 +48,33 @@ void main() { group('Get specific stream of any playable video', () { for (final val in { - VideoId('9bZkp7q19f0'), // very popular - // VideoId('SkRSXFQerZs'), // age restricted (embed allowed) - This is unplayable - VideoId('hySoCSoH-g8'), // age restricted (embed not allowed) - VideoId('_kmeFXjjGfk'), // embed not allowed (type 1) - VideoId('MeJVWBSsPAY'), // embed not allowed (type 2) - VideoId('5VGm0dczmHc'), // rating not allowed - VideoId('ZGdLIwrGHG8'), // unlisted - VideoId('rsAAeyAr-9Y'), // recording of a live stream - VideoId('AI7ULzgf8RU'), // has DASH manifest TODO: Test timesout - VideoId('-xNN-bJQ4vI'), // 360° video + VideoId('9bZkp7q19f0'), + // very popular + VideoId( + 'SkRSXFQerZs'), // age restricted (embed allowed) - This is unplayable + VideoId('hySoCSoH-g8'), + // age restricted (embed not allowed) + VideoId('_kmeFXjjGfk'), + // embed not allowed (type 1) + VideoId('MeJVWBSsPAY'), + // embed not allowed (type 2) + VideoId('5VGm0dczmHc'), + // rating not allowed + VideoId('ZGdLIwrGHG8'), + // unlisted + VideoId('rsAAeyAr-9Y'), + // recording of a live stream + VideoId('AI7ULzgf8RU'), + // has DASH manifest + VideoId('-xNN-bJQ4vI'), + // 360° video }) { test('VideoId - ${val.value}', () async { var manifest = await yt!.videos.streamsClient.getManifest(val); for (final streamInfo in manifest.streams) { - expect(yt!.videos.streamsClient.get(streamInfo), emits(isNotNull)); + expect(yt!.videos.streamsClient.get(streamInfo).first, completes); } - }); + }, timeout: const Timeout(Duration(minutes: 5))); } }); }