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/FshareVn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index f9a9b6c16..63cc69161 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -33,7 +33,7 @@ class FshareVn(SimpleHoster): __author_mail__ = "zoidberg@mujmail.cz" FILE_INFO_PATTERN = r'

(?P[^<]+)<\\/p>[\\trn\s]*

(?P[0-9,.]+)\s*(?P[kKMG])i?B<\\/p>' - FILE_OFFLINE_PATTERN = r'

\\t\\t\\t\\t\\r\\n\\t\\t

<\\/p>\\t\\t\\r\\n\\t\\t

0 KB<\\/p>' + OFFLINE_PATTERN = r'

\\t\\t\\t\\t\\r\\n\\t\\t

<\\/p>\\t\\t\\r\\n\\t\\t

0 KB<\\/p>' FILE_NAME_REPLACEMENTS = [("(.*)", doubleDecode)] DOWNLOAD_URL_PATTERN = r'action="(http://download.*?)[#"]' VIP_URL_PATTERN = r'

' -- 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/FshareVn.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 63cc69161..75b37b4c3 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -34,11 +34,13 @@ class FshareVn(SimpleHoster): FILE_INFO_PATTERN = r'

(?P[^<]+)<\\/p>[\\trn\s]*

(?P[0-9,.]+)\s*(?P[kKMG])i?B<\\/p>' OFFLINE_PATTERN = r'

\\t\\t\\t\\t\\r\\n\\t\\t

<\\/p>\\t\\t\\r\\n\\t\\t

0 KB<\\/p>' + FILE_NAME_REPLACEMENTS = [("(.*)", doubleDecode)] - DOWNLOAD_URL_PATTERN = r'action="(http://download.*?)[#"]' - VIP_URL_PATTERN = r'' + + LINK_PATTERN = r'action="(http://download.*?)[#"]' WAIT_PATTERN = ur'Lượt tải xuống kế tiếp là:\s*(.*?)\s*<' + def process(self, pyfile): self.html = self.load('http://www.fshare.vn/check_link.php', post={ "action": "check_link", @@ -79,7 +81,7 @@ class FshareVn(SimpleHoster): found = re.search(r'var count = (\d+)', self.html) self.setWait(int(found.group(1)) if found else 30) - found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if not found: self.parseError('FREE DL URL') self.url = 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/FshareVn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 75b37b4c3..ec76d85b8 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -82,7 +82,7 @@ class FshareVn(SimpleHoster): self.setWait(int(found.group(1)) if found else 30) found = re.search(self.LINK_PATTERN, self.html) - if not found: + if found is None: self.parseError('FREE DL URL') self.url = found.group(1) self.logDebug("FREE DL URL: %s" % self.url) -- 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/FshareVn.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index ec76d85b8..0b728495a 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -78,13 +78,13 @@ class FshareVn(SimpleHoster): self.checkErrors() - found = re.search(r'var count = (\d+)', self.html) - self.setWait(int(found.group(1)) if found else 30) + m = re.search(r'var count = (\d+)', self.html) + self.setWait(int(m.group(1)) if m else 30) - 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('FREE DL URL') - self.url = found.group(1) + self.url = m.group(1) self.logDebug("FREE DL URL: %s" % self.url) self.wait() @@ -97,10 +97,10 @@ class FshareVn(SimpleHoster): if '/error.php?' in self.req.lastEffectiveURL or u"Liên kết bạn chọn không tồn" in self.html: self.offline() - found = re.search(self.WAIT_PATTERN, self.html) - if found: - self.logInfo("Wait until %s ICT" % found.group(1)) - wait_until = mktime(strptime(found.group(1), "%d/%m/%Y %H:%M")) + m = re.search(self.WAIT_PATTERN, self.html) + if m: + self.logInfo("Wait until %s ICT" % m.group(1)) + wait_until = mktime(strptime(m.group(1), "%d/%m/%Y %H:%M")) self.wait(wait_until - mktime(gmtime()) - 7 * 60 * 60, True) self.retry() elif '

    ' in self.html: @@ -114,4 +114,4 @@ class FshareVn(SimpleHoster): }) if check == "not_found": - self.fail("File not found on server") + self.fail("File not m on server") -- 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/FshareVn.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 0b728495a..bc042cbcc 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- import re + from time import strptime, mktime, gmtime -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo from module.network.RequestFactory import getURL +from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo def getInfo(urls): @@ -26,8 +27,10 @@ def doubleDecode(m): class FshareVn(SimpleHoster): __name__ = "FshareVn" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?fshare.vn/file/.*' __version__ = "0.16" + + __pattern__ = r'http://(?:www\.)?fshare.vn/file/.*' + __description__ = """FshareVn hoster plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" -- 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/FshareVn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index bc042cbcc..3fd66bc32 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -69,7 +69,7 @@ class FshareVn(SimpleHoster): self.parseError('FORM') elif 'link_file_pwd_dl' in inputs: for password in self.getPassword().splitlines(): - self.logInfo('Password protected link, trying "%s"' % password) + self.logInfo("Password protected link, trying", password) inputs['link_file_pwd_dl'] = password self.html = self.load(self.url, post=inputs, decode=True) if not 'name="link_file_pwd_dl"' in self.html: -- 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/FshareVn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 3fd66bc32..a90724bcd 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -32,8 +32,8 @@ class FshareVn(SimpleHoster): __pattern__ = r'http://(?:www\.)?fshare.vn/file/.*' __description__ = """FshareVn hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + FILE_INFO_PATTERN = r'

    (?P[^<]+)<\\/p>[\\trn\s]*

    (?P[0-9,.]+)\s*(?P[kKMG])i?B<\\/p>' OFFLINE_PATTERN = r'

    \\t\\t\\t\\t\\r\\n\\t\\t

    <\\/p>\\t\\t\\r\\n\\t\\t

    0 KB<\\/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/FshareVn.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index a90724bcd..500d4648a 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -32,6 +32,7 @@ class FshareVn(SimpleHoster): __pattern__ = r'http://(?:www\.)?fshare.vn/file/.*' __description__ = """FshareVn 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/FshareVn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 500d4648a..7e66d846c 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -36,7 +36,7 @@ class FshareVn(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - FILE_INFO_PATTERN = r'

    (?P[^<]+)<\\/p>[\\trn\s]*

    (?P[0-9,.]+)\s*(?P[kKMG])i?B<\\/p>' + FILE_INFO_PATTERN = r'

    (?P[^<]+)<\\/p>[\\trn\s]*

    (?P[\d.,]+)\s*(?P\w+)<\\/p>' OFFLINE_PATTERN = r'

    \\t\\t\\t\\t\\r\\n\\t\\t

    <\\/p>\\t\\t\\r\\n\\t\\t

    0 KB<\\/p>' FILE_NAME_REPLACEMENTS = [("(.*)", doubleDecode)] -- 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/FshareVn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 7e66d846c..4d01d7c7f 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -29,7 +29,7 @@ class FshareVn(SimpleHoster): __type__ = "hoster" __version__ = "0.16" - __pattern__ = r'http://(?:www\.)?fshare.vn/file/.*' + __pattern__ = r'http://(?:www\.)?fshare\.vn/file/.*' __description__ = """FshareVn hoster plugin""" __license__ = "GPLv3" -- 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/FshareVn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 4d01d7c7f..2f95d49e6 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -36,7 +36,7 @@ class FshareVn(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - FILE_INFO_PATTERN = r'

    (?P[^<]+)<\\/p>[\\trn\s]*

    (?P[\d.,]+)\s*(?P\w+)<\\/p>' + FILE_INFO_PATTERN = r'

    (?P[^<]+)<\\/p>[\\trn\s]*

    (?P[\d.,]+)\s*(?P[\w^_]+)<\\/p>' OFFLINE_PATTERN = r'

    \\t\\t\\t\\t\\r\\n\\t\\t

    <\\/p>\\t\\t\\r\\n\\t\\t

    0 KB<\\/p>' FILE_NAME_REPLACEMENTS = [("(.*)", doubleDecode)] -- 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/FshareVn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 2f95d49e6..1a995ce28 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -27,7 +27,7 @@ def doubleDecode(m): class FshareVn(SimpleHoster): __name__ = "FshareVn" __type__ = "hoster" - __version__ = "0.16" + __version__ = "0.17" __pattern__ = r'http://(?:www\.)?fshare\.vn/file/.*' @@ -67,7 +67,7 @@ class FshareVn(SimpleHoster): self.url = self.pyfile.url + action if not inputs: - self.parseError('FORM') + self.error('FORM') elif 'link_file_pwd_dl' in inputs: for password in self.getPassword().splitlines(): self.logInfo("Password protected link, trying", password) @@ -87,7 +87,7 @@ class FshareVn(SimpleHoster): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.parseError('FREE DL URL') + self.error('FREE DL URL') self.url = m.group(1) self.logDebug("FREE DL URL: %s" % self.url) -- 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/FshareVn.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 1a995ce28..7ce7cd3e6 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -58,6 +58,7 @@ class FshareVn(SimpleHoster): self.handleFree() self.checkDownloadedFile() + def handleFree(self): self.html = self.load(self.pyfile.url, decode=True) @@ -94,9 +95,11 @@ class FshareVn(SimpleHoster): self.wait() self.download(self.url) + def handlePremium(self): self.download(self.pyfile.url) + def checkErrors(self): if '/error.php?' in self.req.lastEffectiveURL or u"Liên kết bạn chọn không tồn" in self.html: self.offline() @@ -111,6 +114,7 @@ class FshareVn(SimpleHoster): self.logError("Unknown error occured or wait time not parsed") self.retry(30, 2 * 60, "Unknown error") + def checkDownloadedFile(self): # check download check = self.checkDownload({ -- cgit v1.2.3 From 8cde8385b0224f8fa26758f6c2b6b782e5fb3663 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 23 Oct 2014 22:34:36 +0200 Subject: Call error instead fail in some plugins --- module/plugins/hoster/FshareVn.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 7ce7cd3e6..23a66a1c1 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -111,8 +111,9 @@ class FshareVn(SimpleHoster): self.wait(wait_until - mktime(gmtime()) - 7 * 60 * 60, True) self.retry() elif '

      ' in self.html: - self.logError("Unknown error occured or wait time not parsed") - self.retry(30, 2 * 60, "Unknown error") + msg = "Unknown error occured or wait time not parsed" + self.logError(msg) + self.retry(30, 2 * 60, msg) def checkDownloadedFile(self): -- 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/FshareVn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 23a66a1c1..217e2d754 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -68,7 +68,7 @@ class FshareVn(SimpleHoster): self.url = self.pyfile.url + action if not inputs: - self.error('FORM') + self.error("FORM") elif 'link_file_pwd_dl' in inputs: for password in self.getPassword().splitlines(): self.logInfo("Password protected link, trying", password) @@ -88,7 +88,7 @@ class FshareVn(SimpleHoster): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error('FREE DL URL') + self.error("FREE DL URL") self.url = m.group(1) self.logDebug("FREE DL URL: %s" % self.url) -- 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/FshareVn.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 217e2d754..fd9980117 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -68,16 +68,16 @@ class FshareVn(SimpleHoster): self.url = self.pyfile.url + action if not inputs: - self.error("FORM") + self.error(_("No FORM")) elif 'link_file_pwd_dl' in inputs: for password in self.getPassword().splitlines(): - self.logInfo("Password protected link, trying", password) + self.logInfo(_("Password protected link, trying ") + password) inputs['link_file_pwd_dl'] = password self.html = self.load(self.url, post=inputs, decode=True) if not 'name="link_file_pwd_dl"' in self.html: break else: - self.fail("No or incorrect password") + self.fail(_("No or incorrect password")) else: self.html = self.load(self.url, post=inputs, decode=True) @@ -88,7 +88,7 @@ class FshareVn(SimpleHoster): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("FREE DL URL") + self.error(_("LINK_PATTERN not found")) self.url = m.group(1) self.logDebug("FREE DL URL: %s" % self.url) @@ -106,7 +106,7 @@ class FshareVn(SimpleHoster): m = re.search(self.WAIT_PATTERN, self.html) if m: - self.logInfo("Wait until %s ICT" % m.group(1)) + self.logInfo(_("Wait until %s ICT") % m.group(1)) wait_until = mktime(strptime(m.group(1), "%d/%m/%Y %H:%M")) self.wait(wait_until - mktime(gmtime()) - 7 * 60 * 60, True) self.retry() @@ -123,4 +123,4 @@ class FshareVn(SimpleHoster): }) if check == "not_found": - self.fail("File not m on server") + self.fail(_("File not m on server")) -- 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/FshareVn.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index fd9980117..0c8bbf57e 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -25,15 +25,15 @@ def doubleDecode(m): class FshareVn(SimpleHoster): - __name__ = "FshareVn" - __type__ = "hoster" + __name__ = "FshareVn" + __type__ = "hoster" __version__ = "0.17" __pattern__ = r'http://(?:www\.)?fshare\.vn/file/.*' __description__ = """FshareVn hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] FILE_INFO_PATTERN = r'

      (?P[^<]+)<\\/p>[\\trn\s]*

      (?P[\d.,]+)\s*(?P[\w^_]+)<\\/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/FshareVn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 0c8bbf57e..4439949f0 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -36,10 +36,10 @@ class FshareVn(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - FILE_INFO_PATTERN = r'

      (?P[^<]+)<\\/p>[\\trn\s]*

      (?P[\d.,]+)\s*(?P[\w^_]+)<\\/p>' + INFO_PATTERN = r'

      (?P[^<]+)<\\/p>[\\trn\s]*

      (?P[\d.,]+)\s*(?P[\w^_]+)<\\/p>' OFFLINE_PATTERN = r'

      \\t\\t\\t\\t\\r\\n\\t\\t

      <\\/p>\\t\\t\\r\\n\\t\\t

      0 KB<\\/p>' - FILE_NAME_REPLACEMENTS = [("(.*)", doubleDecode)] + NAME_REPLACEMENTS = [("(.*)", doubleDecode)] LINK_PATTERN = r'action="(http://download.*?)[#"]' WAIT_PATTERN = ur'Lượt tải xuống kế tiếp là:\s*(.*?)\s*<' -- 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/FshareVn.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 4439949f0..2ab65ae99 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -10,14 +10,11 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo def getInfo(urls): for url in urls: - html = getURL('http://www.fshare.vn/check_link.php', post={ - "action": "check_link", - "arrlinks": url - }, decode=True) - - file_info = parseFileInfo(FshareVn, url, html) + html = getURL("http://www.fshare.vn/check_link.php", + post={'action': "check_link", 'arrlinks': url}, + decode=True) - yield file_info + yield parseFileInfo(FshareVn, url, html) def doubleDecode(m): -- 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/FshareVn.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 2ab65ae99..3c230bbe2 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -112,6 +112,8 @@ class FshareVn(SimpleHoster): self.logError(msg) self.retry(30, 2 * 60, msg) + self.info.pop('error', None) + def checkDownloadedFile(self): # check download -- cgit v1.2.3 From 6325eda4e8c142edd11c747f7a9d4a3fa975c494 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 20 Dec 2014 14:24:13 +0100 Subject: Fix password retrieving in some plugins --- module/plugins/hoster/FshareVn.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 3c230bbe2..7b8e4b0bd 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -24,7 +24,7 @@ def doubleDecode(m): class FshareVn(SimpleHoster): __name__ = "FshareVn" __type__ = "hoster" - __version__ = "0.17" + __version__ = "0.18" __pattern__ = r'http://(?:www\.)?fshare\.vn/file/.*' @@ -66,15 +66,20 @@ class FshareVn(SimpleHoster): if not inputs: self.error(_("No FORM")) + elif 'link_file_pwd_dl' in inputs: - for password in self.getPassword().splitlines(): + password = self.getPassword() + + if password: self.logInfo(_("Password protected link, trying ") + password) inputs['link_file_pwd_dl'] = password self.html = self.load(self.url, post=inputs, decode=True) - if not 'name="link_file_pwd_dl"' in self.html: - break + + if 'name="link_file_pwd_dl"' in self.html: + self.fail(_("Incorrect password")) else: - self.fail(_("No or incorrect password")) + self.fail(_("No password found")) + else: self.html = self.load(self.url, post=inputs, decode=True) -- 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/FshareVn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FshareVn.py') diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 7b8e4b0bd..a3f9703df 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -26,7 +26,7 @@ class FshareVn(SimpleHoster): __type__ = "hoster" __version__ = "0.18" - __pattern__ = r'http://(?:www\.)?fshare\.vn/file/.*' + __pattern__ = r'http://(?:www\.)?fshare\.vn/file/.+' __description__ = """FshareVn hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3