mirror of
https://github.com/Hopiu/django-embed-video.git
synced 2026-03-16 21:30:23 +00:00
Adding support for Vimeo channels (eg. Staff picks)
This commit is contained in:
parent
09f8aa1779
commit
943bbcb51c
2 changed files with 3 additions and 1 deletions
|
|
@ -291,7 +291,7 @@ class VimeoBackend(VideoBackend):
|
|||
re_detect = re.compile(
|
||||
r'^((http(s)?:)?//)?(www\.)?(player\.)?vimeo\.com/.*', re.I
|
||||
)
|
||||
re_code = re.compile(r'''vimeo\.com/(video/)?(?P<code>[0-9]+)''', re.I)
|
||||
re_code = re.compile(r'''vimeo\.com/(video/)?(channels/(.*/)?)?(?P<code>[0-9]+)''', re.I)
|
||||
pattern_url = '{protocol}://player.vimeo.com/video/{code}'
|
||||
pattern_info = '{protocol}://vimeo.com/api/v2/video/{code}.json'
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ class VimeoBackendTestCase(BackendTestMixin, TestCase):
|
|||
('https://www.vimeo.com/72304002', '72304002'),
|
||||
('http://player.vimeo.com/video/72304002', '72304002'),
|
||||
('https://player.vimeo.com/video/72304002', '72304002'),
|
||||
('http://www.vimeo.com/channels/staffpick/72304002', '72304002'),
|
||||
('https://www.vimeo.com/channels/staffpick/72304002', '72304002'),
|
||||
)
|
||||
|
||||
instance = VimeoBackend
|
||||
|
|
|
|||
Loading…
Reference in a new issue