From 057aa7e684814905aa2b8150b66b1d702791f806 Mon Sep 17 00:00:00 2001 From: Vincent Texier Date: Thu, 2 Jan 2014 22:31:46 +0100 Subject: [PATCH] fix bugs in daily motion video page (closes #1320) --- AUTHORS | 2 +- modules/dailymotion/pages.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index 5d8fcbf257..cef29c64c4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -131,7 +131,7 @@ Jean-Philippe Dutrève * Fixes on bank modules. Vincent Texier - * Fixes on YouJizz. + * Fixes on YouJizz and Dailymotion. Mathieu Lordon * Fixes on bank modules. diff --git a/modules/dailymotion/pages.py b/modules/dailymotion/pages.py index 6939f74b4b..ec3e0abf8c 100644 --- a/modules/dailymotion/pages.py +++ b/modules/dailymotion/pages.py @@ -88,10 +88,10 @@ def get_video(self, video=None): 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 @@ def get_video(self, video=None): break else: raise BrokenPageError(u'Unable to extract video URL') + video.url = info[max_quality] video.set_empty_fields(NotAvailable) -- GitLab