diff --git a/YoutubeParser/Classes/HCYoutubeParser.m b/YoutubeParser/Classes/HCYoutubeParser.m index 079e05b..ef74769 100644 --- a/YoutubeParser/Classes/HCYoutubeParser.m +++ b/YoutubeParser/Classes/HCYoutubeParser.m @@ -159,7 +159,7 @@ + (NSDictionary *)h264videosWithYoutubeID:(NSString *)youtubeID { NSMutableDictionary *optionsDict = [NSMutableDictionary dictionary]; NSArray *keys = @[//@"author", // youtube channel name //@"avg_rating", // average ratings on yt when downloaded - @"iurl", //@"iurlmaxres", @"iurlsd", // thumbnail urls + @"thumbnail_url", //@"iurl", //@"iurlmaxres", @"iurlsd", // thumbnail urls //@"keywords", // author defined keywords @"length_seconds", // total duration in seconds @"title", // video title @@ -168,7 +168,10 @@ + (NSDictionary *)h264videosWithYoutubeID:(NSString *)youtubeID { for (NSString *key in keys) { - [optionsDict setObject:parts[key][0] forKey:key]; // [0] because we want the object and not the array + NSArray* value = parts[key]; + if (value && value.count > 0) { + [optionsDict setObject:value[0] forKey:key]; // [0] because we want the object and not the array + } } [videoDictionary setObject:optionsDict forKey:@"moreInfo"];