From c5a088d341e3aeaf65fbca02523c02ff3bccee6e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rog=C3=A9rio=20Brito?= Date: Sat, 29 Jan 2011 04:13:54 -0200 Subject: [PATCH] Use non-greedy regexps, for safety. Since I was very lazy when I coded this, I took the fastest route. Luckily, Vasyl' Vavrychuk pointed this out and I went (after many months) and just did some minor changes. --- youtube-dl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/youtube-dl b/youtube-dl index edd1d3f..e745906 100755 --- a/youtube-dl +++ b/youtube-dl @@ -1765,21 +1765,21 @@ class VimeoIE(InfoExtractor): # Extract uploader and title from webpage self.report_extraction(video_id) - mobj = re.search(r'(.*)', webpage) + mobj = re.search(r'(.*?)', webpage) if mobj is None: self._downloader.trouble(u'ERROR: unable to extract video title') return video_title = mobj.group(1).decode('utf-8') simple_title = re.sub(ur'(?u)([^%s]+)' % simple_title_chars, ur'_', video_title) - mobj = re.search(r'http://vimeo.com/(.*)', webpage) + mobj = re.search(r'http://vimeo.com/(.*?)', webpage) if mobj is None: self._downloader.trouble(u'ERROR: unable to extract video uploader') return video_uploader = mobj.group(1).decode('utf-8') # Extract video thumbnail - mobj = re.search(r'(.*)', webpage) + mobj = re.search(r'(.*?)', webpage) if mobj is None: self._downloader.trouble(u'ERROR: unable to extract video thumbnail') return @@ -1795,14 +1795,14 @@ class VimeoIE(InfoExtractor): video_description = 'Foo.' # Extract request signature - mobj = re.search(r'(.*)', webpage) + mobj = re.search(r'(.*?)', webpage) if mobj is None: self._downloader.trouble(u'ERROR: unable to extract request signature') return sig = mobj.group(1).decode('utf-8') # Extract request signature expiration - mobj = re.search(r'(.*)', webpage) + mobj = re.search(r'(.*?)', webpage) if mobj is None: self._downloader.trouble(u'ERROR: unable to extract request signature expiration') return -- 1.8.3.1