Workaround for API not returning video statistics
See merge request !63
video_info = js['items'][0]
m = RE_YOUTUBE_DURATION.search(video_info['contentDetails']['duration'])
days, hours, minutes, seconds = map(lambda x: int(x[:-1]) if x else 0, m.groups())
- stats = video_info['statistics']
+ stats = video_info['statistics'] if 'statistics' in video_info else {'favoriteCount': 0, 'viewCount': 0, 'likeCount': 0, 'dislikeCount': 0}
data = {
'title': video_info['snippet']['title'],