summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/CzshareCom.py
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2011-09-27 11:04:57 +0200
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2011-09-27 11:04:57 +0200
commita159147ae67249279677d51ff348c0c7c70f0b1d (patch)
tree5fbbf2b7ebcb6e435a35b1488a0173beb39ab577 /module/plugins/hoster/CzshareCom.py
parentplugins: czshare premium, czshare/quickshare/filefactory folders (diff)
downloadpyload-a159147ae67249279677d51ff348c0c7c70f0b1d.tar.xz
plugins: fix czshare premium, add ifolder.ru, share-rapid.com by MikyWoW
Diffstat (limited to 'module/plugins/hoster/CzshareCom.py')
-rw-r--r--module/plugins/hoster/CzshareCom.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py
index f6cbb200a..140aa9569 100644
--- a/module/plugins/hoster/CzshareCom.py
+++ b/module/plugins/hoster/CzshareCom.py
@@ -63,7 +63,7 @@ class CzshareCom(Hoster):
__name__ = "CzshareCom"
__type__ = "hoster"
__pattern__ = r"http://(\w*\.)*czshare\.(com|cz)/(\d+/|download.php\?).*"
- __version__ = "0.8"
+ __version__ = "0.8a"
__description__ = """CZshare.com"""
__author_name__ = ("zoidberg")
@@ -85,12 +85,7 @@ class CzshareCom(Hoster):
def process(self, pyfile):
self.getFileInfo(pyfile)
- if self.premium and self.account is not None:
- for i in range(2):
- if self.handlePremium(pyfile): break
- else:
- self.resetAccount()
- else:
+ if not self.account or not self.handlePremium(pyfile):
self.handleFree(pyfile)
self.checkDownloadedFile()
@@ -120,13 +115,18 @@ class CzshareCom(Hoster):
size = float(found.group(1).replace(',','.').replace(' ',''))
pyfile.size = size * 1024 ** {'KiB': 1, 'MiB': 2, 'GiB': 3}[found.group(2)]
+ pyfile.url = url
+
def handlePremium(self, pyfile):
- # check user credit
+ # check if user logged in
found = re.search(self.USER_CREDIT_PATTERN, self.html)
- if found is None:
+ if not found:
self.account.relogin(self.user)
- return False
+ self.html = self.load(pyfile.url, cookies=True, decode=True)
+ found = re.search(self.USER_CREDIT_PATTERN, self.html)
+ if not found: return False
+ # check user credit
try:
credit = float(found.group(1).replace(',','.').replace(' ',''))
credit = credit * 1024 ** {'KB': 0, 'MB': 1, 'GB': 2}[found.group(2)]