XBMC-Addons/script.artwork.downloader — pull request #83 by javiermon (2014-04-14 23:39:16+00:00)
Title: skip items with no url key

Hi

I've recently have been having trouble with items from fanarttv with wrong url key:
01:04:29 T:140367684941568 NOTICE: {u'url': u'http://assets.fanart.tv/fanart/movies/46705/movielogo/blue-valentine-4f76bcbf09e11.png', u'lang': u'en', u'id': u'1472', u'
likes': u'1'}
01:04:29 T:140367684941568 NOTICE: {u'url': u'http://assets.fanart.tv/fanart/movies/46705/hdmovielogo/blue-valentine-50f28de6397ac.png', u'lang': u'en', u'id': u'21496',
u'likes': u'2'}
01:04:29 T:140367684941568 NOTICE: {u'lang': u'de', u'url': u'http://assets.fanart.tv/fanart/movies/46705/moviedisc/blue-valentine-501507983136f.png', u'disc': u'1', u'l
ikes': u'!', u'disc_type': u'dvd', u'id': u'7729'}
01:04:29 T:140367684941568 NOTICE: {u'url': u'http://assets.fanart.tv/fanart/movies/46705/hdmovieclearart/blue-valentine-50f28e0001ed5.png', u'lang': u'en', u'id': u'214
97', u'likes': u'1'}
01:04:29 T:140367684941568 NOTICE: {u'ubl': u'http://assets.fanart.tv/fanart/movies/46705/moviethumb/blue-valentine-51ce7f38bceb3.jpg', u'lang': u'en', u'id': u'40100',
u'likes': u'1'}

This example triggers this exception:
01:04:29 T:140367684941568 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type:
Error Contents: None object cannot be quoted
Traceback (most recent call last):
File "/home/javier/.xbmc/addons/script.artwork.downloader/default.py", line 823, in
Main()
File "/home/javier/.xbmc/addons/script.artwork.downloader/default.py", line 140, in __init__
self.download_artwork(mediaList, providers['movie_providers'])
File "/home/javier/.xbmc/addons/script.artwork.downloader/default.py", line 358, in download_artwork
temp_image_list = self.provider.get_image_list(currentmedia['id'])
File "/home/javier/.xbmc/addons/script.artwork.downloader/lib/provider/fanarttv.py", line 153, in get_image_list
image_list.append({'url': urllib.quote(item.get('url'), ':/'),
File "/usr/lib64/python2.7/urllib.py", line 1269, in quote
raise TypeError('None object cannot be quoted')
TypeError: None object cannot be quoted
-->End of Python script error report<--

The following changes should fix the issue.

Regards,