From 7decf8951cd500acc6ed7c9ad049996957e26d73 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Fri, 29 Mar 2013 15:59:13 +0100 Subject: [PATCH] fix FunnyOrDieIE, MyVideoIE, TEDIE --- youtube_dl/InfoExtractors.py | 8 ++++---- youtube_dl/utils.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py index 83cb321968..b3c3dbb438 100755 --- a/youtube_dl/InfoExtractors.py +++ b/youtube_dl/InfoExtractors.py @@ -2305,7 +2305,7 @@ def _real_extract(self,url): webpage = self._download_webpage(webpage_url, video_id) self.report_extraction(video_id) - mobj = re.search(r'', + mobj = re.search(r'\s+(?P.*?)</a>", webpage) + m = re.search(r"<h1 class='player_page_h1'.*?>(?P<title>.*?)</h1>", webpage, flags=re.DOTALL) if not m: self._downloader.trouble(u'Cannot find video title') - title = unescapeHTML(m.group('title')) + title = clean_html(m.group('title')) m = re.search(r'<meta property="og:description" content="(?P<desc>.*?)"', webpage) if m: @@ -4051,7 +4051,7 @@ def _talk_info(self, url, video_id=0): videoName=m.group('name') webpage=self._download_webpage(url, video_id, 'Downloading \"%s\" page' % videoName) # If the url includes the language we get the title translated - title_RE=r'<h1><span id="altHeadline" >(?P<title>.*)</span></h1>' + title_RE=r'<span id="altHeadline" >(?P<title>.*)</span>' title=re.search(title_RE, webpage).group('title') info_RE=r'''<script\ type="text/javascript">var\ talkDetails\ =(.*?) "id":(?P<videoID>[\d]+).*? diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 49af7d7c08..d366c41736 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -311,7 +311,7 @@ def clean_html(html): html = re.sub('<.*?>', '', html) # Replace html entities html = unescapeHTML(html) - return html + return html.strip() def sanitize_open(filename, open_mode):