Fix for videos without keywords

This commit is contained in:
Bodhi Mulders (BeMacized) 2020-02-21 19:20:34 +01:00
parent 4ca77f923f
commit d4b34632d8
1 changed files with 2 additions and 2 deletions

View File

@ -227,7 +227,7 @@ class YoutubeExplode {
videoInfo['shortDescription'],
ThumbnailSet(videoId),
Duration(seconds: int.parse(videoInfo['lengthSeconds'])),
videoInfo['keywords'].cast<String>(),
videoInfo['keywords']?.cast<String>(),
Statistics(int.parse(videoInfo['viewCount']), 0, 0));
var streamingData = playerResponseJson['streamingData'];
@ -293,7 +293,7 @@ class YoutubeExplode {
var author = details['author'];
var description = details['shortDescription'];
var duration = Duration(seconds: int.parse(details['lengthSeconds']));
var keyWords = details['keywords'].cast<String>();
var keyWords = details['keywords']?.cast<String>();
var viewCount = int.tryParse(details['viewCount'] ?? '0') ?? 0;
var videoPageHtml = await _getVideoWatchPageHtml(videoId);