summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/FastixRu.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/FastixRu.py')
-rw-r--r--module/plugins/hoster/FastixRu.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py
index 8eeabc17c..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<ID>[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])
@@ -38,7 +43,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 +51,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)