summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-11-19 21:05:07 +0100
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-11-19 21:05:07 +0100
commitb374213e3fe9b6573a4fc4146480724ac2c56f2e (patch)
treeb35a3358f18bf1673545693c3d92c52b0b47efa3 /module/plugins/hoster
parentDereferer plugin (diff)
downloadpyload-b374213e3fe9b6573a4fc4146480724ac2c56f2e.tar.xz
Update hellshare.cz, add boltsharing.com
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/BoltsharingCom.py15
-rw-r--r--module/plugins/hoster/HellshareCz.py21
-rw-r--r--module/plugins/hoster/XFileSharingPro.py4
3 files changed, 20 insertions, 20 deletions
diff --git a/module/plugins/hoster/BoltsharingCom.py b/module/plugins/hoster/BoltsharingCom.py
new file mode 100644
index 000000000..2f42c8b23
--- /dev/null
+++ b/module/plugins/hoster/BoltsharingCom.py
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+class BoltsharingCom(XFileSharingPro):
+ __name__ = "BoltsharingCom"
+ __type__ = "hoster"
+ __pattern__ = r"http://(?:\w*\.)*?boltsharing.com/\w{12}"
+ __version__ = "0.01"
+ __description__ = """Boltsharing.com hoster plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ HOSTER_NAME = "boltsharing.com"
+
+getInfo = create_getInfo(BoltsharingCom)
diff --git a/module/plugins/hoster/HellshareCz.py b/module/plugins/hoster/HellshareCz.py
index fd9f2ac32..aa494e34e 100644
--- a/module/plugins/hoster/HellshareCz.py
+++ b/module/plugins/hoster/HellshareCz.py
@@ -25,17 +25,13 @@ class HellshareCz(SimpleHoster):
__name__ = "HellshareCz"
__type__ = "hoster"
__pattern__ = r"(http://(?:.*\.)*hellshare\.(?:cz|com|sk|hu|pl)/[^?]*/\d+).*"
- __version__ = "0.81"
+ __version__ = "0.82"
__description__ = """Hellshare.cz - premium only"""
__author_name__ = ("zoidberg")
- PREMIUM_URL_PATTERN = r"launchFullDownload\('([^']*)'\);"
FILE_NAME_PATTERN = r'<h1 id="filename"[^>]*>(?P<N>[^<]+)</h1>'
FILE_SIZE_PATTERN = r'<strong id="FileSize_master">(?P<S>[0-9.]*)&nbsp;(?P<U>[kKMG])i?B</strong>'
FILE_OFFLINE_PATTERN = r'<h1>File not found.</h1>'
- #FILE_CREDITS_PATTERN = r'<strong class="filesize">(\d+) MB</strong>'
- CREDIT_LEFT_PATTERN = r'<th>(\d+)</th><td>credits'
- DOWNLOAD_AGAIN_PATTERN = r'<p>This file you downloaded already and re-download is for free. </p>'
SHOW_WINDOW_PATTERN = r'<a href="([^?]+/(\d+)/\?do=(fileDownloadButton|relatedFileDownloadButton-\2)-showDownloadWindow)"'
def setup(self):
@@ -47,25 +43,14 @@ class HellshareCz(SimpleHoster):
pyfile.url = re.search(self.__pattern__, pyfile.url).group(1)
self.html = self.load(pyfile.url, decode = True)
self.getFileInfo()
+ if not self.checkTrafficLeft():
+ self.fail("Not enough traffic left for user %s." % self.user)
found = re.search(self.SHOW_WINDOW_PATTERN, self.html)
if not found: self.parseError('SHOW WINDOW')
self.url = "http://www.hellshare.com" + found.group(1)
self.logDebug("DOWNLOAD URL: " + self.url)
- # check credit
- if self.DOWNLOAD_AGAIN_PATTERN in self.html:
- self.logInfo("Downloading again for free")
- else:
- found = re.search(self.CREDIT_LEFT_PATTERN, self.html)
- credits_left = int(found.group(1)) if found else (self.account.getAccountInfo(self.user, True)["trafficleft"] / 1024)
- file_credits = ceil(self.pyfile.size / float(1024 ** 2))
-
- if credits_left < file_credits:
- self.fail("Not enough credit left for user %s: %d (%d needed)." % (self.user, credits_left, file_credits))
- else:
- self.logInfo("Downloading file for %d credits, %d credits left" % (file_credits, credits_left))
-
self.download(self.url)
getInfo = create_getInfo(HellshareCz)
diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py
index d58a7073e..0bf7618c8 100644
--- a/module/plugins/hoster/XFileSharingPro.py
+++ b/module/plugins/hoster/XFileSharingPro.py
@@ -34,7 +34,7 @@ class XFileSharingPro(SimpleHoster):
__name__ = "XFileSharingPro"
__type__ = "hoster"
__pattern__ = r"^unmatchable$"
- __version__ = "0.14"
+ __version__ = "0.15"
__description__ = """XFileSharingPro common hoster base"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -94,7 +94,7 @@ class XFileSharingPro(SimpleHoster):
if not hasattr(self, "HOSTER_NAME"):
self.HOSTER_NAME = re.search(self.__pattern__, self.pyfile.url).group(1)
if not hasattr(self, "DIRECT_LINK_PATTERN"):
- self.DIRECT_LINK_PATTERN = r'(http://(\w+\.%s|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\d+/\w+/)[^"\'<]+)' % self.HOSTER_NAME
+ self.DIRECT_LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\d+/\w+/)[^"\'<]+)' % self.HOSTER_NAME
self.captcha = self.errmsg = None
self.passwords = self.getPassword().splitlines()