summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/BasketbuildCom.py59
-rw-r--r--module/plugins/hoster/LinksnappyCom.py25
-rw-r--r--module/plugins/hoster/ZippyshareCom.py17
3 files changed, 77 insertions, 24 deletions
diff --git a/module/plugins/hoster/BasketbuildCom.py b/module/plugins/hoster/BasketbuildCom.py
new file mode 100644
index 000000000..651470e54
--- /dev/null
+++ b/module/plugins/hoster/BasketbuildCom.py
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*
+#
+# Test links:
+# https://s.basketbuild.com/filedl/devs?dev=pacman&dl=pacman/falcon/RC-3/pac_falcon-RC-3-20141103.zip
+# https://s.basketbuild.com/filedl/gapps?dl=gapps-gb-20110828-signed.zip
+
+import re
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+
+class BasketbuildCom(SimpleHoster):
+ __name__ = "BasketbuildCom"
+ __type__ = "hoster"
+ __version__ = "0.01"
+
+ __pattern__ = r'https?://(?:www\.)?\w.basketbuild.com/filedl/.+'
+
+ __description__ = """basketbuild.com hoster plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")]
+
+
+ NAME_PATTERN = r'File Name:</strong> (?P<N>.*?)<br/>'
+ SIZE_PATTERN = r'File Size:</strong> (?P<S>[\d.,]+) (?P<U>[\w^_]+)<br/>'
+ OFFLINE_PATTERN = r'404 - Page Not Found'
+
+
+ def setup(self):
+ self.multiDL = True
+ self.resumeDownload = True
+ self.chunkLimit = 1
+
+
+ def handleFree(self, pyfile):
+ link1 = re.search(r'href="(.+dlgate/.+)"',self.html)
+ try:
+ self.logDebug("Next hop: %s" % link1.group(1))
+ self.html = self.load(link1.group(1), cookies=True)
+ except AttributeError:
+ self.error(_("Hop #1 not found"))
+
+ wait = re.search(r'var sec = (\d+);',self.html)
+ try:
+ self.logDebug("Wait %s seconds" % wait.group(1))
+ self.wait(wait.group(1))
+ except AttributeError:
+ self.logDebug("No wait time found")
+
+ link2 = re.search(r'id="dlLink">\s*<a href="(.*?)"',self.html)
+ try:
+ self.logDebug("DL-Link: %s" % link2.group(1))
+ except AttributeError:
+ self.error(_("DL-Link not found"))
+
+ self.download(link2.group(1), cookies=True, disposition=True)
+
+
+getInfo = create_getInfo(BasketbuildCom)
diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py
index aa3466036..5b0fab43a 100644
--- a/module/plugins/hoster/LinksnappyCom.py
+++ b/module/plugins/hoster/LinksnappyCom.py
@@ -11,46 +11,43 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class LinksnappyCom(MultiHoster):
__name__ = "LinksnappyCom"
__type__ = "hoster"
- __version__ = "0.07"
+ __version__ = "0.08"
- __pattern__ = r'https?://(?:[^/]*\.)?linksnappy\.com'
+ __pattern__ = r'https?://(?:[^/]+\.)?linksnappy\.com'
__description__ = """Linksnappy.com multi-hoster plugin"""
__license__ = "GPLv3"
__authors__ = [("stickell", "l.stickell@yahoo.it")]
- SINGLE_CHUNK_HOSTERS = ('easybytez.com')
+ SINGLE_CHUNK_HOSTERS = ["easybytez.com"]
def handlePremium(self, pyfile):
- host = self._get_host(pyfile.url)
- json_params = json_dumps({'link': pyfile.url,
- 'type': host,
+ host = self._get_host(pyfile.url)
+ json_params = json_dumps({'link' : pyfile.url,
+ 'type' : host,
'username': self.user,
'password': self.account.getAccountData(self.user)['password']})
- r = self.load('http://gen.linksnappy.com/genAPI.php',
+
+ r = self.load("http://gen.linksnappy.com/genAPI.php",
post={'genLinks': json_params})
+
self.logDebug("JSON data: " + r)
j = json_loads(r)['links'][0]
if j['error']:
- msg = _("Error converting the link")
- self.logError(msg, j['error'])
- self.fail(msg)
+ self.error(_("Error converting the link"))
pyfile.name = j['filename']
- self.link = j['generated']
+ self.link = j['generated']
if host in self.SINGLE_CHUNK_HOSTERS:
self.chunkLimit = 1
else:
self.setup()
- if self.link != pyfile.url:
- self.logDebug("New URL: " + self.link)
-
@staticmethod
def _get_host(url):
diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py
index f32c5877f..ad4b49b44 100644
--- a/module/plugins/hoster/ZippyshareCom.py
+++ b/module/plugins/hoster/ZippyshareCom.py
@@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class ZippyshareCom(SimpleHoster):
__name__ = "ZippyshareCom"
__type__ = "hoster"
- __version__ = "0.68"
+ __version__ = "0.69"
__pattern__ = r'http://www\d{0,2}\.zippyshare\.com/v(/|iew\.jsp.*key=)(?P<KEY>[\w^_]+)'
@@ -51,20 +51,17 @@ class ZippyshareCom(SimpleHoster):
def get_checksum(self):
try:
- m = re.search(r'\+[ ]*\((\d+)[ ]*\%[ ]*(\d+)[ ]*\+[ ]*(\d+)[ ]*\%[ ]*(\d+)\)[ ]*\+', self.html)
- if m:
- a1, a2, c1, c2 = map(int, m.groups())
- b = (a1 % a2) + (c1 % c2)
- else:
- a1, a2 = map(int, re.search(r'\(\'downloadB\'\).omg = (\d+)%(\d+)' , self.html).groups())
- c1, c2 = map(int, re.search(r'\(\'downloadB\'\).omg\) \* \((\d+)%(\d+)', self.html).groups())
- b = (a1 % a2) * (c1 % c2) + 18
+ z = re.search(r'var z = (\d+)', self.html).group(1)
+ n = (z - 3) % 2
+ b = (z - 3) % 3
+
+ checksum = n + b + z - 3
except Exception:
self.error(_("Unable to calculate checksum"))
else:
- return b
+ return checksum
getInfo = create_getInfo(ZippyshareCom)