butterscotchstallion / limnoria-plugins

A smattering of Limnoria plugins I've written
MIT License
14 stars 14 forks source link

SpiffyTitles: problem with YouTube when Dis/Like count disabled #66

Closed bw4518 closed 8 years ago

bw4518 commented 8 years ago

This is probably quite rare but I noticed problem with some youtube links.

For example: https://www.youtube.com/watch?v=iSiYDdNs7B4

I use {{like_count}} and {{dislike_count}} in my youtubeTitleTemplate, if there is no dis/likes count for the video, I get this error:

File "C:\Program Files\Python27\lib\site-packages\supybot\plugins\SpiffyTitles\plugin.py", line 598, in handler_youtube like_count = "{:,}".format(int(statistics["likeCount"])) KeyError: 'likeCount'

and no title/info will be displayed.

Maybe it could show "n/a" for {{like_count}} and {{dislike_count}} on this kind of youtube videos.