Skip to content

Commit

Permalink
Merge pull request #65 from kurtasov/key-error-avg_rating
Browse files Browse the repository at this point in the history
Fix "KeyError: avg_rating"
  • Loading branch information
kolsys authored Jan 14, 2019
2 parents d96c723 + 15d3b46 commit 81eec0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Contents/Services/URL/YouTubeTV/ServiceCode.pys
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def MetadataObjectForURL(url):
item['description'] if 'description' in item else '',
),
thumb=Video.GetThumb(meta['video_id']),
rating=(float(meta['avg_rating'])*2),
rating=(float(meta['avg_rating'])*2 if 'avg_rating' in meta else 0.0),
tags=(item['keywords'] if 'keywords' in item else '').split(','),
duration=int(meta['length_seconds'])*1000 if meta['length_seconds'] else None,
originally_available_at=Datetime.ParseDate(
Expand Down

0 comments on commit 81eec0a

Please sign in to comment.