Regex for youtube now handles more youtube urls correctly

- rev bump
This commit is contained in:
techdragon 2013-07-27 19:09:17 +08:00
parent 7a2b67efaf
commit 63025f8f48
2 changed files with 3 additions and 2 deletions

View file

@ -94,7 +94,8 @@ class SoundCloundBackend(VideoBackend):
class YoutubeBackend(VideoBackend):
re_code = re.compile(
r'youtu(?:be\.com/watch\?v=|\.be/)(?P<code>[\w-]*)(&(amp;)?[\w\?=]*)?',
r'(?:http|https|)(?::\/\/|)(?:www.|)(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))(?P<code>[\w\-]{11})[a-z0-9;:@?&%=+\/\$_.-]*',
# r'youtu(?:be\.com/watch\?v=|\.be/)(?P<code>[\w-]*)(&(amp;)?[\w\?=]*)?',
re.I
)
pattern_url = 'http://www.youtube.com/embed/%s?wmode=opaque'

View file

@ -12,7 +12,7 @@ CHANGES = read('CHANGES.rst')
setup(
name='django-embed-video',
packages=find_packages(),
version='0.2.0',
version='0.2.1',
author='Juda Kaleta',
author_email='juda.kaleta@gmail.com',
url='https://github.com/yetty/django-embed-video',