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/TwoSharedCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index 7881ca098..bb9737d2e 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -16,7 +16,7 @@ class TwoSharedCom(SimpleHoster): FILE_NAME_PATTERN = r'

(?P.*)

' FILE_SIZE_PATTERN = r'File size:\s*(?P[0-9,.]+) (?P[kKMG])i?B' - FILE_OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.' + OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.' DOWNLOAD_URL_PATTERN = r"window.location ='([^']+)';" def setup(self): -- 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/TwoSharedCom.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index bb9737d2e..74a9dbe08 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -17,13 +17,15 @@ class TwoSharedCom(SimpleHoster): FILE_NAME_PATTERN = r'

(?P.*)

' FILE_SIZE_PATTERN = r'File size:\s*(?P[0-9,.]+) (?P[kKMG])i?B' OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.' - DOWNLOAD_URL_PATTERN = r"window.location ='([^']+)';" + + LINK_PATTERN = r"window.location ='([^']+)';" + def setup(self): self.resumeDownload = self.multiDL = True def handleFree(self): - found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if not found: self.parseError('Download link') link = found.group(1) -- 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/TwoSharedCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index 74a9dbe08..d50248c4d 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -26,7 +26,7 @@ class TwoSharedCom(SimpleHoster): def handleFree(self): found = re.search(self.LINK_PATTERN, self.html) - if not found: + if found is None: self.parseError('Download link') link = found.group(1) self.logDebug("Download URL %s" % link) -- 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/TwoSharedCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index d50248c4d..1f040dfc2 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -25,10 +25,10 @@ class TwoSharedCom(SimpleHoster): self.resumeDownload = self.multiDL = True def handleFree(self): - found = re.search(self.LINK_PATTERN, self.html) - if found is None: + m = re.search(self.LINK_PATTERN, self.html) + if m is None: self.parseError('Download link') - link = found.group(1) + link = m.group(1) self.logDebug("Download URL %s" % link) self.download(link) -- 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/TwoSharedCom.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index 1f040dfc2..dbd33dd83 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -8,8 +8,10 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class TwoSharedCom(SimpleHoster): __name__ = "TwoSharedCom" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?2shared.com/(account/)?(download|get|file|document|photo|video|audio)/.*' __version__ = "0.11" + + __pattern__ = r'http://(?:www\.)?2shared.com/(account/)?(download|get|file|document|photo|video|audio)/.*' + __description__ = """2Shared.com hoster plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" -- 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/TwoSharedCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index dbd33dd83..d9cf4479b 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -13,8 +13,8 @@ class TwoSharedCom(SimpleHoster): __pattern__ = r'http://(?:www\.)?2shared.com/(account/)?(download|get|file|document|photo|video|audio)/.*' __description__ = """2Shared.com hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + FILE_NAME_PATTERN = r'

(?P.*)

' FILE_SIZE_PATTERN = r'File size:\s*(?P[0-9,.]+) (?P[kKMG])i?B' -- 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/TwoSharedCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index d9cf4479b..4bef13a67 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -13,6 +13,7 @@ class TwoSharedCom(SimpleHoster): __pattern__ = r'http://(?:www\.)?2shared.com/(account/)?(download|get|file|document|photo|video|audio)/.*' __description__ = """2Shared.com hoster plugin""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] -- cgit v1.2.3 From f76e5c2336718dca9da8033ba22cd83c72c7b3b3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:14:28 +0200 Subject: Pattern update 1 --- module/plugins/hoster/TwoSharedCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index 4bef13a67..44c927f4b 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -18,7 +18,7 @@ class TwoSharedCom(SimpleHoster): FILE_NAME_PATTERN = r'

(?P.*)

' - FILE_SIZE_PATTERN = r'File size:\s*(?P[0-9,.]+) (?P[kKMG])i?B' + FILE_SIZE_PATTERN = r'File size:\s*(?P[\d.,]+) (?P\w+)' OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.' LINK_PATTERN = r"window.location ='([^']+)';" -- 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/TwoSharedCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index 44c927f4b..03dad69dd 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -10,7 +10,7 @@ class TwoSharedCom(SimpleHoster): __type__ = "hoster" __version__ = "0.11" - __pattern__ = r'http://(?:www\.)?2shared.com/(account/)?(download|get|file|document|photo|video|audio)/.*' + __pattern__ = r'http://(?:www\.)?2shared\.com/(account/)?(download|get|file|document|photo|video|audio)/.*' __description__ = """2Shared.com hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 8939f015a688a07ec7d0bd14b6a3704f6a2cb4a0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:12:40 +0200 Subject: Pattern update 3 --- module/plugins/hoster/TwoSharedCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index 03dad69dd..280f1d910 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -21,7 +21,7 @@ class TwoSharedCom(SimpleHoster): FILE_SIZE_PATTERN = r'File size:\s*(?P[\d.,]+) (?P\w+)' OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.' - LINK_PATTERN = r"window.location ='([^']+)';" + LINK_PATTERN = r'window.location =\'(.+?)\';' def setup(self): -- cgit v1.2.3 From 388a2f6478d42e423f1f8442d8539983f3762f22 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 14 Oct 2014 13:38:49 +0200 Subject: Improve unit detection in size pattern --- module/plugins/hoster/TwoSharedCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index 280f1d910..adfd44d6f 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -18,7 +18,7 @@ class TwoSharedCom(SimpleHoster): FILE_NAME_PATTERN = r'

(?P.*)

' - FILE_SIZE_PATTERN = r'File size:\s*(?P[\d.,]+) (?P\w+)' + FILE_SIZE_PATTERN = r'File size:\s*(?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.' LINK_PATTERN = r'window.location =\'(.+?)\';' -- 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/TwoSharedCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index adfd44d6f..6b755219a 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class TwoSharedCom(SimpleHoster): __name__ = "TwoSharedCom" __type__ = "hoster" - __version__ = "0.11" + __version__ = "0.12" __pattern__ = r'http://(?:www\.)?2shared\.com/(account/)?(download|get|file|document|photo|video|audio)/.*' @@ -30,7 +30,7 @@ class TwoSharedCom(SimpleHoster): def handleFree(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.parseError('Download link') + self.error('Download link') link = m.group(1) self.logDebug("Download URL %s" % link) -- 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/TwoSharedCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index 6b755219a..e1cdead9b 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -27,6 +27,7 @@ class TwoSharedCom(SimpleHoster): def setup(self): self.resumeDownload = self.multiDL = True + def handleFree(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: -- 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/TwoSharedCom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index e1cdead9b..ee48556d4 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -32,9 +32,8 @@ class TwoSharedCom(SimpleHoster): m = re.search(self.LINK_PATTERN, self.html) if m is None: self.error('Download link') - link = m.group(1) - self.logDebug("Download URL %s" % link) + link = m.group(1) self.download(link) -- 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/TwoSharedCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index ee48556d4..1c944756b 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -31,7 +31,7 @@ class TwoSharedCom(SimpleHoster): def handleFree(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error('Download link') + self.error("Download link") link = m.group(1) self.download(link) -- 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/TwoSharedCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index 1c944756b..c77e4f829 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -31,7 +31,7 @@ class TwoSharedCom(SimpleHoster): def handleFree(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Download link") + self.error(_("Download link")) link = m.group(1) self.download(link) -- 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/TwoSharedCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index c77e4f829..9cf1705fb 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -6,15 +6,15 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class TwoSharedCom(SimpleHoster): - __name__ = "TwoSharedCom" - __type__ = "hoster" + __name__ = "TwoSharedCom" + __type__ = "hoster" __version__ = "0.12" __pattern__ = r'http://(?:www\.)?2shared\.com/(account/)?(download|get|file|document|photo|video|audio)/.*' __description__ = """2Shared.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] FILE_NAME_PATTERN = r'

(?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/TwoSharedCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index 9cf1705fb..5fed652cb 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -17,8 +17,8 @@ class TwoSharedCom(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - FILE_NAME_PATTERN = r'

(?P.*)

' - FILE_SIZE_PATTERN = r'File size:\s*(?P[\d.,]+) (?P[\w^_]+)' + NAME_PATTERN = r'

(?P.*)

' + SIZE_PATTERN = r'File size:\s*(?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.' LINK_PATTERN = r'window.location =\'(.+?)\';' -- cgit v1.2.3 From 67587fbe0335cacfde28a86ba729b9d567ce1da7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 7 Dec 2014 00:27:18 +0100 Subject: Plugin code cosmetics (3) --- module/plugins/hoster/TwoSharedCom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index 5fed652cb..59a8ce6e1 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -25,7 +25,8 @@ class TwoSharedCom(SimpleHoster): def setup(self): - self.resumeDownload = self.multiDL = True + self.resumeDownload = True + self.multiDL = True def handleFree(self): -- cgit v1.2.3 From cdb06469a640c1875229903a2dbdfa8be469b5bc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 13:52:30 +0100 Subject: Improve a lot of plugin __pattern__ --- module/plugins/hoster/TwoSharedCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TwoSharedCom.py') diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index 59a8ce6e1..1dd67f974 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -10,7 +10,7 @@ class TwoSharedCom(SimpleHoster): __type__ = "hoster" __version__ = "0.12" - __pattern__ = r'http://(?:www\.)?2shared\.com/(account/)?(download|get|file|document|photo|video|audio)/.*' + __pattern__ = r'http://(?:www\.)?2shared\.com/(account/)?(download|get|file|document|photo|video|audio)/.+' __description__ = """2Shared.com hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3