From 48c0c42fd6faffc56432d5f037cd575979f180cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/crypter/DailymotionBatch.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/crypter/DailymotionBatch.py') diff --git a/module/plugins/crypter/DailymotionBatch.py b/module/plugins/crypter/DailymotionBatch.py index 5c0dd9cec..e13f267f4 100644 --- a/module/plugins/crypter/DailymotionBatch.py +++ b/module/plugins/crypter/DailymotionBatch.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: Walter Purcaro """ from urlparse import urljoin -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/crypter/DailymotionBatch.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'module/plugins/crypter/DailymotionBatch.py') diff --git a/module/plugins/crypter/DailymotionBatch.py b/module/plugins/crypter/DailymotionBatch.py index e13f267f4..d9309af90 100644 --- a/module/plugins/crypter/DailymotionBatch.py +++ b/module/plugins/crypter/DailymotionBatch.py @@ -45,8 +45,8 @@ class DailymotionBatch(Crypter): if "error" in playlist: return - name = playlist["name"] - owner = playlist["owner.screenname"] + name = playlist['name'] + owner = playlist['owner.screenname'] return name, owner def _getPlaylists(self, user_id, page=1): @@ -57,10 +57,10 @@ class DailymotionBatch(Crypter): if "error" in user: return - for playlist in user["list"]: - yield playlist["id"] + for playlist in user['list']: + yield playlist['id'] - if user["has_more"]: + if user['has_more']: for item in self._getPlaylists(user_id, page + 1): yield item @@ -75,10 +75,10 @@ class DailymotionBatch(Crypter): if "error" in playlist: return - for video in playlist["list"]: - yield video["url"] + for video in playlist['list']: + yield video['url'] - if playlist["has_more"]: + if playlist['has_more']: for item in self._getVideos(id, page + 1): yield item -- cgit v1.2.3 From 8e47b0de30a25d0fd5dfb518bfe4e1e7beff93fd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:27:44 +0200 Subject: Key attributes cleanup for account, container and crypter plugins --- module/plugins/crypter/DailymotionBatch.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/DailymotionBatch.py') diff --git a/module/plugins/crypter/DailymotionBatch.py b/module/plugins/crypter/DailymotionBatch.py index d9309af90..c86c966d8 100644 --- a/module/plugins/crypter/DailymotionBatch.py +++ b/module/plugins/crypter/DailymotionBatch.py @@ -25,13 +25,16 @@ from module.utils import save_join class DailymotionBatch(Crypter): __name__ = "DailymotionBatch" + __version__ = "0.01" __type__ = "crypter" + __pattern__ = r'https?://(?:www\.)?dailymotion\.com/((playlists/)?(?Pplaylist|user)/)?(?P[\w^_]+)(?(TYPE)|#)' - __version__ = "0.01" + __description__ = """Dailymotion.com channel & playlist decrypter""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" + def api_response(self, ref, req=None): url = urljoin("https://api.dailymotion.com/", ref) page = self.load(url, get=req) -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/crypter/DailymotionBatch.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'module/plugins/crypter/DailymotionBatch.py') diff --git a/module/plugins/crypter/DailymotionBatch.py b/module/plugins/crypter/DailymotionBatch.py index c86c966d8..e43d4e1fd 100644 --- a/module/plugins/crypter/DailymotionBatch.py +++ b/module/plugins/crypter/DailymotionBatch.py @@ -1,22 +1,8 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" +import re from urlparse import urljoin -import re from module.common.json_layer import json_loads from module.plugins.Crypter import Crypter @@ -25,8 +11,8 @@ from module.utils import save_join class DailymotionBatch(Crypter): __name__ = "DailymotionBatch" - __version__ = "0.01" __type__ = "crypter" + __version__ = "0.01" __pattern__ = r'https?://(?:www\.)?dailymotion\.com/((playlists/)?(?Pplaylist|user)/)?(?P[\w^_]+)(?(TYPE)|#)' -- cgit v1.2.3