Version 1.2.1

This commit is contained in:
Hexah 2020-06-16 22:29:52 +02:00
parent ad2db4c3bb
commit beb50cb153
4 changed files with 21 additions and 5 deletions

View File

@ -1,3 +1,8 @@
## 1.2.1
- Fixed `SearchPage.nextPage`.
- Added more tests.
## 1.2.0 ## 1.2.0
- Improved documentation. - Improved documentation.
- Deprecated `StreamInfoExt.getHighestBitrate`, use list.`sortByBitrate`. - Deprecated `StreamInfoExt.getHighestBitrate`, use list.`sortByBitrate`.
@ -5,6 +10,7 @@
- Implemented `withHighestBitrate` for `VideoStreamInfo` iterables. - Implemented `withHighestBitrate` for `VideoStreamInfo` iterables.
- Now `sortByVideoQuality` returns a List of `T`. - Now `sortByVideoQuality` returns a List of `T`.
- `SearchQuery.nextPage` now returns null if there is no next page. - `SearchQuery.nextPage` now returns null if there is no next page.
## 1.1.0 ## 1.1.0
- Implement parsing of the search page to retrieve information from youtube searches. See `SearchQuery`. - Implement parsing of the search page to retrieve information from youtube searches. See `SearchQuery`.

View File

@ -136,10 +136,10 @@ class _InitialData {
Map<String, dynamic> getContinuationContext(Map<String, dynamic> root) { Map<String, dynamic> getContinuationContext(Map<String, dynamic> root) {
if (_root['contents'] != null) { if (_root['contents'] != null) {
return _root['contents']['twoColumnSearchResultsRenderer'] return (_root['contents']['twoColumnSearchResultsRenderer']
['primaryContents']['sectionListRenderer']['contents'] ['primaryContents']['sectionListRenderer']['contents']
?.first['itemSectionRenderer']['continuations'] ?.first['itemSectionRenderer']['continuations']
?.first ?.first as Map)
?.getValue('nextContinuationData') ?.getValue('nextContinuationData')
?.cast<String, dynamic>(); ?.cast<String, dynamic>();
} }

View File

@ -1,6 +1,6 @@
name: youtube_explode_dart 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. description: A port in dart of the youtube explode library. Supports several API functions without the need of Youtube API Key.
version: 1.2.0+2 version: 1.2.1
homepage: https://github.com/Hexer10/youtube_explode_dart homepage: https://github.com/Hexer10/youtube_explode_dart
environment: environment:

View File

@ -26,5 +26,15 @@ void main() {
expect(searchQuery.relatedVideos, isNotEmpty); expect(searchQuery.relatedVideos, isNotEmpty);
expect(searchQuery.relatedQueries, isNotEmpty); expect(searchQuery.relatedQueries, isNotEmpty);
}, skip: 'This may fail on some environments'); }, skip: 'This may fail on some environments');
test('SearchNoResults', () async {
var query =
await yt.search.queryFromPage('g;jghEOGHJeguEPOUIhjegoUEHGOGHPSASG');
expect(query.content, isEmpty);
expect(query.relatedQueries, isEmpty);
expect(query.relatedVideos, isEmpty);
var nextPage = await query.nextPage();
expect(nextPage, isNull);
});
}); });
} }