Commit 057aa7e6 authored by Vincent Texier's avatar Vincent Texier Committed by Romain Bignon

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

parent b4500985
......@@ -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.
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment