fix bugs in daily motion video page (closes #1320)

This commit is contained in:
Vincent Texier 2014-01-02 22:31:46 +01:00 committed by Romain Bignon
commit 057aa7e684
2 changed files with 5 additions and 4 deletions

View file

@ -131,7 +131,7 @@ Jean-Philippe Dutrève <jdutreve@winancial.com>
* Fixes on bank modules.
Vincent Texier <vit@free.fr>
* Fixes on YouJizz.
* Fixes on YouJizz and Dailymotion.
Mathieu Lordon <mathieu.lordon@gmail.com>
* Fixes on bank modules.

View file

@ -88,10 +88,10 @@ class VideoPage(BasePage):
div = self.parser.select(self.document.getroot(), 'div#content', 1)
video.title = unicode(self.parser.select(div, 'span.title', 1).text).strip()
video.author = unicode(self.parser.select(div, 'a.name, span.name, a[rel=author]', 1).text).strip()
video.title = unicode(self.parser.select(div, 'div, meta[itemprop=name]', 1).get("content")).strip()
video.author = unicode(self.parser.select(div, 'div, meta[itemprop=author]', 1).get("content")).strip()
try:
video.description = html2text(self.parser.tostring(self.parser.select(div, 'div#video_description', 1))).strip() or unicode()
video.description = html2text(self.parser.tostring(self.parser.select(div, 'div, meta[itemprop=description]', 1))).strip() or unicode()
except BrokenPageError:
video.description = u''
@ -110,6 +110,7 @@ class VideoPage(BasePage):
break
else:
raise BrokenPageError(u'Unable to extract video URL')
video.url = info[max_quality]
video.set_empty_fields(NotAvailable)