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/FastixRu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FastixRu.py') diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index a4c85b4ca..5f6fd2d4c 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -14,7 +14,7 @@ class FastixRu(MultiHoster): __type__ = "hoster" __version__ = "0.08" - __pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/(?P\w{24})' + __pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/\w{24}' __description__ = """Fastix hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From ea58af3c625d90aec6becfd943289e42e4a71a9a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 2 Jan 2015 02:49:26 +0100 Subject: Code cosmetics --- module/plugins/hoster/FastixRu.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster/FastixRu.py') diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index 5f6fd2d4c..b68c79ebc 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -32,8 +32,7 @@ class FastixRu(MultiHoster): def setup(self): - self.chunkLimit = 3 - self.resumeDownload = True + self.chunkLimit = 3 def handlePremium(self): -- cgit v1.2.3 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/FastixRu.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'module/plugins/hoster/FastixRu.py') diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index b68c79ebc..9a38f5a72 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -12,11 +12,11 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class FastixRu(MultiHoster): __name__ = "FastixRu" __type__ = "hoster" - __version__ = "0.08" + __version__ = "0.09" __pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/\w{24}' - __description__ = """Fastix hoster plugin""" + __description__ = """Fastix multi-hoster plugin""" __license__ = "GPLv3" __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] @@ -35,12 +35,12 @@ class FastixRu(MultiHoster): self.chunkLimit = 3 - def handlePremium(self): + def handlePremium(self, pyfile): api_key = self.account.getAccountData(self.user) api_key = api_key['api'] page = self.load("http://fastix.ru/api_v2/", - get={'apikey': api_key, 'sub': "getdirectlink", 'link': self.pyfile.url}) + get={'apikey': api_key, 'sub': "getdirectlink", 'link': pyfile.url}) data = json_loads(page) self.logDebug("Json data", data) @@ -50,19 +50,19 @@ class FastixRu(MultiHoster): else: self.link = data['downloadlink'] - if self.link != self.pyfile.url: + if self.link != pyfile.url: self.logDebug("New URL: %s" % self.link) - if self.pyfile.name.startswith("http") or self.pyfile.name.startswith("Unknown"): + if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"): #only use when name wasnt already set - self.pyfile.name = self.getFilename(self.link) + pyfile.name = self.getFilename(self.link) def checkFile(self): - super(FastixRu, self).checkFile() - - if self.checkDownload({"error": "An error occurred while processing your request"}) is "error": + if self.checkDownload({"error": "An error occurred while processing your request"}): self.retry(wait_time=60, reason=_("An error occurred while generating link")) + return super(FastixRu, self).checkFile() + getInfo = create_getInfo(FastixRu) -- cgit v1.2.3 From b25bc61dd47d8d3c42969bd0f72443b21c4b059e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 8 Feb 2015 02:09:45 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/FastixRu.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/FastixRu.py') diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index 9a38f5a72..d534101d8 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -39,20 +39,18 @@ class FastixRu(MultiHoster): api_key = self.account.getAccountData(self.user) api_key = api_key['api'] - page = self.load("http://fastix.ru/api_v2/", + self.html = self.load("http://fastix.ru/api_v2/", get={'apikey': api_key, 'sub': "getdirectlink", 'link': pyfile.url}) - data = json_loads(page) + + data = json_loads(self.html) self.logDebug("Json data", data) - if "error\":true" in page: + if "error\":true" in self.html: self.offline() else: self.link = data['downloadlink'] - if self.link != pyfile.url: - self.logDebug("New URL: %s" % self.link) - if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"): #only use when name wasnt already set pyfile.name = self.getFilename(self.link) -- cgit v1.2.3 From 1f8ae39acba53cebb46331692515f2ed42f8e12d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 10 Mar 2015 22:42:32 +0100 Subject: Update plugins after SimpleHoster changes --- module/plugins/hoster/FastixRu.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/FastixRu.py') diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index d534101d8..759b9bfec 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -12,7 +12,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class FastixRu(MultiHoster): __name__ = "FastixRu" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" __pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/\w{24}' @@ -56,11 +56,11 @@ class FastixRu(MultiHoster): pyfile.name = self.getFilename(self.link) - def checkFile(self): + def checkFile(self, rules={}): if self.checkDownload({"error": "An error occurred while processing your request"}): self.retry(wait_time=60, reason=_("An error occurred while generating link")) - return super(FastixRu, self).checkFile() + return super(FastixRu, self).checkFile(rules) getInfo = create_getInfo(FastixRu) -- cgit v1.2.3 From 2bc144adb6bc2759b635e09687b27bf96074827f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 18 Mar 2015 13:39:07 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/FastixRu.py | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'module/plugins/hoster/FastixRu.py') diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index 759b9bfec..2d36ad4a4 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -12,7 +12,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class FastixRu(MultiHoster): __name__ = "FastixRu" __type__ = "hoster" - __version__ = "0.10" + __version__ = "0.11" __pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/\w{24}' @@ -21,16 +21,6 @@ class FastixRu(MultiHoster): __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] - def getFilename(self, url): - try: - name = unquote(url.rsplit("/", 1)[1]) - except IndexError: - name = "Unknown_Filename..." - if name.endswith("..."): # incomplete filename, append random stuff - name += "%s.tmp" % randrange(100, 999) - return name - - def setup(self): self.chunkLimit = 3 @@ -51,16 +41,5 @@ class FastixRu(MultiHoster): else: self.link = data['downloadlink'] - if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"): - #only use when name wasnt already set - pyfile.name = self.getFilename(self.link) - - - def checkFile(self, rules={}): - if self.checkDownload({"error": "An error occurred while processing your request"}): - self.retry(wait_time=60, reason=_("An error occurred while generating link")) - - return super(FastixRu, self).checkFile(rules) - getInfo = create_getInfo(FastixRu) -- 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/FastixRu.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/FastixRu.py') diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index 2d36ad4a4..0dc12568d 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -15,6 +15,7 @@ class FastixRu(MultiHoster): __version__ = "0.11" __pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/\w{24}' + __config__ = [("use_premium", "bool", "Use premium account if available", True)] __description__ = """Fastix multi-hoster plugin""" __license__ = "GPLv3" -- 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/FastixRu.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'module/plugins/hoster/FastixRu.py') diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index 0dc12568d..cc50f4229 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- import re - -from random import randrange -from urllib import unquote +import urllib from module.common.json_layer import json_loads from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo -- cgit v1.2.3