From 93592862b520a862c01f80c019e5c4bc43746c19 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 16:54:20 +0200 Subject: [SimpleHoster] Better inline docs + changed "FILE_OFFLINE_PATTERN" to "OFFLINE_PATTERN" --- module/plugins/hoster/OneFichierCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/OneFichierCom.py') diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 41f3e4b11..2c842d77b 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -20,7 +20,7 @@ class OneFichierCom(SimpleHoster): FILE_NAME_PATTERN = r'">Filename :\s*(?P[^<]+)' FILE_SIZE_PATTERN = r'Size :\s*(?P[^<]+)' - FILE_OFFLINE_PATTERN = r'The (requested)? file (could not be found|has been deleted)' + OFFLINE_PATTERN = r'The (requested)? file (could not be found|has been deleted)' FILE_URL_REPLACEMENTS = [(__pattern__, r'http://\g.\g/en/')] -- cgit v1.2.3 From 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:02:26 +0200 Subject: Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics --- module/plugins/hoster/OneFichierCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/OneFichierCom.py') diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 2c842d77b..2d539f851 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -24,8 +24,8 @@ class OneFichierCom(SimpleHoster): FILE_URL_REPLACEMENTS = [(__pattern__, r'http://\g.\g/en/')] - WAITING_PATTERN = "Warning ! Without premium status, you must wait between each downloads" - NOT_PARALLEL = r"Warning ! Without premium status, you can download only one file at a time" + WAITING_PATTERN = r'Warning ! Without premium status, you must wait between each downloads' + NOT_PARALLEL = r'Warning ! Without premium status, you can download only one file at a time' WAIT_TIME = 10 * 60 # Retry time between each free download RETRY_TIME = 15 * 60 # Default retry time in seconds (if detected parallel download) -- cgit v1.2.3 From 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:25:41 +0200 Subject: Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics --- module/plugins/hoster/OneFichierCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/OneFichierCom.py') diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 2d539f851..e43f807a2 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -83,4 +83,5 @@ class OneFichierCom(SimpleHoster): self.retry() + getInfo = create_getInfo(OneFichierCom) -- cgit v1.2.3 From 9395182da7afed55a29bde1c7cbefe4204e783f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/hoster/OneFichierCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/OneFichierCom.py') diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index e43f807a2..2a98a97dc 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -40,8 +40,8 @@ class OneFichierCom(SimpleHoster): self.logInfo('You have to wait been each free download! Retrying in %d seconds.' % self.WAIT_TIME) self.waitAndRetry(self.WAIT_TIME) else: # detect parallel download - found = re.search(self.NOT_PARALLEL, self.html) - if found: + m = re.search(self.NOT_PARALLEL, self.html) + if m: self.waitAndRetry(self.RETRY_TIME) url, inputs = self.parseHtmlForm('action="http://%s' % self.file_info['id']) -- 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/hoster/OneFichierCom.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/OneFichierCom.py') diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 2a98a97dc..0536f7185 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- - -# Test links (random.bin): +# +# Test links: # http://5pnm24ltcw.1fichier.com/ import re @@ -11,8 +11,10 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class OneFichierCom(SimpleHoster): __name__ = "OneFichierCom" __type__ = "hoster" - __pattern__ = r'(http://(?P\w+)\.(?P(1fichier|d(es)?fichiers|pjointe)\.(com|fr|net|org)|(cjoint|mesfichiers|piecejointe|oi)\.(org|net)|tenvoi\.(com|org|net)|dl4free\.com|alterupload\.com|megadl.fr))/?' __version__ = "0.61" + + __pattern__ = r'(http://(?P\w+)\.(?P(1fichier|d(es)?fichiers|pjointe)\.(com|fr|net|org)|(cjoint|mesfichiers|piecejointe|oi)\.(org|net)|tenvoi\.(com|org|net)|dl4free\.com|alterupload\.com|megadl.fr))/?' + __description__ = """1fichier.com hoster plugin""" __author_name__ = ("fragonib", "the-razer", "zoidberg", "imclem", "stickell", "Elrick69") __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "daniel_ AT gmx DOT net", "zoidberg@mujmail.cz", @@ -29,6 +31,7 @@ class OneFichierCom(SimpleHoster): WAIT_TIME = 10 * 60 # Retry time between each free download RETRY_TIME = 15 * 60 # Default retry time in seconds (if detected parallel download) + def setup(self): self.multiDL = self.premium self.resumeDownload = True @@ -48,14 +51,14 @@ class OneFichierCom(SimpleHoster): if not url: self.parseError("Download link not found") - # Check for protection + # Check for protection if "pass" in inputs: inputs['pass'] = self.getPassword() inputs['submit'] = "Download" self.download(url, post=inputs) - # Check download + # Check download self.checkDownloadedFile() def handlePremium(self): -- cgit v1.2.3