diff --git a/modules/dailymotion/backend.py b/modules/dailymotion/backend.py index 6fcd1122..87f1a798 100644 --- a/modules/dailymotion/backend.py +++ b/modules/dailymotion/backend.py @@ -17,9 +17,6 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . - - - from weboob.capabilities.video import ICapVideo, BaseVideo from weboob.capabilities.collection import ICapCollection, CollectionNotFound from weboob.tools.backend import BaseBackend diff --git a/modules/dailymotion/pages.py b/modules/dailymotion/pages.py index 4c9f5fd8..c425a05c 100644 --- a/modules/dailymotion/pages.py +++ b/modules/dailymotion/pages.py @@ -96,7 +96,6 @@ class VideoPage(BasePage): return video - def set_video_metadata(self, video): head = self.parser.select(self.document.getroot(), 'head', 1) @@ -133,7 +132,6 @@ class VideoPage(BasePage): except BrokenPageError: video.description = u'' - def set_video_url(self, video): embed_page = self.browser.readurl('http://www.dailymotion.com/embed/video/%s' % video.id) @@ -143,10 +141,10 @@ class VideoPage(BasePage): raise BrokenPageError('Unable to find information about video') info = json.loads(m.group(1)) - for key in ['stream_h264_hd1080_url','stream_h264_hd_url', - 'stream_h264_hq_url','stream_h264_url', + for key in ['stream_h264_hd1080_url', 'stream_h264_hd_url', + 'stream_h264_hq_url', 'stream_h264_url', 'stream_h264_ld_url']: - if info.get(key):#key in info and info[key]: + if info.get(key): max_quality = key break else: diff --git a/modules/dailymotion/test.py b/modules/dailymotion/test.py index adb782e1..6b90818b 100644 --- a/modules/dailymotion/test.py +++ b/modules/dailymotion/test.py @@ -51,7 +51,7 @@ class DailymotionTest(BackendTest): self.assertTrue(len(l) > 0) for elt in l[:10]: video_id = elt.id - video = self.backend.get_video(video_id) + video = self.backend.get_video(video_id) self.assertIsNotNone(video.title) if DailymotionTest.KIDS_VIDEO_TITLE in video.title: self.assertTrue(video.url and video.url.startswith('http://'), 'URL for video "%s" not found: %s' %