fix fillobj() on videos without thumbnails

This commit is contained in:
Romain Bignon 2011-04-23 09:22:25 +02:00
commit 203d540163
7 changed files with 8 additions and 8 deletions

View file

@ -59,7 +59,7 @@ class ArteBackend(BaseBackend, ICapVideo):
# if we don't want only the thumbnail, we probably want also every fields
with self.browser:
video = self.browser.get_video(ArteVideo.id2url(video.id), video)
if 'thumbnail' in fields:
if 'thumbnail' in fields and video.thumbnail:
with self.browser:
video.thumbnail.data = self.browser.readurl(video.thumbnail.url)

View file

@ -59,7 +59,7 @@ class CanalplusBackend(BaseBackend, ICapVideo, ICapCollection):
# if we don't want only the thumbnail, we probably want also every fields
with self.browser:
video = self.browser.get_video(CanalplusVideo.id2url(video.id), video)
if 'thumbnail' in fields:
if 'thumbnail' in fields and video.thumbnail:
with self.browser:
video.thumbnail.data = self.browser.readurl(video.thumbnail.url)
return video

View file

@ -53,7 +53,7 @@ class DailymotionBackend(BaseBackend, ICapVideo):
# if we don't want only the thumbnail, we probably want also every fields
with self.browser:
video = self.browser.get_video(DailymotionVideo.id2url(video.id), video)
if 'thumbnail' in fields:
if 'thumbnail' in fields and video.thumbnail:
with self.browser:
video.thumbnail.data = self.browser.readurl(video.thumbnail.url)

View file

@ -51,7 +51,7 @@ class InaBackend(BaseBackend, ICapVideo):
# if we don't want only the thumbnail, we probably want also every fields
with self.browser:
video = self.browser.get_video(video.id, video)
if 'thumbnail' in fields:
if 'thumbnail' in fields and video.thumbnail:
with self.browser:
video.thumbnail.data = self.browser.readurl(video.thumbnail.url)

View file

@ -32,8 +32,8 @@ class KickassBrowser(BaseBrowser):
ENCODING = 'utf-8'
USER_AGENT = BaseBrowser.USER_AGENTS['wget']
PAGES = {
'http://fr.kickasstorrents.com/new/.*field=seeders&sorder=desc': TorrentsPage,
'http://fr.kickasstorrents.com/.*.html': TorrentPage,
'http://fr.(kickasstorrents.com|kat.ph)/new/.*field=seeders&sorder=desc': TorrentsPage,
'http://fr.(kickasstorrents.com|kat.ph)/.*.html': TorrentPage,
}
def home(self):

View file

@ -55,7 +55,7 @@ class YoujizzBackend(BaseBackend, ICapVideo):
# if we don't want only the thumbnail, we probably want also every fields
with self.browser:
video = self.browser.get_video(YoujizzVideo.id2url(video.id), video)
if 'thumbnail' in fields:
if 'thumbnail' in fields and video.thumbnail:
with self.browser:
video.thumbnail.data = self.browser.readurl(video.thumbnail.url)

View file

@ -55,7 +55,7 @@ class YoupornBackend(BaseBackend, ICapVideo):
# if we don't want only the thumbnail, we probably want also every fields
with self.browser:
video = self.browser.get_video(YoupornVideo.id2url(video.id), video)
if 'thumbnail' in fields:
if 'thumbnail' in fields and video.thumbnail:
with self.browser:
video.thumbnail.data = self.browser.readurl(video.thumbnail.url)