Fix SearchVideo

See https://github.com/Tyrrrz/YoutubeExplode/issues/438
This commit is contained in:
Mattia 2020-09-11 18:24:19 +02:00
parent 105748fc7c
commit c962c1999e
3 changed files with 10 additions and 2 deletions

View File

@ -3,6 +3,9 @@
- Only throw custom exceptions from the library.
- `getUploadsFromPage` no longer throws.
## 1.5.1
- Fix Video Search: https://github.com/Tyrrrz/YoutubeExplode/issues/438
## 1.5.0
- BREAKING CHANGE: Renamed `Container` class to `StreamContainer` to avoid conflicting with Flutter `Container`. See #66

View File

@ -67,7 +67,12 @@ class PlaylistResponse {
var url = 'https://youtube.com/search_ajax?style=json&search_query='
'${Uri.encodeQueryComponent(query)}&page=$page&hl=en';
return retry(() async {
var raw = await httpClient.getString(url, validate: false);
var raw = await httpClient.getString(url,
validate: false,
headers: const {
'x-youtube-client-name': '56',
'x-youtube-client-version': '20200911'
});
return PlaylistResponse.parse(raw);
});
}

View File

@ -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.5.0
version: 1.5.1
homepage: https://github.com/Hexer10/youtube_explode_dart
environment: