summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-08-10 21:20:35 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-08-29 23:08:33 +0200
commitf4774041abbd32bca0cdece1c100b7c50c77a68c (patch)
tree7c816dec2b172f9b2226747eecc44446aebb254f
parentRemove trailing whitespaces + remove license headers + import urllib methods ... (diff)
downloadpyload-f4774041abbd32bca0cdece1c100b7c50c77a68c.tar.xz
[DdlstorageCom] Mark dead
-rw-r--r--module/plugins/accounts/DdlstorageCom.py54
-rw-r--r--module/plugins/crypter/DdlstorageComFolder.py11
-rw-r--r--module/plugins/hoster/DdlstorageCom.py85
3 files changed, 11 insertions, 139 deletions
diff --git a/module/plugins/accounts/DdlstorageCom.py b/module/plugins/accounts/DdlstorageCom.py
deleted file mode 100644
index 7fffc3b74..000000000
--- a/module/plugins/accounts/DdlstorageCom.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from hashlib import md5
-from time import mktime, strptime
-
-from module.plugins.internal.XFSPAccount import XFSPAccount
-from module.common.json_layer import json_loads
-from module.utils import parseFileSize
-
-# DDLStorage API Documentation:
-# http://www.ddlstorage.com/cgi-bin/api_req.cgi?req_type=doc
-
-
-class DdlstorageCom(XFSPAccount):
- __name__ = "DdlstorageCom"
- __type__ = "account"
- __version__ = "1.00"
-
- __description__ = """DDLStorage.com account plugin"""
- __author_name__ = "stickell"
- __author_mail__ = "l.stickell@yahoo.it"
-
- MAIN_PAGE = "http://ddlstorage.com/"
-
-
- def loadAccountInfo(self, user, req):
- password = self.accounts[user]['password']
- api_data = req.load('http://www.ddlstorage.com/cgi-bin/api_req.cgi',
- post={'req_type': 'user_info',
- 'client_id': 53472,
- 'user_login': user,
- 'user_password': md5(password).hexdigest(),
- 'sign': md5('user_info%d%s%s%s' % (53472, user, md5(password).hexdigest(),
- '25JcpU2dPOKg8E2OEoRqMSRu068r0Cv3')).hexdigest()})
- api_data = api_data.replace('<pre>', '').replace('</pre>', '')
- self.logDebug('Account Info API data: ' + api_data)
- api_data = json_loads(api_data)
-
- if api_data['status'] != 'OK': # 'status' must be always OK for a working account
- return {"premium": False, "valid": False}
-
- if api_data['account_type'] == 'REGISTERED':
- premium = False
- validuntil = None
- else:
- premium = True
- validuntil = int(mktime(strptime(api_data['premium_expire'], "%Y-%m-%d %H:%M:%S")))
-
- if api_data['usr_bandwidth_available'] == 'UNLIMITED':
- trafficleft = -1
- else:
- trafficleft = parseFileSize(api_data['usr_bandwidth_available']) / 1024
-
- return {"premium": premium, "validuntil": validuntil, "trafficleft": trafficleft}
diff --git a/module/plugins/crypter/DdlstorageComFolder.py b/module/plugins/crypter/DdlstorageComFolder.py
index 70a7312be..3b1dc6dd6 100644
--- a/module/plugins/crypter/DdlstorageComFolder.py
+++ b/module/plugins/crypter/DdlstorageComFolder.py
@@ -1,17 +1,18 @@
# -*- coding: utf-8 -*-
-from module.plugins.internal.SimpleCrypter import SimpleCrypter
+from module.plugins.internal.DeadCrypter import DeadCrypter, create_getInfo
-class DdlstorageComFolder(SimpleCrypter):
+class DdlstorageComFolder(DeadCrypter):
__name__ = "DdlstorageComFolder"
__type__ = "crypter"
- __version__ = "0.02"
+ __version__ = "0.03"
- __pattern__ = r'http://(?:www\.)?ddlstorage.com/folder/\w{10}'
+ __pattern__ = r'https?://(?:www\.)?ddlstorage\.com/folder/\w+'
__description__ = """DDLStorage.com folder decrypter plugin"""
__author_name__ = ("godofdream", "stickell")
__author_mail__ = ("soilfiction@gmail.com", "l.stickell@yahoo.it")
- LINK_PATTERN = r'<a class="sub_title" style="text-decoration:none;" href="(http://www.ddlstorage.com/.*)">'
+
+getInfo = create_getInfo(SpeedLoadOrg)
diff --git a/module/plugins/hoster/DdlstorageCom.py b/module/plugins/hoster/DdlstorageCom.py
index 46255aaad..4d77289d7 100644
--- a/module/plugins/hoster/DdlstorageCom.py
+++ b/module/plugins/hoster/DdlstorageCom.py
@@ -1,93 +1,18 @@
# -*- coding: utf-8 -*-
-import re
+from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
-from hashlib import md5
-from module.common.json_layer import json_loads
-from module.network.RequestFactory import getURL
-from module.plugins.Plugin import chunks
-from module.plugins.hoster.XFileSharingPro import XFileSharingPro
-
-
-def getInfo(urls):
- # DDLStorage API Documentation:
- # http://www.ddlstorage.com/cgi-bin/api_req.cgi?req_type=doc
- ids = dict()
- for url in urls:
- m = re.search(DdlstorageCom.__pattern__, url)
- ids[m.group('ID')] = url
-
- for chunk in chunks(ids.keys(), 5):
- for _ in xrange(5):
- api = getURL('http://www.ddlstorage.com/cgi-bin/api_req.cgi',
- post={'req_type': 'file_info_free',
- 'client_id': 53472,
- 'file_code': ','.join(chunk),
- 'sign': md5('file_info_free%d%s%s' % (53472, ','.join(chunk),
- '25JcpU2dPOKg8E2OEoRqMSRu068r0Cv3')).hexdigest()})
- api = api.replace('<pre>', '').replace('</pre>', '')
- api = json_loads(api)
- if 'error' not in api:
- break
-
- result = list()
- for el in api:
- if el['status'] == 'online':
- result.append((el['file_name'], int(el['file_size']), 2, ids[el['file_code']]))
- else:
- result.append((ids[el['file_code']], 0, 1, ids[el['file_code']]))
- yield result
-
-
-class DdlstorageCom(XFileSharingPro):
+class DdlstorageCom(DeadHoster):
__name__ = "DdlstorageCom"
__type__ = "hoster"
- __version__ = "1.01"
+ __version__ = "1.02"
- __pattern__ = r'http://(?:www\.)?ddlstorage.com/(?P<ID>\w{12})'
+ __pattern__ = r'https?://(?:www\.)?ddlstorage\.com/\w+'
__description__ = """DDLStorage.com hoster plugin"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
- HOSTER_NAME = "ddlstorage.com"
-
- FILE_INFO_PATTERN = r'<p class="sub_title"[^>]*>(?P<N>.+) \((?P<S>[^)]+)\)</p>'
-
-
- def prepare(self):
- self.getAPIData()
- super(DdlstorageCom, self).prepare()
-
- def getAPIData(self):
- file_id = re.match(self.__pattern__, self.pyfile.url).group('ID')
- data = {'client_id': 53472,
- 'file_code': file_id}
- if self.user:
- passwd = self.account.getAccountData(self.user)['password']
- data['req_type'] = 'file_info_reg'
- data['user_login'] = self.user
- data['user_password'] = md5(passwd).hexdigest()
- data['sign'] = md5('file_info_reg%d%s%s%s%s' % (data['client_id'], data['user_login'],
- data['user_password'], data['file_code'],
- '25JcpU2dPOKg8E2OEoRqMSRu068r0Cv3')).hexdigest()
- else:
- data['req_type'] = 'file_info_free'
- data['sign'] = md5('file_info_free%d%s%s' % (data['client_id'], data['file_code'],
- '25JcpU2dPOKg8E2OEoRqMSRu068r0Cv3')).hexdigest()
-
- self.api_data = self.load('http://www.ddlstorage.com/cgi-bin/api_req.cgi', post=data)
- self.api_data = self.api_data.replace('<pre>', '').replace('</pre>', '')
- self.logDebug('API Data: ' + self.api_data)
- self.api_data = json_loads(self.api_data)[0]
-
- if self.api_data['status'] == 'offline':
- self.offline()
- if 'file_name' in self.api_data:
- self.pyfile.name = self.api_data['file_name']
- if 'file_size' in self.api_data:
- self.pyfile.size = self.api_data['size'] = self.api_data['file_size']
- if 'file_md5_base64' in self.api_data:
- self.api_data['md5_ddlstorage'] = self.api_data['file_md5_base64']
+getInfo = create_getInfo(DdlstorageCom)