From 983a19dbb357b66251babf4b041d5507198202d7 Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Sun, 7 Sep 2014 13:26:53 +0200 Subject: [Speedyshare] new hoster Merges #718 --- module/plugins/hoster/SpeedyshareCom.py | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 module/plugins/hoster/SpeedyshareCom.py (limited to 'module/plugins/hoster/SpeedyshareCom.py') diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py new file mode 100644 index 000000000..22f4ee511 --- /dev/null +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +# Testlink: +# http://speedy.sh/ep2qY/Zapp-Brannigan.jpg + +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class SpeedyshareCom(SimpleHoster): + __name__ = "SpeedyshareCom" + __type__ = "hoster" + __pattern__ = r"https?://(www\.)?(speedyshare.com|speedy.sh)/.*" + __version__ = "0.01" + __description__ = """speedyshare.com hoster plugin""" + __author_name__ = ("zapp-brannigan") + __author_mail__ = ("fuerst.reinje@web.de") + + FILE_NAME_PATTERN = r'class=downloadfilename>(?P.*)' + FILE_SIZE_PATTERN = r'class=sizetagtext>(?P.*) (?P[kKmM]?[iI]?[bB]?)' + LINK_PATTERN = r'\'Slow.*' + BASE_URL = 'www.speedyshare.com' + + def setup(self): + self.multiDL = False + self.chunkLimit = 1 + + def process(self, pyfile): + self.html = self.load(pyfile.url, decode=True) + try: + dl_link = re.search(self.LINK_PATTERN, self.html).group(1) + self.logDebug("Link: " + dl_link) + except: + self.parseError("Unable to find download link") + self.download(self.BASE_URL + dl_link, disposition=True) + check = self.checkDownload({"is_html": re.compile("html")}) + if check == "is_html": + self.fail("The downloaded file is html, maybe the plugin is out of date") + + +getInfo = create_getInfo(SpeedyshareCom) -- cgit v1.2.3 From 59f743bbfde24d94a16c9fc60095014d66a2cb70 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 28 Sep 2014 19:14:58 +0200 Subject: [SpeedyshareCom] Code cleanup --- module/plugins/hoster/SpeedyshareCom.py | 46 +++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 19 deletions(-) (limited to 'module/plugins/hoster/SpeedyshareCom.py') diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py index 22f4ee511..49d3a4dab 100644 --- a/module/plugins/hoster/SpeedyshareCom.py +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -1,43 +1,51 @@ # -*- coding: utf-8 -*- - -# Testlink: +# +# Test links: # http://speedy.sh/ep2qY/Zapp-Brannigan.jpg import re +from urlparse import urljoin + from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class SpeedyshareCom(SimpleHoster): __name__ = "SpeedyshareCom" __type__ = "hoster" - __pattern__ = r"https?://(www\.)?(speedyshare.com|speedy.sh)/.*" - __version__ = "0.01" - __description__ = """speedyshare.com hoster plugin""" - __author_name__ = ("zapp-brannigan") - __author_mail__ = ("fuerst.reinje@web.de") + __version__ = "0.02" + + __pattern__ = r"https?://(www\.)?(speedyshare\.com|speedy\.sh)/\w+" + + __description__ = """Speedyshare.com hoster plugin""" + __author_name__ = "zapp-brannigan" + __author_mail__ = "fuerst.reinje@web.de" + FILE_NAME_PATTERN = r'class=downloadfilename>(?P.*)' FILE_SIZE_PATTERN = r'class=sizetagtext>(?P.*) (?P[kKmM]?[iI]?[bB]?)' - LINK_PATTERN = r'\'Slow.*' - BASE_URL = 'www.speedyshare.com' + + LINK_PATTERN = r'\'Slow Date: Sat, 4 Oct 2014 23:35:49 +0200 Subject: Spare __pattern__ cosmetics --- module/plugins/hoster/SpeedyshareCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/SpeedyshareCom.py') diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py index 49d3a4dab..78b3b28c6 100644 --- a/module/plugins/hoster/SpeedyshareCom.py +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -15,7 +15,7 @@ class SpeedyshareCom(SimpleHoster): __type__ = "hoster" __version__ = "0.02" - __pattern__ = r"https?://(www\.)?(speedyshare\.com|speedy\.sh)/\w+" + __pattern__ = r"https?://(?:www\.)?(speedyshare\.com|speedy\.sh)/\w+" __description__ = """Speedyshare.com hoster plugin""" __author_name__ = "zapp-brannigan" -- cgit v1.2.3 From ff91b58bf9ee65aaeb048426295af6ad122b119e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 5 Oct 2014 22:14:53 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/SpeedyshareCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/SpeedyshareCom.py') diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py index 78b3b28c6..772d3ad62 100644 --- a/module/plugins/hoster/SpeedyshareCom.py +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -43,8 +43,8 @@ class SpeedyshareCom(SimpleHoster): dl_link = urljoin("http://www.speedyshare.com", m.group(1)) self.download(dl_link, disposition=True) - check = self.checkDownload({'is_html': re.compile("html")}) - if check == "is_html": + check = self.checkDownload({'html': re.compile("html")}) + if check == "html": self.parseError("Downloaded file is an html file") -- 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/SpeedyshareCom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster/SpeedyshareCom.py') diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py index 772d3ad62..f07170d71 100644 --- a/module/plugins/hoster/SpeedyshareCom.py +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -18,8 +18,7 @@ class SpeedyshareCom(SimpleHoster): __pattern__ = r"https?://(?:www\.)?(speedyshare\.com|speedy\.sh)/\w+" __description__ = """Speedyshare.com hoster plugin""" - __author_name__ = "zapp-brannigan" - __author_mail__ = "fuerst.reinje@web.de" + __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")] FILE_NAME_PATTERN = r'class=downloadfilename>(?P.*)' -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hoster/SpeedyshareCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/SpeedyshareCom.py') diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py index f07170d71..e2968835d 100644 --- a/module/plugins/hoster/SpeedyshareCom.py +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -18,6 +18,7 @@ class SpeedyshareCom(SimpleHoster): __pattern__ = r"https?://(?:www\.)?(speedyshare\.com|speedy\.sh)/\w+" __description__ = """Speedyshare.com hoster plugin""" + __license__ = "GPLv3" __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")] -- cgit v1.2.3 From c5d1a4fd8943877c6d2eb3843e0de725dba5191e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:09:53 +0200 Subject: Pattern update 2 --- module/plugins/hoster/SpeedyshareCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/SpeedyshareCom.py') diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py index e2968835d..11b327475 100644 --- a/module/plugins/hoster/SpeedyshareCom.py +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -27,7 +27,7 @@ class SpeedyshareCom(SimpleHoster): FILE_OFFLINE_PATTERN = r'class=downloadfilenamenotfound>.*' - LINK_PATTERN = r'\'Slow\'Slow Date: Sat, 11 Oct 2014 15:12:40 +0200 Subject: Pattern update 3 --- module/plugins/hoster/SpeedyshareCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/SpeedyshareCom.py') diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py index 11b327475..c3acfc1e8 100644 --- a/module/plugins/hoster/SpeedyshareCom.py +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -15,7 +15,7 @@ class SpeedyshareCom(SimpleHoster): __type__ = "hoster" __version__ = "0.02" - __pattern__ = r"https?://(?:www\.)?(speedyshare\.com|speedy\.sh)/\w+" + __pattern__ = r'https?://(?:www\.)?(speedyshare\.com|speedy\.sh)/\w+' __description__ = """Speedyshare.com hoster plugin""" __license__ = "GPLv3" -- 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/SpeedyshareCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/SpeedyshareCom.py') diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py index c3acfc1e8..0696ae810 100644 --- a/module/plugins/hoster/SpeedyshareCom.py +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -13,7 +13,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class SpeedyshareCom(SimpleHoster): __name__ = "SpeedyshareCom" __type__ = "hoster" - __version__ = "0.02" + __version__ = "0.03" __pattern__ = r'https?://(?:www\.)?(speedyshare\.com|speedy\.sh)/\w+' @@ -38,14 +38,14 @@ class SpeedyshareCom(SimpleHoster): def handleFree(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.parseError("Download link not found") + self.error("Download link not found") dl_link = urljoin("http://www.speedyshare.com", m.group(1)) self.download(dl_link, disposition=True) check = self.checkDownload({'html': re.compile("html")}) if check == "html": - self.parseError("Downloaded file is an html file") + self.error("Downloaded file is an html file") getInfo = create_getInfo(SpeedyshareCom) -- cgit v1.2.3 From f00dbe52cee93a0aad9b6747419ff7271adb6e84 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 10:12:21 +0200 Subject: Code cosmetics --- module/plugins/hoster/SpeedyshareCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/SpeedyshareCom.py') diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py index 0696ae810..98d74631f 100644 --- a/module/plugins/hoster/SpeedyshareCom.py +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -45,7 +45,7 @@ class SpeedyshareCom(SimpleHoster): check = self.checkDownload({'html': re.compile("html")}) if check == "html": - self.error("Downloaded file is an html file") + self.error("Downloaded file is an html page") getInfo = create_getInfo(SpeedyshareCom) -- 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/SpeedyshareCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/SpeedyshareCom.py') diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py index 98d74631f..7ae61ea47 100644 --- a/module/plugins/hoster/SpeedyshareCom.py +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -38,14 +38,14 @@ class SpeedyshareCom(SimpleHoster): def handleFree(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Download link not found") + self.error(_("Download link not found")) dl_link = urljoin("http://www.speedyshare.com", m.group(1)) self.download(dl_link, disposition=True) check = self.checkDownload({'html': re.compile("html")}) if check == "html": - self.error("Downloaded file is an html page") + self.error(_("Downloaded file is an html page")) getInfo = create_getInfo(SpeedyshareCom) -- 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/SpeedyshareCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/SpeedyshareCom.py') diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py index 7ae61ea47..8c22a8d33 100644 --- a/module/plugins/hoster/SpeedyshareCom.py +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -11,15 +11,15 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class SpeedyshareCom(SimpleHoster): - __name__ = "SpeedyshareCom" - __type__ = "hoster" + __name__ = "SpeedyshareCom" + __type__ = "hoster" __version__ = "0.03" __pattern__ = r'https?://(?:www\.)?(speedyshare\.com|speedy\.sh)/\w+' __description__ = """Speedyshare.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")] + __license__ = "GPLv3" + __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")] FILE_NAME_PATTERN = r'class=downloadfilename>(?P.*)' -- cgit v1.2.3 From 772e47ef806d18fd209e910be0535bce7c07dc7b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Nov 2014 22:47:07 +0100 Subject: Update all other plugins --- module/plugins/hoster/SpeedyshareCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/SpeedyshareCom.py') diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py index 8c22a8d33..fa54d6060 100644 --- a/module/plugins/hoster/SpeedyshareCom.py +++ b/module/plugins/hoster/SpeedyshareCom.py @@ -22,10 +22,10 @@ class SpeedyshareCom(SimpleHoster): __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")] - FILE_NAME_PATTERN = r'class=downloadfilename>(?P.*)' - FILE_SIZE_PATTERN = r'class=sizetagtext>(?P.*) (?P[kKmM]?[iI]?[bB]?)' + NAME_PATTERN = r'class=downloadfilename>(?P.*)' + SIZE_PATTERN = r'class=sizetagtext>(?P.*) (?P[kKmM]?[iI]?[bB]?)' - FILE_OFFLINE_PATTERN = r'class=downloadfilenamenotfound>.*' + OFFLINE_PATTERN = r'class=downloadfilenamenotfound>.*' LINK_PATTERN = r'