Fix Vimeo thumbnails

This commit is contained in:
Juda Kaleta 2013-10-04 10:53:16 +02:00
parent 89ce012f36
commit 6cca79c281
2 changed files with 6 additions and 3 deletions

View file

@ -211,8 +211,6 @@ class VimeoBackend(VideoBackend):
pattern_url = 'http://player.vimeo.com/video/%s'
pattern_info = 'http://vimeo.com/api/v2/video/%s.json'
info = None
def init(self, url):
self._url = url
self.code = self.get_code()
@ -227,7 +225,7 @@ class VimeoBackend(VideoBackend):
raise VideoDoesntExistException()
def get_thumbnail_url(self):
return self.info['thumbnail_large']
return self.info.get('thumbnail_large')
class SoundCloudBackend(VideoBackend):

View file

@ -76,6 +76,11 @@ class VimeoBackendTestCase(BackendTestMixin, TestCase):
backend = VimeoBackend('http://vimeo.com/123')
backend.get_info()
def test_get_thumbnail_url(self):
backend = VimeoBackend('http://vimeo.com/72304002')
self.assertEqual(backend.get_thumbnail_url(),
'http://b.vimeocdn.com/ts/446/150/446150690_640.jpg')
class SoundCloudBackendTestCase(BackendTestMixin, TestCase):
urls = (