summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/SmoozedCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2015-02-16 21:59:10 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2015-02-16 21:59:10 +0100
commit8e7d14bae4d3c836f029a1235eb227380acc3f75 (patch)
treeebd0679642cccb994e70a89a106b394189cb28bc /module/plugins/hoster/SmoozedCom.py
parentMerge branch 'stable' into 0.4.10 (diff)
downloadpyload-8e7d14bae4d3c836f029a1235eb227380acc3f75.tar.xz
Fix plugins to work on 0.4.10
Diffstat (limited to 'module/plugins/hoster/SmoozedCom.py')
-rw-r--r--module/plugins/hoster/SmoozedCom.py63
1 files changed, 0 insertions, 63 deletions
diff --git a/module/plugins/hoster/SmoozedCom.py b/module/plugins/hoster/SmoozedCom.py
deleted file mode 100644
index bd653ff59..000000000
--- a/module/plugins/hoster/SmoozedCom.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from module.common.json_layer import json_loads
-from module.plugins.internal.MultiHoster import MultiHoster
-
-
-class SmoozedCom(MultiHoster):
- __name__ = "SmoozedCom"
- __type__ = "hoster"
- __version__ = "0.03"
-
- __pattern__ = r'^unmatchable$' #: Since we want to allow the user to specify the list of hoster to use we let MultiHoster.coreReady
-
- __description__ = """Smoozed.com hoster plugin"""
- __license__ = "GPLv3"
- __authors__ = [("", "")]
-
-
- def handlePremium(self, pyfile):
- # In some cases hostsers do not supply us with a filename at download, so we
- # are going to set a fall back filename (e.g. for freakshare or xfileshare)
- pyfile.name = pyfile.name.split('/').pop() # Remove everthing before last slash
-
- # Correction for automatic assigned filename: Removing html at end if needed
- suffix_to_remove = ["html", "htm", "php", "php3", "asp", "shtm", "shtml", "cfml", "cfm"]
- temp = pyfile.name.split('.')
-
- if temp.pop() in suffix_to_remove:
- pyfile.name = ".".join(temp)
-
- # Check the link
- get_data = {'session_key': self.account.getAccountInfo(self.user)['session'],
- 'url' : pyfile.url}
-
- data = json_loads(self.load("http://www2.smoozed.com/api/check", get=get_data))
-
- if data["state"] != "ok":
- self.fail(data["message"])
-
- if data["data"].get("state", "ok") != "ok":
- if data["data"] == "Offline":
- self.offline()
- else:
- self.fail(data["data"]["message"])
-
- pyfile.name = data["data"]["name"]
- pyfile.size = int(data["data"]["size"])
-
- # Start the download
- header = self.load("http://www2.smoozed.com/api/download", get=get_data, just_header=True)
-
- if not "location" in header:
- self.fail(_("Unable to initialize download"))
- else:
- self.link = header["location"][-1] if isinstance(header["location"], list) else header["location"]
-
-
- def checkFile(self):
- if self.checkDownload({'error': '{"state":"error"}',
- 'retry': '{"state":"retry"}'}):
- self.fail(_("Error response received"))
-
- return super(SmoozedCom, self).checkFile()