summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/hoster
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugin/hoster')
-rw-r--r--pyload/plugin/hoster/Ftp.py10
-rw-r--r--pyload/plugin/hoster/LolabitsEs.py45
-rw-r--r--pyload/plugin/hoster/SolidfilesCom.py30
-rw-r--r--pyload/plugin/hoster/YadiSk.py81
4 files changed, 156 insertions, 10 deletions
diff --git a/pyload/plugin/hoster/Ftp.py b/pyload/plugin/hoster/Ftp.py
index d7aaa730e..b18e39a1c 100644
--- a/pyload/plugin/hoster/Ftp.py
+++ b/pyload/plugin/hoster/Ftp.py
@@ -28,16 +28,6 @@ class Ftp(Hoster):
self.resumeDownload = True
- #: Work-around to `filename*=UTF-8` bug; remove in 0.4.10
- def download(self, url, get={}, post={}, ref=True, cookies=True, disposition=False):
- try:
- if disposition:
- content = urllib2.urlopen(url).info()['Content-Disposition'].split(';')
- self.pyfile.name = content[1].split('filename=')[1][1:-1] or self.pyfile.name
- finally:
- return super(Ftp, self).download(url, get, post, ref, cookies, False)
-
-
def process(self, pyfile):
parsed_url = urlparse(pyfile.url)
netloc = parsed_url.netloc
diff --git a/pyload/plugin/hoster/LolabitsEs.py b/pyload/plugin/hoster/LolabitsEs.py
new file mode 100644
index 000000000..dbd392624
--- /dev/null
+++ b/pyload/plugin/hoster/LolabitsEs.py
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*
+
+import HTMLParser
+import re
+
+from pyload.plugin.internal.SimpleHoster import SimpleHoster
+
+
+class LolabitsEs(SimpleHoster):
+ __name__ = "LolabitsEs"
+ __type__ = "hoster"
+ __version__ = "0.02"
+
+ __pattern__ = r'https?://(?:www\.)?lolabits\.es/.+'
+
+ __description__ = """Lolabits.es hoster plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")]
+
+
+ NAME_PATTERN = r'Descargar: <b>(?P<N>.+?)<'
+ SIZE_PATTERN = r'class="fileSize">(?P<S>[\d.,]+) (?P<U>[\w^_]+)'
+ OFFLINE_PATTERN = r'Un usuario con este nombre no existe'
+
+ FILEID_PATTERN = r'name="FileId" value="(\d+)"'
+ TOKEN_PATTERN = r'name="__RequestVerificationToken" type="hidden" value="(.+?)"'
+ LINK_PATTERN = r'"redirectUrl":"(.+?)"'
+
+
+ def setup(self):
+ self.chunkLimit = 1
+
+
+ def handleFree(self, pyfile):
+ fileid = re.search(self.FILEID_PATTERN, self.html).group(1)
+ self.logDebug("FileID: " + fileid)
+
+ token = re.search(self.TOKEN_PATTERN, self.html).group(1)
+ self.logDebug("Token: " + token)
+
+ self.html = self.load("http://lolabits.es/action/License/Download",
+ post={'fileId' : fileid,
+ '__RequestVerificationToken' : token}).decode('unicode-escape')
+
+ self.link = HTMLParser.HTMLParser().unescape(re.search(self.LINK_PATTERN, self.html).group(1))
diff --git a/pyload/plugin/hoster/SolidfilesCom.py b/pyload/plugin/hoster/SolidfilesCom.py
new file mode 100644
index 000000000..e700e861f
--- /dev/null
+++ b/pyload/plugin/hoster/SolidfilesCom.py
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+#
+# Test links:
+# http://www.solidfiles.com/d/609cdb4b1b
+
+from pyload.plugin.internal.SimpleHoster import SimpleHoster
+
+
+class SolidfilesCom(SimpleHoster):
+ __name__ = "SolidfilesCom"
+ __type__ = "hoster"
+ __version__ = "0.02"
+
+ __pattern__ = r'http://(?:www\.)?solidfiles\.com\/d/\w+'
+
+ __description__ = """Solidfiles.com hoster plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("sraedler", "simon.raedler@yahoo.de")]
+
+
+ NAME_PATTERN = r'<h1 title="(?P<N>.+?)"'
+ SIZE_PATTERN = r'<p class="meta">(?P<S>[\d.,]+) (?P<U>[\w_^]+)'
+ OFFLINE_PATTERN = r'<h1>404'
+
+ LINK_FREE_PATTERN = r'id="ddl-text" href="(.+?)"'
+
+
+ def setup(self):
+ self.multiDL = True
+ self.chunkLimit = 1
diff --git a/pyload/plugin/hoster/YadiSk.py b/pyload/plugin/hoster/YadiSk.py
new file mode 100644
index 000000000..28576d5d6
--- /dev/null
+++ b/pyload/plugin/hoster/YadiSk.py
@@ -0,0 +1,81 @@
+# -*- coding: utf-8 -*-
+
+import random
+import re
+
+from pyload.plugin.internal.SimpleHoster import SimpleHoster
+from pyload.utils import json_loads
+
+
+class YadiSk(SimpleHoster):
+ __name__ = "YadiSk"
+ __type__ = "hoster"
+ __version__ = "0.03"
+
+ __pattern__ = r'https?://yadi\.sk/d/\w+'
+
+ __description__ = """Yadi.sk hoster plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("GammaC0de", None)]
+
+
+ OFFLINE_PATTERN = r'Nothing found'
+
+
+ def setup(self):
+ self.resumeDownload = False
+ self.multiDL = False
+ self.chunkLimit = 1
+
+
+ def handleFree(self, pyfile):
+ m = re.search(r'<script id="models-client" type="application/json">(.+?)</script>', self.html)
+ if m is None:
+ self.error(_("could not find required json data"))
+
+ res = json_loads(m.group(1))
+
+ yadisk_ver = None
+ yadisk_sk = None
+ yadisk_id = None
+ yadisk_size = None
+ yadisk_name = None
+
+ try: #@TODO: Copy to apiInfo
+ for sect in res:
+ if 'model' in sect:
+ if sect['model'] == "config":
+ yadisk_ver = sect['data']['version']
+ yadisk_sk = sect['data']['sk']
+
+ elif sect['model'] == "resource":
+ yadisk_id = sect['data']['id']
+ yadisk_size = sect['data']['meta']['size']
+ yadisk_name = sect['data']['name']
+
+ except Exception, e:
+ self.fail(_("Unexpected server response"), e)
+
+ if None in (yadisk_id, yadisk_sk, yadisk_id, yadisk_size, yadisk_name):
+ self.error(_("Missing JSON data"))
+
+ self.pyfile.size = yadisk_size
+ self.pyfile.name = yadisk_name
+
+ yadisk_idclient = ""
+ for _i in range(32):
+ yadisk_idclient += random.choice('0123456abcdef')
+
+ try:
+ self.html = self.load("https://yadi.sk/models/",
+ get={'_m': "do-get-resource-url"},
+ post={'idClient': yadisk_idclient,
+ 'version' : yadisk_ver,
+ '_model.0': "do-get-resource-url",
+ 'sk' : yadisk_sk,
+ 'id.0' : yadisk_id})
+
+ self.link = json_loads(self.html)['models'][0]['data']['file']
+
+ except Exception:
+ pass