mirror of
https://github.com/Hopiu/django-embed-video.git
synced 2026-05-28 13:48:16 +00:00
Fix Vimeo thumbnails
This commit is contained in:
parent
89ce012f36
commit
6cca79c281
2 changed files with 6 additions and 3 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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 = (
|
||||
|
|
|
|||
Loading…
Reference in a new issue