diff options
Diffstat (limited to 'pyload/plugins/hoster')
-rw-r--r-- | pyload/plugins/hoster/CloudzerNet.py | 17 | ||||
-rw-r--r-- | pyload/plugins/hoster/DdlstorageCom.py | 17 | ||||
-rw-r--r-- | pyload/plugins/hoster/EasybytezCom.py | 12 | ||||
-rw-r--r-- | pyload/plugins/hoster/FilerNet.py | 30 | ||||
-rw-r--r-- | pyload/plugins/hoster/FilezyNet.py | 33 | ||||
-rw-r--r-- | pyload/plugins/hoster/HundredEightyUploadCom.py | 36 | ||||
-rw-r--r-- | pyload/plugins/hoster/LoadTo.py | 64 | ||||
-rw-r--r-- | pyload/plugins/hoster/MegacrypterCom.py | 59 | ||||
-rw-r--r-- | pyload/plugins/hoster/Premium4Me.py | 18 | ||||
-rw-r--r-- | pyload/plugins/hoster/RapidgatorNet.py | 42 | ||||
-rw-r--r-- | pyload/plugins/hoster/StreamcloudEu.py | 111 | ||||
-rw-r--r-- | pyload/plugins/hoster/TurbobitNet.py | 4 | ||||
-rw-r--r-- | pyload/plugins/hoster/UploadheroCom.py | 3 | ||||
-rw-r--r-- | pyload/plugins/hoster/VeehdCom.py | 6 | ||||
-rw-r--r-- | pyload/plugins/hoster/XFileSharingPro.py | 19 | ||||
-rw-r--r-- | pyload/plugins/hoster/XHamsterCom.py | 4 | ||||
-rw-r--r-- | pyload/plugins/hoster/Xdcc.py | 8 | ||||
-rw-r--r-- | pyload/plugins/hoster/XvidstageCom.py | 114 | ||||
-rw-r--r-- | pyload/plugins/hoster/YoutubeCom.py | 10 | ||||
-rw-r--r-- | pyload/plugins/hoster/ZippyshareCom.py | 13 |
20 files changed, 380 insertions, 240 deletions
diff --git a/pyload/plugins/hoster/CloudzerNet.py b/pyload/plugins/hoster/CloudzerNet.py index 7608b193d..2701752ce 100644 --- a/pyload/plugins/hoster/CloudzerNet.py +++ b/pyload/plugins/hoster/CloudzerNet.py @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- import re -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo +from module.plugins.internal.SimpleHoster import SimpleHoster from module.common.json_layer import json_loads from module.plugins.ReCaptcha import ReCaptcha from module.network.RequestFactory import getURL +from module.utils import parseFileSize def getInfo(urls): @@ -12,7 +13,13 @@ def getInfo(urls): if 'Location: http://cloudzer.net/404' in header: file_info = (url, 0, 1, url) else: - file_info = parseFileInfo(CloudzerNet, url, getURL(url, decode=True)) + if url.endswith('/'): + api_data = getURL(url + 'status') + else: + api_data = getURL(url + '/status') + name, size = api_data.splitlines() + size = parseFileSize(size) + file_info = (name, size, 2, url) yield file_info @@ -20,10 +27,10 @@ class CloudzerNet(SimpleHoster): __name__ = "CloudzerNet" __type__ = "hoster" __pattern__ = r"http://(www\.)?(cloudzer\.net/file/|clz\.to/(file/)?)(?P<ID>\w+).*" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Cloudzer.net hoster plugin""" - __author_name__ = ("gs", "z00nx") - __author_mail__ = ("I-_-I-_-I@web.de", "z00nx0@gmail.com") + __author_name__ = ("gs", "z00nx", "stickell") + __author_mail__ = ("I-_-I-_-I@web.de", "z00nx0@gmail.com", "l.stickell@yahoo.it") FILE_SIZE_PATTERN = '<span class="size">(?P<S>[^<]+)</span>' WAIT_PATTERN = '<meta name="wait" content="(\d+)">' diff --git a/pyload/plugins/hoster/DdlstorageCom.py b/pyload/plugins/hoster/DdlstorageCom.py index 1ad5fa6d8..5eaebf1d1 100644 --- a/pyload/plugins/hoster/DdlstorageCom.py +++ b/pyload/plugins/hoster/DdlstorageCom.py @@ -1,20 +1,19 @@ # -*- coding: utf-8 -*- + from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + class DdlstorageCom(XFileSharingPro): __name__ = "DdlstorageCom" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)*?ddlstorage.com/\w{12}" - __version__ = "0.06" + __version__ = "0.07" __description__ = """DDLStorage.com hoster plugin""" - __author_name__ = ("zoidberg") - __author_mail__ = ("zoidberg@mujmail.cz") - - FILE_INFO_PATTERN = r'<h2>\s*Download File\s*<span[^>]*>(?P<N>[^>]+)</span></h2>\s*[^\(]*\((?P<S>[^\)]+)\)</h2>' + __author_name__ = ("zoidberg", "stickell") + __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") + + FILE_INFO_PATTERN = r'<p class="sub_title"[^>]*>(?P<N>.+) \((?P<S>[^)]+)\)</p>' HOSTER_NAME = "ddlstorage.com" - - def setup(self): - self.resumeDownload = self.multiDL = self.premium - self.chunkLimit = 1 + getInfo = create_getInfo(DdlstorageCom)
\ No newline at end of file diff --git a/pyload/plugins/hoster/EasybytezCom.py b/pyload/plugins/hoster/EasybytezCom.py index 96e3d93d2..98691a641 100644 --- a/pyload/plugins/hoster/EasybytezCom.py +++ b/pyload/plugins/hoster/EasybytezCom.py @@ -23,17 +23,15 @@ class EasybytezCom(XFileSharingPro): __name__ = "EasybytezCom" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)?easybytez.com/(\w+).*" - __version__ = "0.14" + __version__ = "0.17" __description__ = """easybytez.com""" - __author_name__ = ("zoidberg") - __author_mail__ = ("zoidberg@mujmail.cz") + __author_name__ = ("zoidberg", "stickell") + __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") - FILE_NAME_PATTERN = r'<input type="hidden" name="fname" value="(?P<N>[^"]+)"' - FILE_SIZE_PATTERN = r'You have requested <font color="red">[^<]+</font> \((?P<S>[^<]+)\)</font>' - FILE_INFO_PATTERN = r'<tr><td align=right><b>Filename:</b></td><td nowrap>(?P<N>[^<]+)</td></tr>\s*.*?<small>\((?P<S>[^<]+)\)</small>' + FILE_INFO_PATTERN = r'<span class="name">(?P<N>.+)</span><br>\s*<span class="size">(?P<S>[^<]+)</span>' FILE_OFFLINE_PATTERN = r'<h1>File not available</h1>' - DIRECT_LINK_PATTERN = r'(http://(\w+\.(easybytez|zingload)\.com|\d+\.\d+\.\d+\.\d+)/files/\d+/\w+/[^"<]+)' + DIRECT_LINK_PATTERN = r'(http://(\w+\.(easyload|easybytez|zingload)\.(com|to)|\d+\.\d+\.\d+\.\d+)/files/\d+/\w+/[^"<]+)' OVR_DOWNLOAD_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)' OVR_KILL_LINK_PATTERN = r'<h2>Delete Link</h2>\s*<textarea[^>]*>([^<]+)' ERROR_PATTERN = r'(?:class=["\']err["\'][^>]*>|<Center><b>)(.*?)</' diff --git a/pyload/plugins/hoster/FilerNet.py b/pyload/plugins/hoster/FilerNet.py index 9693723f9..815685ef8 100644 --- a/pyload/plugins/hoster/FilerNet.py +++ b/pyload/plugins/hoster/FilerNet.py @@ -30,7 +30,7 @@ class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" __pattern__ = r"https?://(www\.)?filer\.net/get/(\w+)" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Filer.net Download Hoster""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") @@ -38,10 +38,17 @@ class FilerNet(SimpleHoster): FILE_INFO_PATTERN = r'<h1 class="page-header">Free Download (?P<N>\S+) <small>(?P<S>[\w.]+) (?P<U>\w+)</small></h1>' FILE_OFFLINE_PATTERN = r'Nicht gefunden' RECAPTCHA_KEY = '6LcFctISAAAAAAgaeHgyqhNecGJJRnxV1m_vAz3V' + DIRECT_LINK_PATTERN = r'href="([^"]+)">Get download</a>' def process(self, pyfile): + if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()): + self.handlePremium() + else: + self.handleFree() + + def handleFree(self): self.req.setOption("timeout", 120) - self.html = self.load(pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES) + self.html = self.load(self.pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES) # Wait between downloads m = re.search(r'musst du <span id="time">(\d+)</span> Sekunden warten', self.html) @@ -50,12 +57,7 @@ class FilerNet(SimpleHoster): self.retry(3, waittime, 'Wait between free downloads') self.getFileInfo() - if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()): - self.handlePremium() - else: - self.handleFree() - def handleFree(self): self.html = self.load(self.pyfile.url, decode=True) inputs = self.parseHtmlForm(input_names='token')[1] @@ -99,5 +101,19 @@ class FilerNet(SimpleHoster): self.download(downloadURL, disposition=True) + def handlePremium(self): + header = self.load(self.pyfile.url, just_header=True) + if 'location' in header: # Direct Download ON + dl = self.pyfile.url + else: # Direct Download OFF + html = self.load(self.pyfile.url) + m = re.search(self.DIRECT_LINK_PATTERN, html) + if not m: + self.parseError("Unable to detect direct link, try to enable 'Direct download' in your user settings") + dl = 'http://filer.net' + m.group(1) + + self.logDebug('Direct link: ' + dl) + self.download(dl, disposition=True) + getInfo = create_getInfo(FilerNet) diff --git a/pyload/plugins/hoster/FilezyNet.py b/pyload/plugins/hoster/FilezyNet.py new file mode 100644 index 000000000..7c5729c2d --- /dev/null +++ b/pyload/plugins/hoster/FilezyNet.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +import re +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + +class FilezyNet(XFileSharingPro): + __name__ = "FilezyNet" + __type__ = "hoster" + __version__ = "0.1" + __pattern__ = r"http://filezy.net/.*/.*.html" + __description__ = """filezy.net hoster plugin""" + + HOSTER_NAME = "filezy.net" + + FILE_SIZE_PATTERN = r'<span class="plansize">(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</span>' + WAIT_PATTERN = r'<div id="countdown_str" class="seconds">\n<!--Wait--> <span id=".*?">(\d+)</span>' + DOWNLOAD_JS_PATTERN = r"<script type='text/javascript'>eval(.*)" + + def setup(self): + self.resumeDownload = True + self.multiDL = self.premium + + def getDownloadLink(self): + self.logDebug("Getting download link") + + data = self.getPostParameters() + self.html = self.load(self.pyfile.url, post = data, ref = True, decode = True) + + obfuscated_js = re.search(self.DOWNLOAD_JS_PATTERN, self.html) + dl_file_now = self.js.eval(obfuscated_js.group(1)) + link = re.search(self.DIRECT_LINK_PATTERN, dl_file_now) + return link.group(1) + +getInfo = create_getInfo(FilezyNet) diff --git a/pyload/plugins/hoster/HundredEightyUploadCom.py b/pyload/plugins/hoster/HundredEightyUploadCom.py new file mode 100644 index 000000000..d8b744359 --- /dev/null +++ b/pyload/plugins/hoster/HundredEightyUploadCom.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see <http://www.gnu.org/licenses/>. # +############################################################################ + +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + + +class HundredEightyUploadCom(XFileSharingPro): + __name__ = "HundredEightyUploadCom" + __type__ = "hoster" + __pattern__ = r"http://(?:\w*\.)?180upload\.com/(\w+).*" + __version__ = "0.01" + __description__ = """180upload.com hoster plugin""" + __author_name__ = ("stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + FILE_NAME_PATTERN = r'Filename:</b></td><td nowrap>(?P<N>.+)</td></tr>-->' + FILE_SIZE_PATTERN = r'Size:</b></td><td>(?P<S>[\d.]+) (?P<U>[A-Z]+)\s*<small>' + + HOSTER_NAME = "180upload.com" + + +getInfo = create_getInfo(HundredEightyUploadCom) diff --git a/pyload/plugins/hoster/LoadTo.py b/pyload/plugins/hoster/LoadTo.py index babf354a9..0f99c272a 100644 --- a/pyload/plugins/hoster/LoadTo.py +++ b/pyload/plugins/hoster/LoadTo.py @@ -16,41 +16,25 @@ @author: halfman """ +# Test links (random.bin): +# http://www.load.to/dNsmgXRk4/random.bin +# http://www.load.to/edbNTxcUb/random100.bin + import re -from module.plugins.Hoster import Hoster -from module.network.RequestFactory import getURL - -def getInfo(urls): - result = [] - - for url in urls: - - html = getURL(url, decode=True) - if re.search(LoadTo.FILE_OFFLINE_PATTERN, html): - # File offline - result.append((url, 0, 1, url)) - else: - # Get file info - name = re.search(LoadTo.FILE_NAME_PATTERN, html) - size = re.search(LoadTo.SIZE_PATTERN, html) - if name is not None and size is not None: - name = name.group(1) - size = size.group(1) - result.append((name, size, 2, url)) - yield result - -class LoadTo(Hoster): +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class LoadTo(SimpleHoster): __name__ = "LoadTo" __type__ = "hoster" - __pattern__ = r"http://(www.*?\.)?load\.to/.{7,10}?/.*" - __version__ = "0.11" - __description__ = """load.to""" - __author_name__ = ("halfman") - __author_mail__ = ("Pulpan3@gmail.com") + __pattern__ = r"http://(?:www\.)?load\.to/\w+" + __version__ = "0.12" + __description__ = """Load.to hoster plugin""" + __author_name__ = ("halfman", "stickell") + __author_mail__ = ("Pulpan3@gmail.com", "l.stickell@yahoo.it") - FILE_NAME_PATTERN = r'<div class="toolarge"><h1>(.+?)</h1></div>' + FILE_INFO_PATTERN = r'<a [^>]+>(?P<N>.+)</a></h3>\s*Size: (?P<S>\d+) Bytes' URL_PATTERN = r'<form method="post" action="(.+?)"' - SIZE_PATTERN = r'<div class="download_table_right">(\d+) Bytes</div>' FILE_OFFLINE_PATTERN = r'Can\'t find file. Please check URL.<br />' WAIT_PATTERN = r'type="submit" value="Download \((\d+)\)"' @@ -61,23 +45,17 @@ class LoadTo(Hoster): self.html = self.load(pyfile.url, decode=True) - if re.search(self.FILE_OFFLINE_PATTERN, self.html): - self.offline() - - found = re.search(self.FILE_NAME_PATTERN, self.html) - if found is None: - self.fail("Parse error (NAME)") - pyfile.name = found.group(1) - found = re.search(self.URL_PATTERN, self.html) - if found is None: - self.fail("Parse error (URL)") + if not found: + self.parseError('URL') download_url = found.group(1) - + timmy = re.search(self.WAIT_PATTERN, self.html) if timmy: self.setWait(timmy.group(1)) self.wait() - self.req.setOption("timeout", 120) - self.download(download_url)
\ No newline at end of file + self.download(download_url, disposition=True) + + +getInfo = create_getInfo(LoadTo) diff --git a/pyload/plugins/hoster/MegacrypterCom.py b/pyload/plugins/hoster/MegacrypterCom.py new file mode 100644 index 000000000..9f012e5be --- /dev/null +++ b/pyload/plugins/hoster/MegacrypterCom.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +import re + +from module.common.json_layer import json +from module.plugins.hoster.MegaNz import MegaNz + + +class MegacrypterCom(MegaNz): + __name__ = "MegacrypterCom" + __type__ = "hoster" + __pattern__ = r"(https?://[a-z0-9]{0,10}\.?megacrypter\.com/[a-zA-Z0-9!_\-]+)" + __version__ = "0.1" + __description__ = """megacrypter plugin, based and inherits from RaNaN's MegaNz plugin""" + __author_name__ = ("GonzaloSR", ) + __author_mail__ = ("gonzalo@gonzalosr.com", ) + + API_URL = "http://megacrypter.com/api" + FILE_SUFFIX = ".crypted" + + + def callApi(self, **kwargs): + """ Dispatch a call to the api, see megacrypter.com/api_doc """ + self.logDebug("JSON request: " + json.dumps(kwargs)) + resp = self.load(self.API_URL, post=json.dumps(kwargs)) + self.logDebug("API Response: " + resp) + return json.loads(resp) + + + def process(self, pyfile): + + key = None + + # match is guaranteed because plugin was chosen to handle url + node = re.search(self.__pattern__, pyfile.url).group(1) + + + # get Mega.co.nz link info + info = self.callApi(link=node, m="info") + + # get crypted file URL + dl = self.callApi(link=node, m="dl") + + + # TODO: map error codes, implement password protection + # if info["pass"] == true: + # crypted_file_key, md5_file_key = info["key"].split("#") + + + key = self.b64_decode(info["key"]) + + pyfile.name = info["name"] + self.FILE_SUFFIX + + self.download(dl["url"]) + self.decryptFile(key) + + # Everything is finished and final name can be set + pyfile.name = info["name"] + + diff --git a/pyload/plugins/hoster/Premium4Me.py b/pyload/plugins/hoster/Premium4Me.py index c93084d5d..502e9ff12 100644 --- a/pyload/plugins/hoster/Premium4Me.py +++ b/pyload/plugins/hoster/Premium4Me.py @@ -11,11 +11,11 @@ from module.utils import fs_encode class Premium4Me(Hoster): __name__ = "Premium4Me" - __version__ = "0.05" + __version__ = "0.07" __type__ = "hoster" - __pattern__ = r"http://premium4.me/.*" - __description__ = """premium4.me hoster plugin""" + __pattern__ = r"http://premium.to/.*" + __description__ = """Premium.to hoster plugin""" __author_name__ = ("RaNaN", "zoidberg", "stickell") __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") @@ -25,10 +25,10 @@ class Premium4Me(Hoster): def process(self, pyfile): if not self.account: - self.logError(_("Please enter your premium4.me account or deactivate this plugin")) - self.fail("No premium4.me account provided") + self.logError(_("Please enter your premium.to account or deactivate this plugin")) + self.fail("No premium.to account provided") - self.logDebug("premium4.me: Old URL: %s" % pyfile.url) + self.logDebug("premium.to: Old URL: %s" % pyfile.url) tra = self.getTraffic() @@ -36,13 +36,13 @@ class Premium4Me(Hoster): self.req.setOption("timeout", 120) self.download( - "http://premium4.me/api/getfile.php?authcode=%s&link=%s" % (self.account.authcode, quote(pyfile.url, "")), + "http://premium.to/api/getfile.php?authcode=%s&link=%s" % (self.account.authcode, quote(pyfile.url, "")), disposition=True) check = self.checkDownload({"nopremium": "No premium account available"}) if check == "nopremium": - self.retry(3, 60, 'No premium account available') + self.retry(60, 300, 'No premium account available') err = '' if self.req.http.code == '420': @@ -64,7 +64,7 @@ class Premium4Me(Hoster): def getTraffic(self): try: - traffic = int(self.load("http://premium4.me/api/traffic.php?authcode=%s" % self.account.authcode)) + traffic = int(self.load("http://premium.to/api/traffic.php?authcode=%s" % self.account.authcode)) except: traffic = 0 return traffic diff --git a/pyload/plugins/hoster/RapidgatorNet.py b/pyload/plugins/hoster/RapidgatorNet.py index d2ca77e0f..3c4611446 100644 --- a/pyload/plugins/hoster/RapidgatorNet.py +++ b/pyload/plugins/hoster/RapidgatorNet.py @@ -18,18 +18,18 @@ import re from pycurl import HTTPHEADER -from random import random from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.plugins.internal.CaptchaService import ReCaptcha, SolveMedia, AdsCaptcha from module.common.json_layer import json_loads from module.network.HTTPRequest import BadHeader + class RapidgatorNet(SimpleHoster): __name__ = "RapidgatorNet" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?(rapidgator.net)/file/(\w+)" - __version__ = "0.17" + __version__ = "0.18" __description__ = """rapidgator.net""" __author_name__ = ("zoidberg", "chrox", "stickell") @@ -39,32 +39,32 @@ class RapidgatorNet(SimpleHoster): FILE_OFFLINE_PATTERN = r'<title>File not found</title>' JSVARS_PATTERN = r"\s+var\s*(startTimerUrl|getDownloadUrl|captchaUrl|fid|secs)\s*=\s*'?(.*?)'?;" - DOWNLOAD_LINK_PATTERN = r"return '(http[^']+)';\s*}\s*}\s*}\);" + DOWNLOAD_LINK_PATTERN = r"return '(http[^']+)';\s*}\s*}\s*}?\);" RECAPTCHA_KEY_PATTERN = r'"http://api.recaptcha.net/challenge?k=(.*?)"' ADSCAPTCHA_SRC_PATTERN = r'(http://api.adscaptcha.com/Get.aspx[^"\']*)' SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' - + def setup(self): self.resumeDownload = False self.multiDL = False self.sid = None self.chunkLimit = 1 self.req.setOption("timeout", 120) - + def process(self, pyfile): - if self.account: - self.sid = self.account.getAccountData(self.user).get('SID', None) - + if self.account: + self.sid = self.account.getAccountData(self.user).get('SID', None) + if self.sid: self.handlePremium() else: - self.handleFree() + self.handleFree() def getAPIResponse(self, cmd): try: json = self.load('%s/%s' % (self.API_URL, cmd), - get = {'sid': self.sid, - 'url': self.pyfile.url}, decode = True) + get={'sid': self.sid, + 'url': self.pyfile.url}, decode=True) self.logDebug('API:%s' % cmd, json, "SID: %s" % self.sid) json = json_loads(json) status = json['response_status'] @@ -94,11 +94,11 @@ class RapidgatorNet(SimpleHoster): self.download(url) def handleFree(self): - self.html = self.load(self.pyfile.url, decode = True) + self.html = self.load(self.pyfile.url, decode=True) self.getFileInfo() - + if "You can download files up to 500 MB in free mode" in self.html \ - or "This file can be downloaded by premium only" in self.html: + or "This file can be downloaded by premium only" in self.html: self.fail("Premium account needed for download") self.checkWait() @@ -109,13 +109,15 @@ class RapidgatorNet(SimpleHoster): self.req.http.lastURL = self.pyfile.url self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) - url = "http://rapidgator.net%s?fid=%s" % (jsvars.get('startTimerUrl', '/download/AjaxStartTimer'), jsvars["fid"]) + url = "http://rapidgator.net%s?fid=%s" % ( + jsvars.get('startTimerUrl', '/download/AjaxStartTimer'), jsvars["fid"]) jsvars.update(self.getJsonResponse(url)) self.setWait(int(jsvars.get('secs', 30)) + 1, False) self.wait() - url = "http://rapidgator.net%s?sid=%s" % (jsvars.get('getDownloadUrl', '/download/AjaxGetDownload'), jsvars["sid"]) + url = "http://rapidgator.net%s?sid=%s" % ( + jsvars.get('getDownloadUrl', '/download/AjaxGetDownload'), jsvars["sid"]) jsvars.update(self.getJsonResponse(url)) self.req.http.lastURL = self.pyfile.url @@ -167,7 +169,8 @@ class RapidgatorNet(SimpleHoster): self.download(download_url) def checkWait(self): - found = re.search(r"(?:Delay between downloads must be not less than|Try again in)\s*(\d+)\s*(hour|min)", self.html) + found = re.search(r"(?:Delay between downloads must be not less than|Try again in)\s*(\d+)\s*(hour|min)", + self.html) if found: wait_time = int(found.group(1)) * {"hour": 60, "min": 1}[found.group(2)] else: @@ -180,13 +183,14 @@ class RapidgatorNet(SimpleHoster): self.logDebug("Waiting %d minutes" % wait_time) self.setWait(wait_time * 60, True) self.wait() - self.retry(max_tries = 24) + self.retry(max_tries=24) def getJsonResponse(self, url): - response = self.load(url, decode = True) + response = self.load(url, decode=True) if not response.startswith('{'): self.retry() self.logDebug(url, response) return json_loads(response) + getInfo = create_getInfo(RapidgatorNet) diff --git a/pyload/plugins/hoster/StreamcloudEu.py b/pyload/plugins/hoster/StreamcloudEu.py new file mode 100644 index 000000000..73c0465f8 --- /dev/null +++ b/pyload/plugins/hoster/StreamcloudEu.py @@ -0,0 +1,111 @@ +# -*- coding: utf-8 -*- +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo +from module.network.HTTPRequest import HTTPRequest +from time import sleep +import re + +class StreamcloudEu(XFileSharingPro): + __name__ = "StreamcloudEu" + __type__ = "hoster" + __pattern__ = r"http://(www\.)?streamcloud\.eu/\S+" + __version__ = "0.02" + __description__ = """Streamcloud.eu hoster plugin""" + __author_name__ = ("seoester") + __author_mail__ = ("seoester@googlemail.com") + + HOSTER_NAME = "streamcloud.eu" + DIRECT_LINK_PATTERN = r'file: "(http://(stor|cdn)\d+\.streamcloud.eu:?\d*/.*/video\.mp4)",' + + def setup(self): + super(StreamcloudEu, self).setup() + self.multiDL = True + + def getDownloadLink(self): + found = re.search(self.DIRECT_LINK_PATTERN, self.html, re.S) + if found: + return found.group(1) + + for i in range(5): + self.logDebug("Getting download link: #%d" % i) + data = self.getPostParameters() + httpRequest = HTTPRequest(options=self.req.options) + httpRequest.cj = self.req.cj + sleep(10) + self.html = httpRequest.load(self.pyfile.url, post = data, referer=False, cookies=True, decode = True) + self.header = httpRequest.header + + found = re.search("Location\s*:\s*(.*)", self.header, re.I) + if found: + break + + found = re.search(self.DIRECT_LINK_PATTERN, self.html, re.S) + if found: + break + + else: + if self.errmsg and 'captcha' in self.errmsg: + self.fail("No valid captcha code entered") + else: + self.fail("Download link not found") + + return found.group(1) + + def getPostParameters(self): + for i in range(3): + if not self.errmsg: self.checkErrors() + + if hasattr(self,"FORM_PATTERN"): + action, inputs = self.parseHtmlForm(self.FORM_PATTERN) + else: + action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")}) + + if not inputs: + action, inputs = self.parseHtmlForm('F1') + if not inputs: + if self.errmsg: + self.retry() + else: + self.parseError("Form not found") + + self.logDebug(self.HOSTER_NAME, inputs) + + if 'op' in inputs and inputs['op'] in ('download1', 'download2', 'download3'): + if "password" in inputs: + if self.passwords: + inputs['password'] = self.passwords.pop(0) + else: + self.fail("No or invalid passport") + + if not self.premium: + found = re.search(self.WAIT_PATTERN, self.html) + if found: + wait_time = int(found.group(1)) + 1 + self.setWait(wait_time, False) + else: + wait_time = 0 + + self.captcha = self.handleCaptcha(inputs) + + if wait_time: self.wait() + + self.errmsg = None + self.logDebug("getPostParameters {0}".format(i)) + return inputs + + else: + inputs['referer'] = self.pyfile.url + + if self.premium: + inputs['method_premium'] = "Premium Download" + if 'method_free' in inputs: del inputs['method_free'] + else: + inputs['method_free'] = "Free Download" + if 'method_premium' in inputs: del inputs['method_premium'] + + self.html = self.load(self.pyfile.url, post = inputs, ref = False) + self.errmsg = None + + else: self.parseError('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) + + +getInfo = create_getInfo(StreamcloudEu) diff --git a/pyload/plugins/hoster/TurbobitNet.py b/pyload/plugins/hoster/TurbobitNet.py index b429d5510..09ce46a31 100644 --- a/pyload/plugins/hoster/TurbobitNet.py +++ b/pyload/plugins/hoster/TurbobitNet.py @@ -36,14 +36,14 @@ class TurbobitNet(SimpleHoster): __name__ = "TurbobitNet" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)?(turbobit.net|unextfiles.com)/(?:download/free/)?(?P<ID>\w+).*" - __version__ = "0.08" + __version__ = "0.09" __description__ = """Turbobit.net plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") FILE_INFO_PATTERN = r"<span class='file-icon1[^>]*>(?P<N>[^<]+)</span>\s*\((?P<S>[^\)]+)\)\s*</h1>" #long filenames are shortened FILE_NAME_PATTERN = r'<meta name="keywords" content="\s+(?P<N>[^,]+)' #full name but missing on page2 - FILE_OFFLINE_PATTERN = r'<h2>File Not Found</h2>|html\(\'File was not found' + FILE_OFFLINE_PATTERN = r'<h2>File Not Found</h2>|html\(\'File (?:was )?not found' FILE_URL_REPLACEMENTS = [(r"http://(?:\w*\.)?(turbobit.net|unextfiles.com)/(?:download/free/)?(?P<ID>\w+).*", "http://turbobit.net/\g<ID>.html")] SH_COOKIES = [("turbobit.net", "user_lang", "en")] diff --git a/pyload/plugins/hoster/UploadheroCom.py b/pyload/plugins/hoster/UploadheroCom.py index 502f849af..a2348b9f9 100644 --- a/pyload/plugins/hoster/UploadheroCom.py +++ b/pyload/plugins/hoster/UploadheroCom.py @@ -16,6 +16,9 @@ @author: zoidberg """ +# Test link (random.bin): +# http://uploadhero.co/dl/wQBRAVSM + import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo diff --git a/pyload/plugins/hoster/VeehdCom.py b/pyload/plugins/hoster/VeehdCom.py index 23048b831..d4422afc3 100644 --- a/pyload/plugins/hoster/VeehdCom.py +++ b/pyload/plugins/hoster/VeehdCom.py @@ -11,7 +11,7 @@ class VeehdCom(Hoster): ('filename_spaces', 'bool', "Allow spaces in filename", 'False'), ('replacement_char', 'str', "Filename replacement character", '_'), ] - __version__ = '0.2' + __version__ = '0.21' __description__ = """Veehd.com Download Hoster""" __author_name__ = ('cat') __author_mail__ = ('cat@pyload') @@ -55,12 +55,12 @@ class VeehdCom(Hoster): name = match.group(1) # replace unwanted characters in filename - if self.getConf('filename_spaces'): + if self.getConfig('filename_spaces'): pattern = '[^0-9A-Za-z\.\ ]+' else: pattern = '[^0-9A-Za-z\.]+' - name = re.sub(pattern, self.getConf('replacement_char'), + name = re.sub(pattern, self.getConfig('replacement_char'), name) return name + '.avi' diff --git a/pyload/plugins/hoster/XFileSharingPro.py b/pyload/plugins/hoster/XFileSharingPro.py index 1120a2a8b..2103b0c20 100644 --- a/pyload/plugins/hoster/XFileSharingPro.py +++ b/pyload/plugins/hoster/XFileSharingPro.py @@ -23,7 +23,7 @@ from urlparse import urlparse from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError from module.plugins.ReCaptcha import ReCaptcha -from module.plugins.internal.CaptchaService import SolveMedia, AdsCaptcha +from module.plugins.internal.CaptchaService import SolveMedia from module.utils import html_unescape class XFileSharingPro(SimpleHoster): @@ -35,10 +35,10 @@ class XFileSharingPro(SimpleHoster): __name__ = "XFileSharingPro" __type__ = "hoster" __pattern__ = r"^unmatchable$" - __version__ = "0.17" + __version__ = "0.18" __description__ = """XFileSharingPro common hoster base""" - __author_name__ = ("zoidberg") - __author_mail__ = ("zoidberg@mujmail.cz") + __author_name__ = ("zoidberg", "stickell") + __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") FILE_NAME_PATTERN = r'<input type="hidden" name="fname" value="(?P<N>[^"]+)"' FILE_SIZE_PATTERN = r'You have requested <font color="red">[^<]+</font> \((?P<S>[^<]+)\)</font>' @@ -151,7 +151,8 @@ class XFileSharingPro(SimpleHoster): def handlePremium(self): self.html = self.load(self.pyfile.url, post = self.getPostParameters()) found = re.search(self.DIRECT_LINK_PATTERN, self.html) - if not found: self.parseError('DIRECT LINK') + if not found: + self.parseError('DIRECT LINK') self.startDownload(found.group(1)) def handleOverriden(self): @@ -183,13 +184,17 @@ class XFileSharingPro(SimpleHoster): found = re.search(self.OVR_DOWNLOAD_LINK_PATTERN, self.html) if not found: self.parseError('DIRECT LINK (OVR)') self.pyfile.url = found.group(1) - self.retry() + header = self.load(self.pyfile.url, just_header=True) + if 'location' in header: # Direct link + self.startDownload(self.pyfile.url) + else: + self.retry() def startDownload(self, link): link = link.strip() if self.captcha: self.correctCaptcha() self.logDebug('DIRECT LINK: %s' % link) - self.download(link) + self.download(link, disposition=True) def checkErrors(self): found = re.search(self.ERROR_PATTERN, self.html) diff --git a/pyload/plugins/hoster/XHamsterCom.py b/pyload/plugins/hoster/XHamsterCom.py index 0779a78e6..866c5da45 100644 --- a/pyload/plugins/hoster/XHamsterCom.py +++ b/pyload/plugins/hoster/XHamsterCom.py @@ -17,7 +17,7 @@ class XHamsterCom(Hoster): __name__ = "XHamsterCom" __type__ = "hoster" __pattern__ = r"http://(www\.)?xhamster\.com/movies/.+" - __version__ = "0.1" + __version__ = "0.11" __config__ = [("type", ".mp4;.flv", "Preferred type", ".mp4")] __description__ = """XHamster.com Video Download Hoster""" @@ -31,7 +31,7 @@ class XHamsterCom(Hoster): self.offline() if self.getConfig("type"): - self.desired_fmt = self.getConf("type") + self.desired_fmt = self.getConfig("type") self.pyfile.name = self.get_file_name() + self.desired_fmt self.download(self.get_file_url()) diff --git a/pyload/plugins/hoster/Xdcc.py b/pyload/plugins/hoster/Xdcc.py index 4870b8ab9..723623f52 100644 --- a/pyload/plugins/hoster/Xdcc.py +++ b/pyload/plugins/hoster/Xdcc.py @@ -32,7 +32,7 @@ from module.plugins.Hoster import Hoster class Xdcc(Hoster): __name__ = "Xdcc" - __version__ = "0.3" + __version__ = "0.31" __pattern__ = r'xdcc://.*?(/#?.*?)?/.*?/#?\d+/?' # xdcc://irc.Abjects.net/#channel/[XDCC]|Shit/#0004/ __type__ = "hoster" __config__ = [ @@ -91,9 +91,9 @@ class Xdcc(Hoster): chan = m.group(2) bot = m.group(3) pack = m.group(4) - nick = self.getConf('nick') - ident = self.getConf('ident') - real = self.getConf('realname') + nick = self.getConfig('nick') + ident = self.getConfig('ident') + real = self.getConfig('realname') temp = server.split(':') ln = len(temp) diff --git a/pyload/plugins/hoster/XvidstageCom.py b/pyload/plugins/hoster/XvidstageCom.py deleted file mode 100644 index 4962c05af..000000000 --- a/pyload/plugins/hoster/XvidstageCom.py +++ /dev/null @@ -1,114 +0,0 @@ -# -*- coding: utf-8 -*- - -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. - - @author: 4Christopher -""" - -import re -import HTMLParser - -from module.plugins.Hoster import Hoster -from module.network.RequestFactory import getURL - - -def setup(self): - self.wantReconnect = False - self.resumeDownload = True - self.multiDL = True - - -def getInfo(urls): - result = [] - - for url in urls: - result.append(parseFileInfo(url, getInfoMode=True)) - yield result - - -def parseFileInfo(url, getInfoMode=False): - html = getURL(url) - info = {"name": url, "size": 0, "status": 3} - try: - info['name'] = re.search(r'(?:Filename|Dateiname):</b></td><td nowrap[^>]*?>(.*?)<', html).group(1) - info['size'] = re.search(r'(?:Size|Größe):</b></td><td>.*? <small>\((\d+?) bytes\)', html).group(1) - except: ## The file is offline - info['status'] = 1 - else: - info['status'] = 2 - - if getInfoMode: - return info['name'], info['size'], info['status'], url - else: - return info['name'], info['size'], info['status'], html - - -class XvidstageCom(Hoster): - __name__ = 'XvidstageCom' - __version__ = '0.4' - __pattern__ = r'http://(?:www.)?xvidstage.com/(?P<id>[0-9A-Za-z]+)' - __type__ = 'hoster' - __description__ = """A Plugin that allows you to download files from http://xvidstage.com""" - __author_name__ = ('4Christopher') - __author_mail__ = ('4Christopher@gmx.de') - - - def process(self, pyfile): - pyfile.name, pyfile.size, pyfile.status, self.html = parseFileInfo(pyfile.url) - self.logDebug('Name: %s' % pyfile.name) - if pyfile.status == 1: ## offline - self.offline() - self.id = re.search(self.__pattern__, pyfile.url).group('id') - - wait_sec = int(re.search(r'countdown_str">.+?>(\d+?)<', self.html).group(1)) - self.setWait(wait_sec, reconnect=False) - self.logDebug('Waiting %d seconds before submitting the captcha' % wait_sec) - self.wait() - - rand = re.search(r'<input type="hidden" name="rand" value="(.*?)">', self.html).group(1) - self.logDebug('rand: %s, id: %s' % (rand, self.id)) - self.html = self.req.load(pyfile.url, - post={'op': 'download2', 'id': self.id, 'rand': rand, 'code': self.get_captcha()}) - file_url = re.search(r'<a href="(?P<url>.*?)">(?P=url)</a>', self.html).group('url') - try: - hours_file_available = int( - re.search(r'This direct link will be available for your IP next (?P<hours>\d+?) hours', - self.html).group('hours')) - self.logDebug( - 'You have %d hours to download this file with your current IP address.' % hours_file_available) - except: - self.logDebug('Failed') - self.logDebug('Download file: %s' % file_url) - self.download(file_url) - check = self.checkDownload({'empty': re.compile(r'^$')}) - - if check == 'empty': - self.logInfo('Downloaded File was empty') - # self.retry() - - def get_captcha(self): - ## <span style='position:absolute;padding-left:7px;padding-top:6px;'>1 … - cap_chars = {} - for pad_left, char in re.findall(r"position:absolute;padding-left:(\d+?)px;.*?;'>(.*?)<", self.html): - cap_chars[int(pad_left)] = char - - h = HTMLParser.HTMLParser() - ## Sorting after padding-left - captcha = '' - for pad_left in sorted(cap_chars): - captcha += h.unescape(cap_chars[pad_left]) - - self.logDebug('The captcha is: %s' % captcha) - return captcha diff --git a/pyload/plugins/hoster/YoutubeCom.py b/pyload/plugins/hoster/YoutubeCom.py index 70db597cf..129b948bf 100644 --- a/pyload/plugins/hoster/YoutubeCom.py +++ b/pyload/plugins/hoster/YoutubeCom.py @@ -34,7 +34,7 @@ class YoutubeCom(Hoster): __name__ = "YoutubeCom" __type__ = "hoster" __pattern__ = r"https?://(?:[^/]*?)youtube\.com/watch.*?[?&]v=.*" - __version__ = "0.32" + __version__ = "0.34" __config__ = [("quality", "sd;hd;fullhd;240p;360p;480p;720p;1080p;3072p", "Quality Setting", "hd"), ("fmt", "int", "FMT/ITAG Number (5-102, 0 for auto)", 0), (".mp4", "bool", "Allow .mp4", True), @@ -76,24 +76,24 @@ class YoutubeCom(Hoster): def process(self, pyfile): html = self.load(pyfile.url, decode=True) - if '<h1 id="unavailable-message" class="message">' in html: + if re.search(r'<div id="player-unavailable" class="\s*player-width player-height\s*">', html): self.offline() if "We have been receiving a large volume of requests from your network." in html: self.tempOffline() #get config - use3d = self.getConf("3d") + use3d = self.getConfig("3d") if use3d: quality = {"sd":82,"hd":84,"fullhd":85,"240p":83,"360p":82,"480p":82,"720p":84,"1080p":85,"3072p":85} else: quality = {"sd":18,"hd":22,"fullhd":37,"240p":5,"360p":18,"480p":35,"720p":22,"1080p":37,"3072p":38} - desired_fmt = self.getConf("fmt") + desired_fmt = self.getConfig("fmt") if desired_fmt and desired_fmt not in self.formats: self.logWarning("FMT %d unknown - using default." % desired_fmt) desired_fmt = 0 if not desired_fmt: - desired_fmt = quality.get(self.getConf("quality"), 18) + desired_fmt = quality.get(self.getConfig("quality"), 18) #parse available streams streams = re.search(r'"url_encoded_fmt_stream_map": "(.*?)",', html).group(1) diff --git a/pyload/plugins/hoster/ZippyshareCom.py b/pyload/plugins/hoster/ZippyshareCom.py index 84974e7ba..756a92ef3 100644 --- a/pyload/plugins/hoster/ZippyshareCom.py +++ b/pyload/plugins/hoster/ZippyshareCom.py @@ -10,10 +10,10 @@ class ZippyshareCom(SimpleHoster): __name__ = "ZippyshareCom" __type__ = "hoster" __pattern__ = r"(?P<HOST>http://www\d{0,2}\.zippyshare.com)/v(?:/|iew.jsp.*key=)(?P<KEY>\d+)" - __version__ = "0.37" + __version__ = "0.38" __description__ = """Zippyshare.com Download Hoster""" - __author_name__ = ("spoob", "zoidberg") - __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz") + __author_name__ = ("spoob", "zoidberg", "stickell") + __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") __config__ = [("swfdump_path", "string", "Path to swfdump", "")] FILE_NAME_PATTERN = r'>Name:</font>\s*<font [^>]*>(?P<N>[^<]+)</font><br />' @@ -62,7 +62,12 @@ class ZippyshareCom(SimpleHoster): found = re.search(self.DOWNLOAD_URL_PATTERN, self.html, re.S) if found: #Method #1: JS eval - url = self.js.eval("\n".join(found.groups())) + js = "\n".join(found.groups()) + regex = r"document.getElementById\(\\*'dlbutton\\*'\).omg" + omg = re.search(regex + r" = ([^;]+);", js).group(1) + js = re.sub(regex + r" = ([^;]+);", '', js) + js = re.sub(regex, omg, js) + url = self.js.eval(js) else: #Method #2: SWF eval seed_search = re.search(self.SEED_PATTERN, self.html) |