summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/FastixRu.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-07 23:40:50 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 10:58:42 +0200
commit887ad58e4c6c20b992311bbdf931bcd18e73d384 (patch)
treef31beb241bacca0bfea4c1acc4e9ace813755cef /module/plugins/hoster/FastixRu.py
parent[AccountManager] Fixed #733 (diff)
parent[File4safe] distributing LINK_PATTERN (diff)
downloadpyload-887ad58e4c6c20b992311bbdf931bcd18e73d384.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: module/plugins/Account.py module/plugins/AccountManager.py module/plugins/Hook.py module/plugins/OCR.py module/plugins/Plugin.py module/plugins/PluginManager.py module/plugins/ReCaptcha.py module/plugins/accounts/Ftp.py module/plugins/accounts/Http.py module/plugins/internal/MultiHoster.py module/plugins/ocr/GigasizeCom.py module/plugins/ocr/LinksaveIn.py module/plugins/ocr/NetloadIn.py module/plugins/ocr/ShareonlineBiz.py
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)