From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hoster/FastixRu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FastixRu.py') diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index 8eeabc17c..a59fae498 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -38,7 +38,7 @@ class FastixRu(Hoster): else: self.logDebug("Old URL: %s" % pyfile.url) api_key = self.account.getAccountData(self.user) - api_key = api_key["api"] + api_key = api_key['api'] url = "http://fastix.ru/api_v2/?apikey=%s&sub=getdirectlink&link=%s" % (api_key, pyfile.url) page = self.load(url) data = json_loads(page) @@ -46,7 +46,7 @@ class FastixRu(Hoster): if "error\":true" in page: self.offline() else: - new_url = data["downloadlink"] + new_url = data['downloadlink'] if new_url != pyfile.url: self.logDebug("New URL: %s" % new_url) -- 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/FastixRu.py | 11 ++++++++--- 1 file changed, 8 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 a59fae498..199544840 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -1,21 +1,26 @@ # -*- coding: utf-8 -*- import re -from urllib import unquote + from random import randrange -from module.plugins.Hoster import Hoster +from urllib import unquote + from module.common.json_layer import json_loads +from module.plugins.Hoster import Hoster class FastixRu(Hoster): __name__ = "FastixRu" - __version__ = "0.04" __type__ = "hoster" + __version__ = "0.04" + __pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/(?P[a-zA-Z0-9]{24})' + __description__ = """Fastix hoster plugin""" __author_name__ = "Massimo Rosamilia" __author_mail__ = "max@spiritix.eu" + def getFilename(self, url): try: name = unquote(url.rsplit("/", 1)[1]) -- cgit v1.2.3