summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-13 09:22:01 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-13 09:22:01 +0200
commit2432ade6c9bd7284a5bf0d760796638eef634be9 (patch)
tree877cfd29c6e5117a974377ead73cbbc150f6544d /module/plugins/hoster
parentPrepare hook plugins to merging from stable (diff)
parent[LolabitsEs] Cleanup (diff)
downloadpyload-2432ade6c9bd7284a5bf0d760796638eef634be9.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: module/plugins/hooks/MultihostersComHook.py module/plugins/hooks/PutdriveComHook.py module/plugins/internal/CaptchaService.py pyload/plugin/account/OboomCom.py pyload/plugin/account/SmoozedCom.py pyload/plugin/addon/AntiVirus.py pyload/plugin/addon/ExternalScripts.py pyload/plugin/addon/ExtractArchive.py pyload/plugin/addon/RestartSlow.py pyload/plugin/crypter/CrockoCom.py pyload/plugin/crypter/DepositfilesCom.py pyload/plugin/crypter/FshareVn.py pyload/plugin/crypter/LinkdecrypterCom.py pyload/plugin/crypter/MegaRapidCz.py pyload/plugin/crypter/PastebinCom.py pyload/plugin/hoster/CatShareNet.py pyload/plugin/hoster/EdiskCz.py pyload/plugin/hoster/ExtabitCom.py pyload/plugin/hoster/GigapetaCom.py pyload/plugin/hoster/GooIm.py pyload/plugin/hoster/IfolderRu.py pyload/plugin/hoster/LuckyShareNet.py pyload/plugin/hoster/MegasharesCom.py pyload/plugin/hoster/MovReelCom.py pyload/plugin/hoster/NarodRu.py pyload/plugin/hoster/NowDownloadSx.py pyload/plugin/hoster/NowVideoSx.py pyload/plugin/hoster/QuickshareCz.py pyload/plugin/hoster/RemixshareCom.py pyload/plugin/hoster/RgHostNet.py pyload/plugin/hoster/SendspaceCom.py pyload/plugin/hoster/UlozTo.py pyload/plugin/hoster/UnibytesCom.py pyload/plugin/hoster/UploadingCom.py pyload/plugin/hoster/WrzucTo.py pyload/plugin/internal/MultiHook.py pyload/plugin/internal/SimpleHoster.py
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/LolabitsEs.py48
-rw-r--r--module/plugins/hoster/SolidfilesCom.py33
-rw-r--r--module/plugins/hoster/YadiSk.py84
3 files changed, 165 insertions, 0 deletions
diff --git a/module/plugins/hoster/LolabitsEs.py b/module/plugins/hoster/LolabitsEs.py
new file mode 100644
index 000000000..61df5f0bb
--- /dev/null
+++ b/module/plugins/hoster/LolabitsEs.py
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*
+
+import HTMLParser
+import re
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+
+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))
+
+
+getInfo = create_getInfo(LolabitsEs)
diff --git a/module/plugins/hoster/SolidfilesCom.py b/module/plugins/hoster/SolidfilesCom.py
new file mode 100644
index 000000000..d359577d6
--- /dev/null
+++ b/module/plugins/hoster/SolidfilesCom.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+#
+# Test links:
+# http://www.solidfiles.com/d/609cdb4b1b
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+
+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
+
+
+getInfo = create_getInfo(SolidfilesCom)
diff --git a/module/plugins/hoster/YadiSk.py b/module/plugins/hoster/YadiSk.py
new file mode 100644
index 000000000..c3749d30d
--- /dev/null
+++ b/module/plugins/hoster/YadiSk.py
@@ -0,0 +1,84 @@
+# -*- coding: utf-8 -*-
+
+import re
+import random
+
+from module.common.json_layer import json_loads
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+
+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
+
+
+getInfo = create_getInfo(YadiSk)