From fd105f8e51768ec1943cda2375bdfdbe5b0a3951 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 9 Jan 2015 00:35:51 +0100 Subject: "New Year" Update: hoster plugins --- module/plugins/hoster/FileSharkPl.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/FileSharkPl.py') diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index 5250a92fe..d686be480 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FileSharkPl(SimpleHoster): __name__ = "FileSharkPl" __type__ = "hoster" - __version__ = "0.05" + __version__ = "0.06" __pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d{6}/\w{5}' @@ -73,13 +73,13 @@ class FileSharkPl(SimpleHoster): #@NOTE: handlePremium method was never been tested - def handlePremium(self): - super(FilerNet, self).handlePremium() + def handlePremium(self, pyfile): + super(FilerNet, self).handlePremium(pyfile) if self.link: self.link = urljoin("http://fileshark.pl/", self.link) - def handleFree(self): + def handleFree(self, pyfile): m = re.search(self.LINK_FREE_PATTERN, self.html) if m is None: self.error(_("Download url not found")) @@ -116,8 +116,6 @@ class FileSharkPl(SimpleHoster): def checkFile(self): - super(FileSharkPl, self).checkFile() - check = self.checkDownload({'wrong_captcha': re.compile(r''), 'wait_pattern' : re.compile(self.SECONDS_PATTERN), 'DL-found' : re.compile('')}) @@ -132,6 +130,8 @@ class FileSharkPl(SimpleHoster): elif check == "wait_pattern": self.retry() + return super(FileSharkPl, self).checkFile() + def _decode64(self, data, *args, **kwargs): return data.decode("base64") -- cgit v1.2.3 From bb91105bd2b5de67fd30a9d7fb77b73ca7740fd8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 13 Jan 2015 22:41:40 +0100 Subject: [FileSharkPl] Fix https://github.com/pyload/pyload/issues/1040 --- module/plugins/hoster/FileSharkPl.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'module/plugins/hoster/FileSharkPl.py') diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index d686be480..252270c4b 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -10,9 +10,9 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FileSharkPl(SimpleHoster): __name__ = "FileSharkPl" __type__ = "hoster" - __version__ = "0.06" + __version__ = "0.07" - __pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d{6}/\w{5}' + __pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d+/\w+' __description__ = """FileShark.pl hoster plugin""" __license__ = "GPLv3" @@ -39,6 +39,7 @@ class FileSharkPl(SimpleHoster): def setup(self): self.resumeDownload = True + if self.premium: self.multiDL = True self.limitDL = 20 @@ -53,7 +54,7 @@ class FileSharkPl(SimpleHoster): errmsg = self.info['error'] = _("Another download already run") self.retry(15, int(m.group(1)), errmsg) - m = re.search(self.ERROR_PATTERN, self.html): + m = re.search(self.ERROR_PATTERN, self.html) if m: alert = m.group(1) @@ -72,13 +73,6 @@ class FileSharkPl(SimpleHoster): self.info.pop('error', None) - #@NOTE: handlePremium method was never been tested - def handlePremium(self, pyfile): - super(FilerNet, self).handlePremium(pyfile) - if self.link: - self.link = urljoin("http://fileshark.pl/", self.link) - - def handleFree(self, pyfile): m = re.search(self.LINK_FREE_PATTERN, self.html) if m is None: @@ -119,7 +113,6 @@ class FileSharkPl(SimpleHoster): check = self.checkDownload({'wrong_captcha': re.compile(r''), 'wait_pattern' : re.compile(self.SECONDS_PATTERN), 'DL-found' : re.compile('')}) - if check == "DL-found": self.correctCaptcha() -- cgit v1.2.3 From 79725268402043906f619f7c09e848e02ab8a17b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 31 Jan 2015 22:00:59 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/FileSharkPl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FileSharkPl.py') diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index 252270c4b..e4ce711bd 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -127,7 +127,7 @@ class FileSharkPl(SimpleHoster): def _decode64(self, data, *args, **kwargs): - return data.decode("base64") + return data.decode('base64') getInfo = create_getInfo(FileSharkPl) -- cgit v1.2.3 From 6f77d9c783d1a51f4c320b15fad8a4edd3bda414 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 8 Mar 2015 20:38:07 +0100 Subject: [FileSharkPl] Fix https://github.com/pyload/pyload/issues/1040 (thx https://github.com/valdi74) --- module/plugins/hoster/FileSharkPl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/FileSharkPl.py') diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index e4ce711bd..7e6130739 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FileSharkPl(SimpleHoster): __name__ = "FileSharkPl" __type__ = "hoster" - __version__ = "0.07" + __version__ = "0.08" __pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d+/\w+' @@ -80,6 +80,8 @@ class FileSharkPl(SimpleHoster): link = urljoin("http://fileshark.pl", m.group(1)) + self.html = self.load(link, decode=True) + m = re.search(self.WAIT_PATTERN, self.html) if m: seconds = int(m.group(1)) -- cgit v1.2.3 From 7beb65e991bc6d1913c3b5bb2ef69e659d5b8342 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 10 Mar 2015 01:55:52 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/FileSharkPl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FileSharkPl.py') diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index 7e6130739..ac669ab1b 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -108,7 +108,7 @@ class FileSharkPl(SimpleHoster): self.load = tmp_load - self.download(link, post=inputs, cookies=True, disposition=True) + self.download(link, post=inputs, disposition=True) def checkFile(self): -- cgit v1.2.3 From 58e98ab99bd7672492109786c4db7076d231631b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 10 Mar 2015 15:32:24 +0100 Subject: [FileSharkPl] Fix https://github.com/pyload/pyload/issues/1040 (2) --- module/plugins/hoster/FileSharkPl.py | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) (limited to 'module/plugins/hoster/FileSharkPl.py') diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index ac669ab1b..df54997d8 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FileSharkPl(SimpleHoster): __name__ = "FileSharkPl" __type__ = "hoster" - __version__ = "0.08" + __version__ = "0.09" __pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d+/\w+' @@ -20,10 +20,9 @@ class FileSharkPl(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] - NAME_PATTERN = r'

(?P.+)

' - SIZE_PATTERN = r'

(.*?)(?P\d+\.?\d*)\s(?P\w+)

' - - OFFLINE_PATTERN = '(P|p)lik zosta. (usuni.ty|przeniesiony)' + NAME_PATTERN = r'

(?P.+)

' + SIZE_PATTERN = r'

(.*?)(?P\d+\.?\d*)\s(?P\w+)

' + OFFLINE_PATTERN = r'(P|p)lik zosta. (usuni.ty|przeniesiony)' LINK_FREE_PATTERN = r'
' LINK_PREMIUM_PATTERN = r'' @@ -33,7 +32,7 @@ class FileSharkPl(SimpleHoster): IP_ERROR_PATTERN = r'Strona jest dost.pna wy..cznie dla u.ytkownik.w znajduj.cych si. na terenie Polski' SLOT_ERROR_PATTERN = r'Osi.gni.to maksymaln. liczb. .ci.ganych jednocze.nie plik.w\.' - CAPTCHA_PATTERN = '' @@ -80,7 +79,7 @@ class FileSharkPl(SimpleHoster): link = urljoin("http://fileshark.pl", m.group(1)) - self.html = self.load(link, decode=True) + self.html = self.load(link) m = re.search(self.WAIT_PATTERN, self.html) if m: @@ -111,23 +110,6 @@ class FileSharkPl(SimpleHoster): self.download(link, post=inputs, disposition=True) - def checkFile(self): - check = self.checkDownload({'wrong_captcha': re.compile(r''), - 'wait_pattern' : re.compile(self.SECONDS_PATTERN), - 'DL-found' : re.compile('')}) - if check == "DL-found": - self.correctCaptcha() - - elif check == "wrong_captcha": - self.invalidCaptcha() - self.retry(10, 1, _("Wrong captcha solution")) - - elif check == "wait_pattern": - self.retry() - - return super(FileSharkPl, self).checkFile() - - def _decode64(self, data, *args, **kwargs): return data.decode('base64') -- cgit v1.2.3 From 7d90803262ccbb4fc5296a4dc3ce30fe98f55631 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 25 Mar 2015 23:10:07 +0100 Subject: __config__ cosmetics --- module/plugins/hoster/FileSharkPl.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/FileSharkPl.py') diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index df54997d8..63475958a 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -13,6 +13,7 @@ class FileSharkPl(SimpleHoster): __version__ = "0.09" __pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d+/\w+' + __config__ = [("use_premium", "bool", "Use premium account if available", True)] __description__ = """FileShark.pl hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 686d51fb3a43cb49ee4c3f44ea48b052d36616e0 Mon Sep 17 00:00:00 2001 From: valdi74 Date: Fri, 10 Apr 2015 00:06:18 +0200 Subject: Update - new links pattern --- module/plugins/hoster/FileSharkPl.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/FileSharkPl.py') diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index 63475958a..9f6070806 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FileSharkPl(SimpleHoster): __name__ = "FileSharkPl" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" __pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d+/\w+' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -25,8 +25,8 @@ class FileSharkPl(SimpleHoster): SIZE_PATTERN = r'

(.*?)(?P\d+\.?\d*)\s(?P\w+)

' OFFLINE_PATTERN = r'(P|p)lik zosta. (usuni.ty|przeniesiony)' - LINK_FREE_PATTERN = r'
' - LINK_PREMIUM_PATTERN = r'' + LINK_FREE_PATTERN = r'' + LINK_PREMIUM_PATTERN = r'' WAIT_PATTERN = r'var timeToDownload = (\d+);' ERROR_PATTERN = r'

(.*?)

' -- cgit v1.2.3 From 1ef93e913238275f7657d496ba3d2e7eeb5a30a2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 May 2015 01:06:01 +0200 Subject: Use 'import' instead 'from' --- module/plugins/hoster/FileSharkPl.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/FileSharkPl.py') diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index 9f6070806..de030be9c 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from urlparse import urljoin +import urlparse from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -78,7 +77,7 @@ class FileSharkPl(SimpleHoster): if m is None: self.error(_("Download url not found")) - link = urljoin("http://fileshark.pl", m.group(1)) + link = urlparse.urljoin("http://fileshark.pl", m.group(1)) self.html = self.load(link) -- cgit v1.2.3