From f4025b8546f92ba8648c54779b9cab156273fc4d Mon Sep 17 00:00:00 2001 From: sanj Date: Tue, 26 Oct 2010 01:42:50 +0200 Subject: [PATCH] more ugly fixes, youtube regex --- rizk/egypt/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rizk/egypt/models.py b/rizk/egypt/models.py index bd7ce0c..7fc6346 100644 --- a/rizk/egypt/models.py +++ b/rizk/egypt/models.py @@ -144,7 +144,11 @@ class YoutubeVideo(models.Model): def get_youtube_id(self): reg = r'http.*?v=(.*?)$' - return oxlib.findRe(self.url, reg) + id = oxlib.findRe(self.url, reg) + if id == '': + reg = r'http://.*?/user/.*?/u/.*?/(.*?)$' + id = oxlib.findRe(self.url, reg) + return id def get_dict(self): if self.youtubeData != '':