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/DateiTo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 223138592..73f2f224f 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -33,7 +33,7 @@ class DateiTo(SimpleHoster): FILE_NAME_PATTERN = r'Dateiname:\s*(?P.*?)\s*(?P.*?)Datei wurde nicht gefunden<|>Bitte wähle deine Datei aus... <' + OFFLINE_PATTERN = r'>Datei wurde nicht gefunden<|>Bitte wähle deine Datei aus... <' PARALELL_PATTERN = r'>Du lädst bereits eine Datei herunter<' WAIT_PATTERN = r'countdown\({seconds: (\d+)' -- cgit v1.2.3 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/hoster/DateiTo.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 73f2f224f..906e5634a 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.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: zoidberg """ import re -- cgit v1.2.3 From 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:25:14 +0200 Subject: Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 --- module/plugins/hoster/DateiTo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 906e5634a..160e8aaf5 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -57,7 +57,7 @@ class DateiTo(SimpleHoster): break found = re.search(self.DATA_PATTERN, self.html) - if not found: + if found is None: self.parseError('data') url = 'http://datei.to/' + found.group(1) data = dict(x.split('=') for x in found.group(2).split('&')) -- 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/DateiTo.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 160e8aaf5..4d39b178e 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -56,15 +56,15 @@ class DateiTo(SimpleHoster): elif data['P'] == 'IV': break - found = re.search(self.DATA_PATTERN, self.html) - if found is None: + m = re.search(self.DATA_PATTERN, self.html) + if m is None: self.parseError('data') - url = 'http://datei.to/' + found.group(1) - data = dict(x.split('=') for x in found.group(2).split('&')) + url = 'http://datei.to/' + m.group(1) + data = dict(x.split('=') for x in m.group(2).split('&')) if url.endswith('recaptcha.php'): - found = re.search(self.RECAPTCHA_KEY_PATTERN, self.html) - recaptcha_key = found.group(1) if found else "6LdBbL8SAAAAAI0vKUo58XRwDd5Tu_Ze1DA7qTao" + m = re.search(self.RECAPTCHA_KEY_PATTERN, self.html) + recaptcha_key = m.group(1) if m else "6LdBbL8SAAAAAI0vKUo58XRwDd5Tu_Ze1DA7qTao" data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge(recaptcha_key) @@ -76,16 +76,16 @@ class DateiTo(SimpleHoster): self.download(download_url) def checkErrors(self): - found = re.search(self.PARALELL_PATTERN, self.html) - if found: - found = re.search(self.WAIT_PATTERN, self.html) - wait_time = int(found.group(1)) if found else 30 + m = re.search(self.PARALELL_PATTERN, self.html) + if m: + m = re.search(self.WAIT_PATTERN, self.html) + wait_time = int(m.group(1)) if m else 30 self.wait(wait_time + 1, False) self.retry() def doWait(self): - found = re.search(self.WAIT_PATTERN, self.html) - wait_time = int(found.group(1)) if found else 30 + m = re.search(self.WAIT_PATTERN, self.html) + wait_time = int(m.group(1)) if m else 30 self.load('http://datei.to/ajax/download.php', post={'P': 'Ads'}) self.wait(wait_time + 1, False) -- 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/DateiTo.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 4d39b178e..ff8c430ee 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -1,30 +1,18 @@ # -*- 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 module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + from module.plugins.internal.CaptchaService import ReCaptcha +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DateiTo(SimpleHoster): __name__ = "DateiTo" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?datei\.to/datei/(?P\w+)\.html' __version__ = "0.02" + + __pattern__ = r'http://(?:www\.)?datei\.to/datei/(?P\w+)\.html' + __description__ = """Datei.to hoster plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" @@ -38,6 +26,7 @@ class DateiTo(SimpleHoster): DATA_PATTERN = r'url: "(.*?)", data: "(.*?)",' RECAPTCHA_KEY_PATTERN = r'Recaptcha.create\("(.*?)"' + def handleFree(self): url = 'http://datei.to/ajax/download.php' data = {'P': 'I', 'ID': self.file_info['ID']} -- cgit v1.2.3 From 0d220d634e512d89bda540f91c643b361c82ea8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 01:38:32 +0200 Subject: Logging string cosmetics --- module/plugins/hoster/DateiTo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index ff8c430ee..c5155dc31 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -61,7 +61,7 @@ class DateiTo(SimpleHoster): self.fail('Too bad...') download_url = self.html - self.logDebug('Download URL', download_url) + self.logDebug("Download URL", download_url) self.download(download_url) def checkErrors(self): -- cgit v1.2.3 From 23ae563604dca1dae262fbc598154b99b2f1eae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 3 Oct 2014 09:06:05 +0200 Subject: Update plugins after CaptchaService and XFileSharingPro changes --- module/plugins/hoster/DateiTo.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index c5155dc31..b57cdebc7 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -24,7 +24,6 @@ class DateiTo(SimpleHoster): WAIT_PATTERN = r'countdown\({seconds: (\d+)' DATA_PATTERN = r'url: "(.*?)", data: "(.*?)",' - RECAPTCHA_KEY_PATTERN = r'Recaptcha.create\("(.*?)"' def handleFree(self): @@ -52,10 +51,11 @@ class DateiTo(SimpleHoster): data = dict(x.split('=') for x in m.group(2).split('&')) if url.endswith('recaptcha.php'): - m = re.search(self.RECAPTCHA_KEY_PATTERN, self.html) - recaptcha_key = m.group(1) if m else "6LdBbL8SAAAAAI0vKUo58XRwDd5Tu_Ze1DA7qTao" + captcha_key = recaptcha.detect_key() + if captcha_key is None: + self.parseError("ReCaptcha key not found") - data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge(recaptcha_key) + data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge(captcha_key) else: self.fail('Too bad...') -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/hoster/DateiTo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index b57cdebc7..79de07089 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -14,8 +14,8 @@ class DateiTo(SimpleHoster): __pattern__ = r'http://(?:www\.)?datei\.to/datei/(?P\w+)\.html' __description__ = """Datei.to hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + FILE_NAME_PATTERN = r'Dateiname:\s*(?P.*?)\s*(?P.*?) Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hoster/DateiTo.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 79de07089..400fa416f 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -14,6 +14,7 @@ class DateiTo(SimpleHoster): __pattern__ = r'http://(?:www\.)?datei\.to/datei/(?P\w+)\.html' __description__ = """Datei.to hoster plugin""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] -- cgit v1.2.3 From 2ae91b81a2f12a1c9b1f78524df78a2b3f1ef494 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Oct 2014 14:52:42 +0200 Subject: Update hosters to self.error --- module/plugins/hoster/DateiTo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 400fa416f..06a485eae 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DateiTo(SimpleHoster): __name__ = "DateiTo" __type__ = "hoster" - __version__ = "0.02" + __version__ = "0.03" __pattern__ = r'http://(?:www\.)?datei\.to/datei/(?P\w+)\.html' @@ -47,14 +47,14 @@ class DateiTo(SimpleHoster): m = re.search(self.DATA_PATTERN, self.html) if m is None: - self.parseError('data') + self.error('data') url = 'http://datei.to/' + m.group(1) data = dict(x.split('=') for x in m.group(2).split('&')) if url.endswith('recaptcha.php'): captcha_key = recaptcha.detect_key() if captcha_key is None: - self.parseError("ReCaptcha key not found") + self.error("ReCaptcha key not found") data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge(captcha_key) -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/hoster/DateiTo.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 06a485eae..93840b108 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -65,6 +65,7 @@ class DateiTo(SimpleHoster): self.logDebug("Download URL", download_url) self.download(download_url) + def checkErrors(self): m = re.search(self.PARALELL_PATTERN, self.html) if m: @@ -73,6 +74,7 @@ class DateiTo(SimpleHoster): self.wait(wait_time + 1, False) self.retry() + def doWait(self): m = re.search(self.WAIT_PATTERN, self.html) wait_time = int(m.group(1)) if m else 30 -- cgit v1.2.3 From 7b67f68c1636014fe02286da71bdc6c13dc3eeee Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 23 Oct 2014 00:50:23 +0200 Subject: Simplify captcha challenge calls --- module/plugins/hoster/DateiTo.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 93840b108..07033a203 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -30,7 +30,6 @@ class DateiTo(SimpleHoster): def handleFree(self): url = 'http://datei.to/ajax/download.php' data = {'P': 'I', 'ID': self.file_info['ID']} - recaptcha = ReCaptcha(self) for _ in xrange(10): @@ -52,12 +51,7 @@ class DateiTo(SimpleHoster): data = dict(x.split('=') for x in m.group(2).split('&')) if url.endswith('recaptcha.php'): - captcha_key = recaptcha.detect_key() - if captcha_key is None: - self.error("ReCaptcha key not found") - - data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge(captcha_key) - + data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge() else: self.fail('Too bad...') -- cgit v1.2.3 From 4da90891eb2544ac15a7d512aba8cb357f68ee5f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 01:11:29 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/DateiTo.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 07033a203..1a2e78ef3 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -56,7 +56,6 @@ class DateiTo(SimpleHoster): self.fail('Too bad...') download_url = self.html - self.logDebug("Download URL", download_url) self.download(download_url) -- cgit v1.2.3 From e3f5280529921100f48bb8a79853bf480c7611e4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 02:53:05 +0200 Subject: Replace single quotes with doubles in self.error and self.fail msg --- module/plugins/hoster/DateiTo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 1a2e78ef3..5440927e1 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -46,14 +46,14 @@ class DateiTo(SimpleHoster): m = re.search(self.DATA_PATTERN, self.html) if m is None: - self.error('data') + self.error("data") url = 'http://datei.to/' + m.group(1) data = dict(x.split('=') for x in m.group(2).split('&')) if url.endswith('recaptcha.php'): data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge() else: - self.fail('Too bad...') + self.fail("Too bad...") download_url = self.html self.download(download_url) -- cgit v1.2.3 From 1c4bf83881d2a22da3773666a580d51f6b57bfd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 03:07:21 +0200 Subject: Avoid gettext conflict due variable `_` --- module/plugins/hoster/DateiTo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 5440927e1..73e48d129 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -32,7 +32,7 @@ class DateiTo(SimpleHoster): data = {'P': 'I', 'ID': self.file_info['ID']} recaptcha = ReCaptcha(self) - for _ in xrange(10): + for _i in xrange(10): self.logDebug("URL", url, "POST", data) self.html = self.load(url, post=data) self.checkErrors() -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/hoster/DateiTo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 73e48d129..4eed41496 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -46,14 +46,14 @@ class DateiTo(SimpleHoster): m = re.search(self.DATA_PATTERN, self.html) if m is None: - self.error("data") + self.error(_("data")) url = 'http://datei.to/' + m.group(1) data = dict(x.split('=') for x in m.group(2).split('&')) if url.endswith('recaptcha.php'): data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge() else: - self.fail("Too bad...") + self.fail(_("Too bad...")) download_url = self.html self.download(download_url) -- cgit v1.2.3 From 8b3589dd394d81177bf4680dddb5bdb9506b89ea Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:04:10 +0100 Subject: Update plugins to last changes --- module/plugins/hoster/DateiTo.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 4eed41496..821be580f 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -64,8 +64,7 @@ class DateiTo(SimpleHoster): if m: m = re.search(self.WAIT_PATTERN, self.html) wait_time = int(m.group(1)) if m else 30 - self.wait(wait_time + 1, False) - self.retry() + self.retry(wait_time=wait_time) def doWait(self): @@ -73,7 +72,7 @@ class DateiTo(SimpleHoster): wait_time = int(m.group(1)) if m else 30 self.load('http://datei.to/ajax/download.php', post={'P': 'Ads'}) - self.wait(wait_time + 1, False) + self.wait(wait_time, False) getInfo = create_getInfo(DateiTo) -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hoster/DateiTo.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 821be580f..f004462e8 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -7,15 +7,15 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DateiTo(SimpleHoster): - __name__ = "DateiTo" - __type__ = "hoster" + __name__ = "DateiTo" + __type__ = "hoster" __version__ = "0.03" __pattern__ = r'http://(?:www\.)?datei\.to/datei/(?P\w+)\.html' __description__ = """Datei.to hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] FILE_NAME_PATTERN = r'Dateiname:\s*(?P.*?) Date: Sun, 2 Nov 2014 22:47:07 +0100 Subject: Update all other plugins --- module/plugins/hoster/DateiTo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index f004462e8..8c51fbac4 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -18,8 +18,8 @@ class DateiTo(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - FILE_NAME_PATTERN = r'Dateiname:\s*(?P.*?)\s*(?P.*?)\s*(?P.*?)\s*(?P.*?)Datei wurde nicht gefunden<|>Bitte wähle deine Datei aus... <' PARALELL_PATTERN = r'>Du lädst bereits eine Datei herunter<' -- cgit v1.2.3 From 03f3b86f500c495932fd118b54569d92f700847c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 3 Nov 2014 16:57:55 +0100 Subject: Code cosmetics about file_info and other stuff --- module/plugins/hoster/DateiTo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 8c51fbac4..9d51b5036 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DateiTo(SimpleHoster): __name__ = "DateiTo" __type__ = "hoster" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = r'http://(?:www\.)?datei\.to/datei/(?P\w+)\.html' @@ -29,7 +29,7 @@ class DateiTo(SimpleHoster): def handleFree(self): url = 'http://datei.to/ajax/download.php' - data = {'P': 'I', 'ID': self.file_info['ID']} + data = {'P': 'I', 'ID': self.info['ID']} recaptcha = ReCaptcha(self) for _i in xrange(10): -- cgit v1.2.3 From 86d3b6249073947132ed3a9eeb1b1e987d19569a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 1 Dec 2014 18:17:13 +0100 Subject: Update some plugins --- module/plugins/hoster/DateiTo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 9d51b5036..683c6b75d 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DateiTo(SimpleHoster): __name__ = "DateiTo" __type__ = "hoster" - __version__ = "0.04" + __version__ = "0.05" __pattern__ = r'http://(?:www\.)?datei\.to/datei/(?P\w+)\.html' @@ -29,7 +29,7 @@ class DateiTo(SimpleHoster): def handleFree(self): url = 'http://datei.to/ajax/download.php' - data = {'P': 'I', 'ID': self.info['ID']} + data = {'P': 'I', 'ID': self.info['pattern']['ID']} recaptcha = ReCaptcha(self) for _i in xrange(10): -- cgit v1.2.3 From 5a23de6f32dc99960cccd634d2fd2cc47c34be2a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 5 Dec 2014 23:08:44 +0100 Subject: Code cosmetics about checkErrors --- module/plugins/hoster/DateiTo.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'module/plugins/hoster/DateiTo.py') diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 683c6b75d..e4bff8458 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -18,12 +18,13 @@ class DateiTo(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - NAME_PATTERN = r'Dateiname:\s*(?P.*?)\s*(?P.*?)\s*(?P.*?)\s*(?P.*?)Datei wurde nicht gefunden<|>Bitte wähle deine Datei aus... <' - PARALELL_PATTERN = r'>Du lädst bereits eine Datei herunter<' - WAIT_PATTERN = r'countdown\({seconds: (\d+)' + WAIT_PATTERN = r'countdown\({seconds: (\d+)' + MULTIDL_PATTERN = r'>Du lädst bereits eine Datei herunter<' + DATA_PATTERN = r'url: "(.*?)", data: "(.*?)",' @@ -55,16 +56,19 @@ class DateiTo(SimpleHoster): else: self.fail(_("Too bad...")) - download_url = self.html - self.download(download_url) + self.download(self.html) def checkErrors(self): - m = re.search(self.PARALELL_PATTERN, self.html) + m = re.search(self.MULTIDL_PATTERN, self.html) if m: m = re.search(self.WAIT_PATTERN, self.html) wait_time = int(m.group(1)) if m else 30 - self.retry(wait_time=wait_time) + + errmsg = self.info['error'] = _("Parallel downloads") + self.retry(wait_time=wait_time, reason=errmsg) + + self.info.pop('error', None) def doWait(self): -- cgit v1.2.3