diff options
author | Stefano <l.stickell@yahoo.it> | 2013-10-13 17:42:02 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2013-10-13 17:42:02 +0200 |
commit | 98445d7446b202334ebacbac282ba04fe3267fd5 (patch) | |
tree | 2439813ed6275c7fcf0a1a3d745a0aa752bf48f4 /module/plugins/hoster/FastixRu.py | |
parent | Zippyshare: little improvements. (diff) | |
download | pyload-98445d7446b202334ebacbac282ba04fe3267fd5.tar.xz |
MultiHosters: no need an account if the link has already been converted.
See also #307
Diffstat (limited to 'module/plugins/hoster/FastixRu.py')
-rw-r--r-- | module/plugins/hoster/FastixRu.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index 4d3e7b93d..c2791c5d2 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -9,7 +9,7 @@ from module.common.json_layer import json_loads class FastixRu(Hoster): __name__ = "FastixRu" - __version__ = "0.02" + __version__ = "0.03" __type__ = "hoster" __pattern__ = r"http?://.*fastix.ru\..*" __description__ = """Fastix hoster plugin""" @@ -25,19 +25,18 @@ class FastixRu(Hoster): name += "%s.tmp" % randrange(100, 999) return name - def init(self): + def setup(self): self.chunkLimit = 3 self.resumeDownload = True def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "Fastix") - self.fail("No Fastix account provided") - - self.logDebug("Old URL: %s" % pyfile.url) if re.match(self.__pattern__, pyfile.url): new_url = pyfile.url + elif not self.account: + self.logError(_("Please enter your %s account or deactivate this plugin") % "Fastix") + self.fail("No Fastix account provided") else: + self.logDebug("Old URL: %s" % pyfile.url) api_key = self.account.getAccountData(self.user) api_key = api_key["api"] url = "http://fastix.ru/api_v2/?apikey=%s&sub=getdirectlink&link=%s" % (api_key, pyfile.url) @@ -49,7 +48,8 @@ class FastixRu(Hoster): else: new_url = data["downloadlink"] - self.logDebug("New URL: %s" % new_url) + if new_url != pyfile.url: + self.logDebug("New URL: %s" % new_url) if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"): #only use when name wasnt already set |