diff options
Diffstat (limited to 'pyload/plugins/hoster')
68 files changed, 328 insertions, 392 deletions
diff --git a/pyload/plugins/hoster/AlldebridCom.py b/pyload/plugins/hoster/AlldebridCom.py index bdb5b1599..ecf53701b 100644 --- a/pyload/plugins/hoster/AlldebridCom.py +++ b/pyload/plugins/hoster/AlldebridCom.py @@ -50,7 +50,7 @@ class AlldebridCom(Hoster): page = self.load(url) data = json_loads(page) - self.logDebug("Json data: %s" % str(data)) + self.logDebug("Json data", data) if data['error']: if data['error'] == "This link isn't available on the hoster website.": diff --git a/pyload/plugins/hoster/BasePlugin.py b/pyload/plugins/hoster/BasePlugin.py index 55cdf5b88..3fdd0348d 100644 --- a/pyload/plugins/hoster/BasePlugin.py +++ b/pyload/plugins/hoster/BasePlugin.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- -from re import match, search +import re + from urllib import unquote from urlparse import urlparse @@ -25,10 +26,11 @@ class BasePlugin(Hoster): self.chunkLimit = -1 self.resumeDownload = True + def process(self, pyfile): """main function""" - #debug part, for api exerciser + #: debug part, for api exerciser if pyfile.url.startswith("DEBUG_API"): self.multiDL = False return @@ -74,6 +76,7 @@ class BasePlugin(Hoster): else: self.fail("No Plugin matched and not a downloadable url.") + def downloadFile(self, pyfile): url = pyfile.url @@ -86,7 +89,7 @@ class BasePlugin(Hoster): if 'location' in header: self.logDebug("Location: " + header['location']) - base = match(r'https?://[^/]+', url).group(0) + base = re.match(r'https?://[^/]+', url).group(0) if header['location'].startswith("http"): url = header['location'] elif header['location'].startswith("/"): @@ -100,7 +103,7 @@ class BasePlugin(Hoster): if 'content-disposition' in header: self.logDebug("Content-Disposition: " + header['content-disposition']) - m = search("filename(?P<type>=|\*=(?P<enc>.+)'')(?P<name>.*)", header['content-disposition']) + m = re.search("filename(?P<type>=|\*=(?P<enc>.+)'')(?P<name>.*)", header['content-disposition']) if m: disp = m.groupdict() self.logDebug(disp) diff --git a/pyload/plugins/hoster/BillionuploadsCom.py b/pyload/plugins/hoster/BillionuploadsCom.py index 6c14d103d..d6f39b61c 100644 --- a/pyload/plugins/hoster/BillionuploadsCom.py +++ b/pyload/plugins/hoster/BillionuploadsCom.py @@ -8,12 +8,13 @@ class BillionuploadsCom(XFileSharingPro): __type__ = "hoster" __version__ = "0.01" - __pattern__ = r'http://(?:www\.)?billionuploads.com/\w{12}' + __pattern__ = r'http://(?:www\.)?billionuploads\.com/\w{12}' __description__ = """Billionuploads.com hoster plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + HOSTER_NAME = "billionuploads.com" FILE_NAME_PATTERN = r'<b>Filename:</b>(?P<N>.*?)<br>' diff --git a/pyload/plugins/hoster/CatShareNet.py b/pyload/plugins/hoster/CatShareNet.py index 415ec2379..36f2ea441 100644 --- a/pyload/plugins/hoster/CatShareNet.py +++ b/pyload/plugins/hoster/CatShareNet.py @@ -9,36 +9,50 @@ from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class CatShareNet(SimpleHoster): __name__ = "CatShareNet" __type__ = "hoster" - __version__ = "0.01" + __version__ = "0.05" - __pattern__ = r'http://(?:www\.)?catshare.net/\w{16}.*' + __pattern__ = r'http://(?:www\.)?catshare\.net/\w{16}' __description__ = """CatShare.net hoster plugin""" - __author_name__ = "z00nx" - __author_mail__ = "z00nx0@gmail.com" + __author_name__ = ("z00nx", "prOq", "Walter Purcaro") + __author_mail__ = ("z00nx0@gmail.com", None, "vuolter@gmail.com") - FILE_INFO_PATTERN = r'<h3 class="pull-left"[^>]+>(?P<N>.*)</h3>\s+<h3 class="pull-right"[^>]+>(?P<S>.*)</h3>' - OFFLINE_PATTERN = r'Podany plik zosta' - SECONDS_PATTERN = r'var\s+count\s+=\s+(\d+);' + FILE_INFO_PATTERN = r'<title>(?P<N>.+) \((?P<S>[\d.]+) (?P<U>\w+)\)<' + OFFLINE_PATTERN = r'Podany plik został usunięty\s*</div>' + IP_BLOCKED_PATTERN = r'>Nasz serwis wykrył że Twój adres IP nie pochodzi z Polski.<' + SECONDS_PATTERN = 'var count = (\d+);' RECAPTCHA_KEY = "6Lfln9kSAAAAANZ9JtHSOgxUPB9qfDFeLUI_QMEy" + LINK_PATTERN = r'<form action="(.+?)" method="GET">' + + + def getFileInfo(self): + m = re.search(self.IP_BLOCKED_PATTERN, self.html) + if m is None: + self.fail("Only connections from Polish IP address are allowed") + return super(CatShareNet, self).getFileInfo() def handleFree(self): m = re.search(self.SECONDS_PATTERN, self.html) - seconds = int(m.group(1)) - self.logDebug("Seconds found", seconds) - self.wait(seconds + 1) + if m: + wait_time = int(m.group(1)) + self.wait(wait_time, True) + recaptcha = ReCaptcha(self) challenge, code = recaptcha.challenge(self.RECAPTCHA_KEY) - post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": code} - self.download(self.pyfile.url, post=post_data) - check = self.checkDownload({"html": re.compile("\A<!DOCTYPE html PUBLIC")}) - if check == "html": - self.logDebug("Wrong captcha entered") + self.html = self.load(self.pyfile.url, + post={'recaptcha_challenge_field': challenge, + 'recaptcha_response_field': code}) + + m = re.search(self.LINK_PATTERN, self.html) + if m is None: self.invalidCaptcha() - self.retry() + self.retry(reason="Wrong captcha entered") + + dl_link = m.group(1) + self.download(dl_link) getInfo = create_getInfo(CatShareNet) diff --git a/pyload/plugins/hoster/CramitIn.py b/pyload/plugins/hoster/CramitIn.py index 6c5142d96..7091e02c2 100644 --- a/pyload/plugins/hoster/CramitIn.py +++ b/pyload/plugins/hoster/CramitIn.py @@ -8,20 +8,17 @@ class CramitIn(XFileSharingPro): __type__ = "hoster" __version__ = "0.04" - __pattern__ = r'http://(?:www\.)?cramit.in/\w{12}' + __pattern__ = r'http://(?:www\.)?cramit\.in/\w{12}' __description__ = """Cramit.in hoster plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + HOSTER_NAME = "cramit.in" FILE_INFO_PATTERN = r'<span class=t2>\s*(?P<N>.*?)</span>.*?<small>\s*\((?P<S>.*?)\)' LINK_PATTERN = r'href="(http://cramit.in/file_download/.*?)"' - def setup(self): - self.resumeDownload = self.multiDL = self.premium - - getInfo = create_getInfo(CramitIn) diff --git a/pyload/plugins/hoster/CzshareCom.py b/pyload/plugins/hoster/CzshareCom.py index 0e6fab15a..f5df313f7 100644 --- a/pyload/plugins/hoster/CzshareCom.py +++ b/pyload/plugins/hoster/CzshareCom.py @@ -27,7 +27,7 @@ class CzshareCom(SimpleHoster): FILE_SIZE_REPLACEMENTS = [(' ', '')] FILE_URL_REPLACEMENTS = [(r'http://[^/]*/download.php\?.*?id=(\w+).*', r'http://sdilej.cz/\1/x/')] - SH_CHECK_TRAFFIC = True + FORCE_CHECK_TRAFFIC = True FREE_URL_PATTERN = r'<a href="([^"]+)" class="page-download">[^>]*alt="([^"]+)" /></a>' FREE_FORM_PATTERN = r'<form action="download.php" method="post">\s*<img src="captcha.php" id="captcha" />(.*?)</form>' @@ -57,7 +57,7 @@ class CzshareCom(SimpleHoster): return False except Exception, e: # let's continue and see what happens... - self.logError('Parse error (CREDIT): %s' % e) + self.logError("Parse error (CREDIT): %s" % e) return True diff --git a/pyload/plugins/hoster/DataHu.py b/pyload/plugins/hoster/DataHu.py index 68162c203..222278b49 100644 --- a/pyload/plugins/hoster/DataHu.py +++ b/pyload/plugins/hoster/DataHu.py @@ -31,7 +31,7 @@ class DataHu(SimpleHoster): m = re.search(self.LINK_PATTERN, self.html) if m: url = m.group(1) - self.logDebug('Direct link: ' + url) + self.logDebug("Direct link: " + url) else: self.parseError('Unable to get direct link') diff --git a/pyload/plugins/hoster/DateiTo.py b/pyload/plugins/hoster/DateiTo.py index 1e8ca3614..9ada88157 100644 --- a/pyload/plugins/hoster/DateiTo.py +++ b/pyload/plugins/hoster/DateiTo.py @@ -61,7 +61,7 @@ class DateiTo(SimpleHoster): self.fail('Too bad...') download_url = self.html - self.logDebug('Download URL', download_url) + self.logDebug("Download URL", download_url) self.download(download_url) def checkErrors(self): diff --git a/pyload/plugins/hoster/DepositfilesCom.py b/pyload/plugins/hoster/DepositfilesCom.py index 9c0348cbd..2f647514f 100644 --- a/pyload/plugins/hoster/DepositfilesCom.py +++ b/pyload/plugins/hoster/DepositfilesCom.py @@ -27,7 +27,7 @@ class DepositfilesCom(SimpleHoster): (r'.*<b title="(?P<N>[^"]+).*', "\g<N>")] FILE_URL_REPLACEMENTS = [(__pattern__, "https://dfiles.eu/files/\g<ID>")] - SH_COOKIES = [(".dfiles.eu", "lang_current", "en")] + COOKIES = [(".dfiles.eu", "lang_current", "en")] RECAPTCHA_PATTERN = r"Recaptcha.create\('([^']+)'" @@ -106,7 +106,7 @@ class DepositfilesCom(SimpleHoster): self.retry(wait_time=60) def handlePremium(self): - self.html = self.load(self.pyfile.url, cookies=self.SH_COOKIES) + self.html = self.load(self.pyfile.url, cookies=self.COOKIES) if '<span class="html_download_api-gold_traffic_limit">' in self.html: self.logWarning("Download limit reached") diff --git a/pyload/plugins/hoster/EasybytezCom.py b/pyload/plugins/hoster/EasybytezCom.py index 7b1d8881f..e010aee2a 100644 --- a/pyload/plugins/hoster/EasybytezCom.py +++ b/pyload/plugins/hoster/EasybytezCom.py @@ -8,12 +8,13 @@ class EasybytezCom(XFileSharingPro): __type__ = "hoster" __version__ = "0.18" - __pattern__ = r'http://(?:www\.)?easybytez.com/(\w+).*' + __pattern__ = r'http://(?:www\.)?easybytez\.com/\w{12}' __description__ = """Easybytez.com hoster plugin""" __author_name__ = ("zoidberg", "stickell") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") + HOSTER_NAME = "easybytez.com" FILE_INFO_PATTERN = r'<span class="name">(?P<N>.+)</span><br>\s*<span class="size">(?P<S>[^<]+)</span>' @@ -24,8 +25,4 @@ class EasybytezCom(XFileSharingPro): ERROR_PATTERN = r'(?:class=["\']err["\'][^>]*>|<Center><b>)(.*?)</' - def setup(self): - self.resumeDownload = self.multiDL = self.premium - - getInfo = create_getInfo(EasybytezCom) diff --git a/pyload/plugins/hoster/EdiskCz.py b/pyload/plugins/hoster/EdiskCz.py index 4c532b33f..fcb42020d 100644 --- a/pyload/plugins/hoster/EdiskCz.py +++ b/pyload/plugins/hoster/EdiskCz.py @@ -29,7 +29,7 @@ class EdiskCz(SimpleHoster): def process(self, pyfile): url = re.sub("/(stahni|sk/stahni)/", "/en/download/", pyfile.url) - self.logDebug('URL:' + url) + self.logDebug("URL:" + url) m = re.search(self.ACTION_PATTERN, url) if m is None: diff --git a/pyload/plugins/hoster/EgoFilesCom.py b/pyload/plugins/hoster/EgoFilesCom.py index 7d59b274c..7bf723926 100644 --- a/pyload/plugins/hoster/EgoFilesCom.py +++ b/pyload/plugins/hoster/EgoFilesCom.py @@ -32,7 +32,7 @@ class EgoFilesCom(SimpleHoster): self.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True) def process(self, pyfile): - if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()): + if self.premium and (not self.FORCE_CHECK_TRAFFIC or self.checkTrafficLeft()): self.handlePremium() else: self.handleFree() @@ -56,7 +56,7 @@ class EgoFilesCom(SimpleHoster): self.html = self.load(self.pyfile.url, post=post_data, decode=True) m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.logInfo('Wrong captcha') + self.logInfo("Wrong captcha") self.invalidCaptcha() elif hasattr(m, 'group'): downloadURL = m.group('link') @@ -73,7 +73,7 @@ class EgoFilesCom(SimpleHoster): def handlePremium(self): header = self.load(self.pyfile.url, just_header=True) if 'location' in header: - self.logDebug('DIRECT LINK from header: ' + header['location']) + self.logDebug("DIRECT LINK from header: " + header['location']) self.download(header['location']) else: self.html = self.load(self.pyfile.url, decode=True) @@ -82,7 +82,7 @@ class EgoFilesCom(SimpleHoster): if m is None: self.parseError('Unable to detect direct download url') else: - self.logDebug('DIRECT URL from html: ' + m.group('link')) + self.logDebug("DIRECT URL from html: " + m.group('link')) self.download(m.group('link'), disposition=True) diff --git a/pyload/plugins/hoster/FastixRu.py b/pyload/plugins/hoster/FastixRu.py index aa1794047..cb0cdb278 100644 --- a/pyload/plugins/hoster/FastixRu.py +++ b/pyload/plugins/hoster/FastixRu.py @@ -47,7 +47,7 @@ class FastixRu(Hoster): url = "http://fastix.ru/api_v2/?apikey=%s&sub=getdirectlink&link=%s" % (api_key, pyfile.url) page = self.load(url) data = json_loads(page) - self.logDebug("Json data: %s" % str(data)) + self.logDebug("Json data", data) if "error\":true" in page: self.offline() else: diff --git a/pyload/plugins/hoster/FastshareCz.py b/pyload/plugins/hoster/FastshareCz.py index 3897a1c23..a5a3dece1 100644 --- a/pyload/plugins/hoster/FastshareCz.py +++ b/pyload/plugins/hoster/FastshareCz.py @@ -26,7 +26,7 @@ class FastshareCz(SimpleHoster): FILE_URL_REPLACEMENTS = [("#.*", "")] - SH_COOKIES = [(".fastshare.cz", "lang", "en")] + COOKIES = [(".fastshare.cz", "lang", "en")] FREE_URL_PATTERN = r'action=(/free/.*?)>\s*<img src="([^"]*)"><br' PREMIUM_URL_PATTERN = r'(http://data\d+\.fastshare\.cz/download\.php\?id=\d+&)' diff --git a/pyload/plugins/hoster/File4safeCom.py b/pyload/plugins/hoster/File4safeCom.py index 4aa0e26a4..a86ed033e 100644 --- a/pyload/plugins/hoster/File4safeCom.py +++ b/pyload/plugins/hoster/File4safeCom.py @@ -12,12 +12,13 @@ class File4safeCom(XFileSharingPro): __type__ = "hoster" __version__ = "0.02" - __pattern__ = r'https?://(?:www\.)?file4safe\.com/\w+' + __pattern__ = r'https?://(?:www\.)?file4safe\.com/\w{12}' __description__ = """File4safe.com hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" + HOSTER_NAME = "file4safe.com" diff --git a/pyload/plugins/hoster/FileParadoxIn.py b/pyload/plugins/hoster/FileParadoxIn.py index 955a9726b..436fed357 100644 --- a/pyload/plugins/hoster/FileParadoxIn.py +++ b/pyload/plugins/hoster/FileParadoxIn.py @@ -10,12 +10,13 @@ class FileParadoxIn(XFileSharingPro): __type__ = "hoster" __version__ = "0.01" - __pattern__ = r'https?://(?:www\.)?fileparadox\.in/\w+' + __pattern__ = r'https?://(?:www\.)?fileparadox\.in/\w{12}' __description__ = """FileParadox.in hoster plugin""" __author_name__ = "RazorWing" __author_mail__ = "muppetuk1@hotmail.com" + HOSTER_NAME = "fileparadox.in" FILE_SIZE_PATTERN = r'</font>\s*\(\s*(?P<S>[^)]+)\s*\)</font>' diff --git a/pyload/plugins/hoster/FilefactoryCom.py b/pyload/plugins/hoster/FilefactoryCom.py index fafe96477..03af98843 100644 --- a/pyload/plugins/hoster/FilefactoryCom.py +++ b/pyload/plugins/hoster/FilefactoryCom.py @@ -33,7 +33,7 @@ class FilefactoryCom(SimpleHoster): OFFLINE_PATTERN = r'<h2>File Removed</h2>|This file is no longer available' PREMIUM_ONLY_PATTERN = r'>Premium Account Required<' - SH_COOKIES = [(".filefactory.com", "locale", "en_US.utf8")] + COOKIES = [(".filefactory.com", "locale", "en_US.utf8")] def handleFree(self): @@ -73,7 +73,7 @@ class FilefactoryCom(SimpleHoster): self.parseError('Unable to detect free direct link') direct = direct.group(1) - self.logDebug('DIRECT LINK: ' + direct) + self.logDebug("DIRECT LINK: " + direct) self.download(direct, disposition=True) check = self.checkDownload({"multiple": "You are currently downloading too many files at once.", @@ -102,5 +102,5 @@ class FilefactoryCom(SimpleHoster): else: self.parseError('Unable to detect premium direct link') - self.logDebug('DIRECT PREMIUM LINK: ' + url) + self.logDebug("DIRECT PREMIUM LINK: " + url) self.download(url, disposition=True) diff --git a/pyload/plugins/hoster/FileomCom.py b/pyload/plugins/hoster/FileomCom.py index 11052e289..a5de24a3f 100644 --- a/pyload/plugins/hoster/FileomCom.py +++ b/pyload/plugins/hoster/FileomCom.py @@ -11,16 +11,16 @@ class FileomCom(XFileSharingPro): __type__ = "hoster" __version__ = "0.01" - __pattern__ = r'https?://(?:www\.)?fileom\.com/\w+' + __pattern__ = r'https?://(?:www\.)?fileom\.com/\w{12}' __description__ = """Fileom.com hoster plugin""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" + HOSTER_NAME = "fileom.com" FILE_URL_REPLACEMENTS = [(r'/$', "")] - SH_COOKIES = [(".fileom.com", "lang", "english")] FILE_NAME_PATTERN = r'Filename: <span>(?P<N>.+?)<' FILE_SIZE_PATTERN = r'File Size: <span class="size">(?P<S>[\d\.]+) (?P<U>\w+)' @@ -31,9 +31,9 @@ class FileomCom(XFileSharingPro): def setup(self): - self.resumeDownload = self.premium self.multiDL = True self.chunkLimit = 1 + self.resumeDownload = self.premium getInfo = create_getInfo(FileomCom) diff --git a/pyload/plugins/hoster/FilepostCom.py b/pyload/plugins/hoster/FilepostCom.py index 382971c61..03eddee91 100644 --- a/pyload/plugins/hoster/FilepostCom.py +++ b/pyload/plugins/hoster/FilepostCom.py @@ -114,7 +114,7 @@ class FilepostCom(SimpleHoster): elif 'CAPTCHA Code nicht korrekt' in json_response['js']['error']: return None elif 'CAPTCHA' in json_response['js']['error']: - self.logDebug('error response is unknown, but mentions CAPTCHA -> return None') + self.logDebug("Error response is unknown, but mentions CAPTCHA") return None else: self.fail(json_response['js']['error']) diff --git a/pyload/plugins/hoster/FilerNet.py b/pyload/plugins/hoster/FilerNet.py index 5f1b6bea8..bf33f7fb3 100644 --- a/pyload/plugins/hoster/FilerNet.py +++ b/pyload/plugins/hoster/FilerNet.py @@ -31,14 +31,14 @@ class FilerNet(SimpleHoster): def process(self, pyfile): - if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()): + if self.premium and (not self.FORCE_CHECK_TRAFFIC or self.checkTrafficLeft()): self.handlePremium() else: self.handleFree() def handleFree(self): self.req.setOption("timeout", 120) - self.html = self.load(self.pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES) + self.html = self.load(self.pyfile.url, decode=not self.TEXT_ENCODING, cookies=self.COOKIES) # Wait between downloads m = re.search(r'musst du <span id="time">(\d+)</span> Sekunden warten', self.html) @@ -54,7 +54,7 @@ class FilerNet(SimpleHoster): if 'token' not in inputs: self.parseError('Unable to detect token') token = inputs['token'] - self.logDebug('Token: ' + token) + self.logDebug("Token: " + token) self.html = self.load(self.pyfile.url, post={'token': token}, decode=True) @@ -62,7 +62,7 @@ class FilerNet(SimpleHoster): if 'hash' not in inputs: self.parseError('Unable to detect hash') hash_data = inputs['hash'] - self.logDebug('Hash: ' + hash_data) + self.logDebug("Hash: " + hash_data) downloadURL = r'' recaptcha = ReCaptcha(self) @@ -83,7 +83,7 @@ class FilerNet(SimpleHoster): self.correctCaptcha() break else: - self.logInfo('Wrong captcha') + self.logInfo("Wrong captcha") self.invalidCaptcha() if not downloadURL: @@ -102,7 +102,7 @@ class FilerNet(SimpleHoster): 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.logDebug("Direct link: " + dl) self.download(dl, disposition=True) diff --git a/pyload/plugins/hoster/FilerioCom.py b/pyload/plugins/hoster/FilerioCom.py index 31d04b0ee..5c62b0da8 100644 --- a/pyload/plugins/hoster/FilerioCom.py +++ b/pyload/plugins/hoster/FilerioCom.py @@ -14,14 +14,11 @@ class FilerioCom(XFileSharingPro): __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + HOSTER_NAME = "filerio.in" OFFLINE_PATTERN = r'<b>"File Not Found"</b>|File has been removed due to Copyright Claim' FILE_URL_REPLACEMENTS = [(r'http://.*?/', 'http://filerio.in/')] - def setup(self): - self.resumeDownload = self.multiDL = self.premium - - getInfo = create_getInfo(FilerioCom) diff --git a/pyload/plugins/hoster/FileserveCom.py b/pyload/plugins/hoster/FileserveCom.py index 5892cd96a..367545618 100644 --- a/pyload/plugins/hoster/FileserveCom.py +++ b/pyload/plugins/hoster/FileserveCom.py @@ -103,7 +103,7 @@ class FileserveCom(Hoster): # show download link response = self.load(self.url, post={"downloadLink": "show"}, decode=True) - self.logDebug("show downloadLink response : %s" % response) + self.logDebug("Show downloadLink response : %s" % response) if "fail" in response: self.fail("Couldn't retrieve download url") @@ -130,7 +130,7 @@ class FileserveCom(Hoster): def doTimmer(self): response = self.load(self.url, post={"downloadLink": "wait"}, decode=True) - self.logDebug("wait response : %s" % response[:80]) + self.logDebug("Wait response : %s" % response[:80]) if "fail" in response: self.fail("Failed getting wait time") diff --git a/pyload/plugins/hoster/FilezyNet.py b/pyload/plugins/hoster/FilezyNet.py index eeba4add0..4bd5de495 100644 --- a/pyload/plugins/hoster/FilezyNet.py +++ b/pyload/plugins/hoster/FilezyNet.py @@ -1,42 +1,18 @@ # -*- coding: utf-8 -*- -import re +from pyload.plugins.internal.DeadHoster import DeadHoster, create_getInfo -from pyload.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo - -class FilezyNet(XFileSharingPro): +class FilezyNet(DeadHoster): __name__ = "FilezyNet" __type__ = "hoster" - __version__ = "0.1" + __version__ = "0.2" - __pattern__ = r'http://(?:www\.)?filezy.net/.*/.*.html' + __pattern__ = r'http://(?:www\.)?filezy\.net/\w{12}' __description__ = """Filezy.net hoster plugin""" __author_name__ = None __author_mail__ = None - 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.LINK_PATTERN, dl_file_now) - return link.group(1) - getInfo = create_getInfo(FilezyNet) diff --git a/pyload/plugins/hoster/FiredriveCom.py b/pyload/plugins/hoster/FiredriveCom.py index a9d62bb75..8bd841c8f 100644 --- a/pyload/plugins/hoster/FiredriveCom.py +++ b/pyload/plugins/hoster/FiredriveCom.py @@ -8,7 +8,7 @@ from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FiredriveCom(SimpleHoster): __name__ = "FiredriveCom" __type__ = "hoster" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = r'https?://(?:www\.)?(firedrive|putlocker)\.com/(mobile/)?(file|embed)/(?P<ID>\w+)' @@ -19,7 +19,7 @@ class FiredriveCom(SimpleHoster): FILE_NAME_PATTERN = r'<b>Name:</b> (?P<N>.+) <br>' FILE_SIZE_PATTERN = r'<b>Size:</b> (?P<S>[\d.]+) (?P<U>[a-zA-Z]+) <br>' OFFLINE_PATTERN = r'class="sad_face_image"|>No such page here.<' - TEMP_OFFLINE_PATTERN = r'>(File Temporarily Unavailable|Server Error. Try again later)' + TEMP_OFFLINE_PATTERN = r'Please try again in a few minutes.<' FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.firedrive.com/file/\g<ID>')] diff --git a/pyload/plugins/hoster/FshareVn.py b/pyload/plugins/hoster/FshareVn.py index 5109d239d..3e3632902 100644 --- a/pyload/plugins/hoster/FshareVn.py +++ b/pyload/plugins/hoster/FshareVn.py @@ -69,7 +69,7 @@ class FshareVn(SimpleHoster): self.parseError('FORM') elif 'link_file_pwd_dl' in inputs: for password in self.getPassword().splitlines(): - self.logInfo('Password protected link, trying "%s"' % password) + self.logInfo("Password protected link, trying", password) inputs['link_file_pwd_dl'] = password self.html = self.load(self.url, post=inputs, decode=True) if not 'name="link_file_pwd_dl"' in self.html: diff --git a/pyload/plugins/hoster/GigapetaCom.py b/pyload/plugins/hoster/GigapetaCom.py index d09a1fb0c..dde9cab55 100644 --- a/pyload/plugins/hoster/GigapetaCom.py +++ b/pyload/plugins/hoster/GigapetaCom.py @@ -23,7 +23,7 @@ class GigapetaCom(SimpleHoster): FILE_SIZE_PATTERN = r'<th>\s*Size\s*</th>\s*<td>\s*(?P<S>.*?)\s*</td>' OFFLINE_PATTERN = r'<div id="page_error">' - SH_COOKIES = [(".gigapeta.com", "lang", "us")] + COOKIES = [(".gigapeta.com", "lang", "us")] def handleFree(self): diff --git a/pyload/plugins/hoster/HundredEightyUploadCom.py b/pyload/plugins/hoster/HundredEightyUploadCom.py index 29e152c1d..fa3dd8de3 100644 --- a/pyload/plugins/hoster/HundredEightyUploadCom.py +++ b/pyload/plugins/hoster/HundredEightyUploadCom.py @@ -11,12 +11,13 @@ class HundredEightyUploadCom(XFileSharingPro): __type__ = "hoster" __version__ = "0.01" - __pattern__ = r'http://(?:www\.)?180upload\.com/(\w+).*' + __pattern__ = r'http://(?:www\.)?180upload\.com/\w{12}' __description__ = """180upload.com hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" + HOSTER_NAME = "180upload.com" FILE_NAME_PATTERN = r'Filename:</b></td><td nowrap>(?P<N>.+)</td></tr>-->' diff --git a/pyload/plugins/hoster/IFileWs.py b/pyload/plugins/hoster/IFileWs.py index 45039f8e0..63edfec40 100644 --- a/pyload/plugins/hoster/IFileWs.py +++ b/pyload/plugins/hoster/IFileWs.py @@ -1,23 +1,18 @@ # -*- coding: utf-8 -*- -from pyload.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo +from pyload.plugins.internal.DeadHoster import DeadHoster, create_getInfo -class IFileWs(XFileSharingPro): +class IFileWs(DeadHoster): __name__ = "IFileWs" __type__ = "hoster" - __version__ = "0.01" + __version__ = "0.02" - __pattern__ = r'http://(?:www\.)?ifile\.ws/\w+(/.+)?' + __pattern__ = r'http://(?:www\.)?ifile\.ws/\w{12}' __description__ = """Ifile.ws hoster plugin""" __author_name__ = "z00nx" __author_mail__ = "z00nx0@gmail.com" - HOSTER_NAME = "ifile.ws" - - FILE_INFO_PATTERN = r'<h1\s+style="display:inline;">(?P<N>[^<]+)</h1>\s+\[(?P<S>[^]]+)\]' - OFFLINE_PATTERN = r'File Not Found|The file was removed by administrator' - getInfo = create_getInfo(IFileWs) diff --git a/pyload/plugins/hoster/Keep2shareCC.py b/pyload/plugins/hoster/Keep2shareCC.py index 088a1b012..059ab8e05 100644 --- a/pyload/plugins/hoster/Keep2shareCC.py +++ b/pyload/plugins/hoster/Keep2shareCC.py @@ -52,7 +52,7 @@ class Keep2shareCC(SimpleHoster): m = re.search(self.WAIT_PATTERN, self.html) if m: - self.logDebug('Hoster told us to wait for %s' % m.group(1)) + self.logDebug("Hoster told us to wait for %s" % m.group(1)) # string to time convert courtesy of https://stackoverflow.com/questions/10663720 ftr = [3600, 60, 1] wait_time = sum([a * b for a, b in zip(ftr, map(int, m.group(1).split(':')))]) @@ -62,7 +62,7 @@ class Keep2shareCC(SimpleHoster): m = re.search(self.ALREADY_DOWNLOADING_PATTERN, self.html) if m: # if someone is already downloading on our line, wait 30min and retry - self.logDebug('Already downloading, waiting for 30 minutes') + self.logDebug("Already downloading, waiting for 30 minutes") self.wait(30 * 60, reconnect=True) self.retry() @@ -89,14 +89,14 @@ class Keep2shareCC(SimpleHoster): self.correctCaptcha() break else: - self.logInfo('Wrong captcha') + self.logInfo("Wrong captcha") self.invalidCaptcha() else: self.fail("All captcha attempts failed") def startDownload(self, url): d = urljoin(self.base_url, url) - self.logDebug('Direct Link: ' + d) + self.logDebug("Direct Link: " + d) self.download(d, disposition=True) def sanitize_url(self): diff --git a/pyload/plugins/hoster/LemUploadsCom.py b/pyload/plugins/hoster/LemUploadsCom.py index 8556e3c9c..08d999478 100644 --- a/pyload/plugins/hoster/LemUploadsCom.py +++ b/pyload/plugins/hoster/LemUploadsCom.py @@ -11,12 +11,13 @@ class LemUploadsCom(XFileSharingPro): __type__ = "hoster" __version__ = "0.01" - __pattern__ = r'https?://(?:www\.)?lemuploads.com/\w{12}' + __pattern__ = r'https?://(?:www\.)?lemuploads\.com/\w{12}' __description__ = """LemUploads.com hoster plugin""" __author_name__ = "t4skforce" __author_mail__ = "t4skforce1337[AT]gmail[DOT]com" + HOSTER_NAME = "lemuploads.com" OFFLINE_PATTERN = r'<b>File Not Found</b><br><br>' diff --git a/pyload/plugins/hoster/LetitbitNet.py b/pyload/plugins/hoster/LetitbitNet.py index a28f06571..b9631d311 100644 --- a/pyload/plugins/hoster/LetitbitNet.py +++ b/pyload/plugins/hoster/LetitbitNet.py @@ -148,13 +148,13 @@ class LetitbitNet(SimpleHoster): json_data = [api_key, ["download/direct_links", {"pass": premium_key, "link": self.pyfile.url}]] api_rep = self.load('http://api.letitbit.net/json', post={'r': json_dumps(json_data)}) - self.logDebug('API Data: ' + api_rep) + self.logDebug("API Data: " + api_rep) api_rep = json_loads(api_rep) if api_rep['status'] == 'FAIL': self.fail(api_rep['data']) direct_link = api_rep['data'][0][0] - self.logDebug('Direct Link: ' + direct_link) + self.logDebug("Direct Link: " + direct_link) self.download(direct_link, disposition=True) diff --git a/pyload/plugins/hoster/LinksnappyCom.py b/pyload/plugins/hoster/LinksnappyCom.py index e7cc61391..54c6c0ecb 100644 --- a/pyload/plugins/hoster/LinksnappyCom.py +++ b/pyload/plugins/hoster/LinksnappyCom.py @@ -46,7 +46,7 @@ class LinksnappyCom(Hoster): j = json_loads(r)['links'][0] if j['error']: - self.logError('Error converting the link: %s' % j['error']) + self.logError("Error converting the link: %s" % j['error']) self.fail('Error converting the link') pyfile.name = j['filename'] diff --git a/pyload/plugins/hoster/LomafileCom.py b/pyload/plugins/hoster/LomafileCom.py index 942afa1f4..3b75a79ab 100644 --- a/pyload/plugins/hoster/LomafileCom.py +++ b/pyload/plugins/hoster/LomafileCom.py @@ -22,7 +22,7 @@ class LomafileCom(SimpleHoster): def handleFree(self): - for _ in range(3): + for _ in xrange(3): captcha_id = re.search(r'src="http://lomafile\.com/captchas/(?P<id>\w+)\.jpg"', self.html) if not captcha_id: self.parseError("Unable to parse captcha id.") diff --git a/pyload/plugins/hoster/LuckyShareNet.py b/pyload/plugins/hoster/LuckyShareNet.py index 5cb15d49e..14eacae98 100644 --- a/pyload/plugins/hoster/LuckyShareNet.py +++ b/pyload/plugins/hoster/LuckyShareNet.py @@ -30,7 +30,7 @@ class LuckyShareNet(SimpleHoster): m = re.search(r"waitingtime = (\d+);", html) if m: waittime = int(m.group(1)) - self.logDebug('You have to wait %d seconds between free downloads' % waittime) + self.logDebug("You have to wait %d seconds between free downloads" % waittime) self.retry(wait_time=waittime) else: self.parseError('Unable to detect wait time between free downloads') @@ -42,9 +42,9 @@ class LuckyShareNet(SimpleHoster): # TODO: Some files could not be downloaded in free mode def handleFree(self): file_id = re.match(self.__pattern__, self.pyfile.url).group('ID') - self.logDebug('File ID: ' + file_id) + self.logDebug("File ID: " + file_id) rep = self.load(r"http://luckyshare.net/download/request/type/time/file/" + file_id, decode=True) - self.logDebug('JSON: ' + rep) + self.logDebug("JSON: " + rep) json = self.parseJson(rep) self.wait(int(json['time'])) @@ -54,13 +54,13 @@ class LuckyShareNet(SimpleHoster): challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) rep = self.load(r"http://luckyshare.net/download/verify/challenge/%s/response/%s/hash/%s" % (challenge, response, json['hash']), decode=True) - self.logDebug('JSON: ' + rep) + self.logDebug("JSON: " + rep) if 'link' in rep: json.update(self.parseJson(rep)) self.correctCaptcha() break elif 'Verification failed' in rep: - self.logInfo('Wrong captcha') + self.logInfo("Wrong captcha") self.invalidCaptcha() else: self.parseError('Unable to get downlaod link') @@ -68,7 +68,7 @@ class LuckyShareNet(SimpleHoster): if not json['link']: self.fail("No Download url retrieved/all captcha attempts failed") - self.logDebug('Direct URL: ' + json['link']) + self.logDebug("Direct URL: " + json['link']) self.download(json['link']) diff --git a/pyload/plugins/hoster/MediafireCom.py b/pyload/plugins/hoster/MediafireCom.py index bbf9f06b6..52382e6e6 100644 --- a/pyload/plugins/hoster/MediafireCom.py +++ b/pyload/plugins/hoster/MediafireCom.py @@ -74,7 +74,7 @@ class MediafireCom(SimpleHoster): pyfile.url = re.sub(r'/view/?\?', '/?', pyfile.url) self.url, result = checkHTMLHeader(pyfile.url) - self.logDebug('Location (%d): %s' % (result, self.url)) + self.logDebug("Location (%d): %s" % (result, self.url)) if result == 0: self.html = self.load(self.url, decode=True) diff --git a/pyload/plugins/hoster/MegareleaseOrg.py b/pyload/plugins/hoster/MegareleaseOrg.py index 6a689b6dd..adfe68026 100644 --- a/pyload/plugins/hoster/MegareleaseOrg.py +++ b/pyload/plugins/hoster/MegareleaseOrg.py @@ -8,12 +8,13 @@ class MegareleaseOrg(XFileSharingPro): __type__ = "hoster" __version__ = "0.01" - __pattern__ = r'https?://(?:www\.)?megarelease.org/\w{12}' + __pattern__ = r'https?://(?:www\.)?megarelease\.org/\w{12}' __description__ = """Megarelease.org hoster plugin""" __author_name__ = ("derek3x", "stickell") __author_mail__ = ("derek3x@vmail.me", "l.stickell@yahoo.it") + HOSTER_NAME = "megarelease.org" FILE_INFO_PATTERN = r'<font color="red">%s/(?P<N>.+)</font> \((?P<S>[^)]+)\)</font>' % __pattern__ diff --git a/pyload/plugins/hoster/MovReelCom.py b/pyload/plugins/hoster/MovReelCom.py index 3f97d3fca..8a754f6c8 100644 --- a/pyload/plugins/hoster/MovReelCom.py +++ b/pyload/plugins/hoster/MovReelCom.py @@ -8,12 +8,13 @@ class MovReelCom(XFileSharingPro): __type__ = "hoster" __version__ = "1.20" - __pattern__ = r'http://(?:www\.)?movreel.com/.*' + __pattern__ = r'http://(?:www\.)?movreel\.com/\w{12}' __description__ = """MovReel.com hoster plugin""" __author_name__ = "JorisV83" __author_mail__ = "jorisv83-pyload@yahoo.com" + HOSTER_NAME = "movreel.com" FILE_INFO_PATTERN = r'<h3>(?P<N>.+?) <small><sup>(?P<S>[\d.]+) (?P<U>..)</sup> </small></h3>' diff --git a/pyload/plugins/hoster/NarodRu.py b/pyload/plugins/hoster/NarodRu.py index 22c0ba908..6fa16362d 100644 --- a/pyload/plugins/hoster/NarodRu.py +++ b/pyload/plugins/hoster/NarodRu.py @@ -53,7 +53,7 @@ class NarodRu(SimpleHoster): else: self.fail("No valid captcha code entered") - self.logDebug('Download link: ' + url) + self.logDebug("Download link: " + url) self.download(url) diff --git a/pyload/plugins/hoster/NosuploadCom.py b/pyload/plugins/hoster/NosuploadCom.py index e4feabdd0..83e018355 100644 --- a/pyload/plugins/hoster/NosuploadCom.py +++ b/pyload/plugins/hoster/NosuploadCom.py @@ -31,7 +31,7 @@ class NosuploadCom(XFileSharingPro): # stage2: wait some time and press the "Download File" button data = self.getPostParameters() wait_time = re.search(self.WAIT_PATTERN, self.html, re.MULTILINE | re.DOTALL).group(1) - self.logDebug("hoster told us to wait %s seconds" % wait_time) + self.logDebug("Hoster told us to wait %s seconds" % wait_time) self.wait(wait_time) self.html = self.load(self.pyfile.url, post=data, ref=True, decode=True) diff --git a/pyload/plugins/hoster/NovafileCom.py b/pyload/plugins/hoster/NovafileCom.py index 1346bbde9..8f3f78de1 100644 --- a/pyload/plugins/hoster/NovafileCom.py +++ b/pyload/plugins/hoster/NovafileCom.py @@ -18,6 +18,7 @@ class NovafileCom(XFileSharingPro): __author_name__ = ("zoidberg", "stickell") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") + HOSTER_NAME = "novafile.com" FILE_SIZE_PATTERN = r'<div class="size">(?P<S>.+?)</div>' @@ -26,8 +27,4 @@ class NovafileCom(XFileSharingPro): WAIT_PATTERN = r'<p>Please wait <span id="count"[^>]*>(\d+)</span> seconds</p>' - def setup(self): - self.multiDL = False - - getInfo = create_getInfo(NovafileCom) diff --git a/pyload/plugins/hoster/NowDownloadEu.py b/pyload/plugins/hoster/NowDownloadEu.py index 6e42a55bb..2b0dca907 100644 --- a/pyload/plugins/hoster/NowDownloadEu.py +++ b/pyload/plugins/hoster/NowDownloadEu.py @@ -53,7 +53,7 @@ class NowDownloadEu(SimpleHoster): url = re.search(self.LINK_PATTERN, self.html) if url is None: self.fail('Download Link not Found (Plugin out of Date?)') - self.logDebug('Download link: ' + str(url.group(1))) + self.logDebug("Download link", url.group(1)) self.download(str(url.group(1))) diff --git a/pyload/plugins/hoster/OneFichierCom.py b/pyload/plugins/hoster/OneFichierCom.py index 8fdecb342..f7f42e463 100644 --- a/pyload/plugins/hoster/OneFichierCom.py +++ b/pyload/plugins/hoster/OneFichierCom.py @@ -40,7 +40,7 @@ class OneFichierCom(SimpleHoster): self.html = self.load(self.pyfile.url, decode=True) if self.WAITING_PATTERN in self.html: - self.logInfo('You have to wait been each free download! Retrying in %d seconds.' % self.WAIT_TIME) + self.logInfo("You have to wait been each free download! Retrying in %d seconds." % self.WAIT_TIME) self.waitAndRetry(self.WAIT_TIME) else: # detect parallel download m = re.search(self.NOT_PARALLEL, self.html) diff --git a/pyload/plugins/hoster/PremiumTo.py b/pyload/plugins/hoster/PremiumTo.py index 33df2e7bc..c0a2868d9 100644 --- a/pyload/plugins/hoster/PremiumTo.py +++ b/pyload/plugins/hoster/PremiumTo.py @@ -11,9 +11,9 @@ from pyload.utils import fs_encode class PremiumTo(Hoster): __name__ = "PremiumTo" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" - __pattern__ = r'https?://(?:www\.)?premium.to/.*' + __pattern__ = r'https?://(?:www\.)?premium\.to/.+' __description__ = """Premium.to hoster plugin""" __author_name__ = ("RaNaN", "zoidberg", "stickell") @@ -24,6 +24,7 @@ class PremiumTo(Hoster): self.resumeDownload = True self.chunkLimit = 1 + def process(self, pyfile): if not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "premium.to") @@ -37,8 +38,7 @@ class PremiumTo(Hoster): self.req.setOption("timeout", 120) self.download( - "http://premium.to/api/getfile.php", - get={"username": self.account.username, "password": self.account.password, "link": quote(pyfile.url, "")}, + "http://premium.to/api/getfile.php?username=%s&password=%s&link=%s" % (self.account.username, self.account.password, quote(pyfile.url, "")), disposition=True) check = self.checkDownload({"nopremium": "No premium account available"}) @@ -65,6 +65,7 @@ class PremiumTo(Hoster): if err: self.fail(err) + def getTraffic(self): try: api_r = self.load("http://premium.to/api/straffic.php", diff --git a/pyload/plugins/hoster/PromptfileCom.py b/pyload/plugins/hoster/PromptfileCom.py index 108f470d2..4d2ac8ad6 100644 --- a/pyload/plugins/hoster/PromptfileCom.py +++ b/pyload/plugins/hoster/PromptfileCom.py @@ -29,7 +29,7 @@ class PromptfileCom(SimpleHoster): if m is None: self.parseError("Unable to detect chash") chash = m.group(1) - self.logDebug("read chash %s" % chash) + self.logDebug("Read chash %s" % chash) # continue to stage2 self.html = self.load(self.pyfile.url, decode=True, post={'chash': chash}) @@ -38,7 +38,7 @@ class PromptfileCom(SimpleHoster): if m is None: self.parseError("Unable to detect direct link") direct = m.group(1) - self.logDebug("found direct link: " + direct) + self.logDebug("Found direct link: " + direct) self.download(direct, disposition=True) diff --git a/pyload/plugins/hoster/QuickshareCz.py b/pyload/plugins/hoster/QuickshareCz.py index d82c64888..4082fab44 100644 --- a/pyload/plugins/hoster/QuickshareCz.py +++ b/pyload/plugins/hoster/QuickshareCz.py @@ -36,11 +36,11 @@ class QuickshareCz(SimpleHoster): if self.premium: if 'UU_prihlasen' in self.jsvars: if self.jsvars['UU_prihlasen'] == '0': - self.logWarning('User not logged in') + self.logWarning("User not logged in") self.relogin(self.user) self.retry() elif float(self.jsvars['UU_kredit']) < float(self.jsvars['kredit_odecet']): - self.logWarning('Not enough credit left') + self.logWarning("Not enough credit left") self.premium = False if self.premium: diff --git a/pyload/plugins/hoster/RapidgatorNet.py b/pyload/plugins/hoster/RapidgatorNet.py index cc13f7097..a92424cac 100644 --- a/pyload/plugins/hoster/RapidgatorNet.py +++ b/pyload/plugins/hoster/RapidgatorNet.py @@ -59,12 +59,12 @@ class RapidgatorNet(SimpleHoster): json = self.load('%s/%s' % (self.API_URL, cmd), get={'sid': self.sid, 'url': self.pyfile.url}, decode=True) - self.logDebug('API:%s' % cmd, json, "SID: %s" % self.sid) + self.logDebug("API:%s" % cmd, json, "SID: %s" % self.sid) json = json_loads(json) status = json['response_status'] msg = json['response_details'] except BadHeader, e: - self.logError('API:%s' % cmd, e, "SID: %s" % self.sid) + self.logError("API:%s" % cmd, e, "SID: %s" % self.sid) status = e.code msg = e diff --git a/pyload/plugins/hoster/RarefileNet.py b/pyload/plugins/hoster/RarefileNet.py index 7c6632aac..7082dc19e 100644 --- a/pyload/plugins/hoster/RarefileNet.py +++ b/pyload/plugins/hoster/RarefileNet.py @@ -11,21 +11,20 @@ class RarefileNet(XFileSharingPro): __type__ = "hoster" __version__ = "0.03" - __pattern__ = r'http://(?:www\.)?rarefile.net/\w{12}' + __pattern__ = r'http://(?:www\.)?rarefile\.net/\w{12}' __description__ = """Rarefile.net hoster plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + HOSTER_NAME = "rarefile.net" FILE_NAME_PATTERN = r'<td><font color="red">(?P<N>.*?)</font></td>' FILE_SIZE_PATTERN = r'<td>Size : (?P<S>.+?) ' - LINK_PATTERN = r'<a href="(?P<link>[^"]+)">(?P=link)</a>' + LINK_PATTERN = r'<a href="(?P<link>[^"]+)">(?P=link)</a>' - def setup(self): - self.resumeDownload = self.multiDL = self.premium def handleCaptcha(self, inputs): captcha_div = re.search(r'<b>Enter code.*?<div.*?>(.*?)</div>', self.html, re.S).group(1) diff --git a/pyload/plugins/hoster/SecureUploadEu.py b/pyload/plugins/hoster/SecureUploadEu.py index befe5f0e9..0edc1860d 100644 --- a/pyload/plugins/hoster/SecureUploadEu.py +++ b/pyload/plugins/hoster/SecureUploadEu.py @@ -6,14 +6,15 @@ from pyload.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf class SecureUploadEu(XFileSharingPro): __name__ = "SecureUploadEu" __type__ = "hoster" - __version__ = "0.01" + __version__ = "0.02" - __pattern__ = r'http://(?:www\.)?secureupload\.eu/(\w){12}(/\w+)' + __pattern__ = r'https?://(?:www\.)?secureupload\.eu/\w{12}' __description__ = """SecureUpload.eu hoster plugin""" __author_name__ = "z00nx" __author_mail__ = "z00nx0@gmail.com" + HOSTER_NAME = "secureupload.eu" FILE_INFO_PATTERN = r'<h3>Downloading (?P<N>[^<]+) \((?P<S>[^<]+)\)</h3>' diff --git a/pyload/plugins/hoster/SendmywayCom.py b/pyload/plugins/hoster/SendmywayCom.py index 87cbfcc0d..0306206ca 100644 --- a/pyload/plugins/hoster/SendmywayCom.py +++ b/pyload/plugins/hoster/SendmywayCom.py @@ -8,12 +8,13 @@ class SendmywayCom(XFileSharingPro): __type__ = "hoster" __version__ = "0.01" - __pattern__ = r'http://(?:www\.)?sendmyway.com/\w{12}' + __pattern__ = r'http://(?:www\.)?sendmyway\.com/\w{12}' __description__ = """SendMyWay hoster plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + HOSTER_NAME = "sendmyway.com" FILE_NAME_PATTERN = r'<p class="file-name" ><.*?>\s*(?P<N>.+)' diff --git a/pyload/plugins/hoster/ShareRapidCom.py b/pyload/plugins/hoster/ShareRapidCom.py index b474103fc..d89be1ec4 100644 --- a/pyload/plugins/hoster/ShareRapidCom.py +++ b/pyload/plugins/hoster/ShareRapidCom.py @@ -34,7 +34,7 @@ class ShareRapidCom(SimpleHoster): FILE_SIZE_PATTERN = r'<td class="i">Velikost:</td>\s*<td class="h"><strong>\s*(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</strong></td>' OFFLINE_PATTERN = ur'Nastala chyba 404|Soubor byl smazán' - SH_CHECK_TRAFFIC = True + FORCE_CHECK_TRAFFIC = True LINK_PATTERN = r'<a href="([^"]+)" title="Stahnout">([^<]+)</a>' ERR_LOGIN_PATTERN = ur'<div class="error_div"><strong>Stahování je přístupné pouze přihlášeným uživatelům' diff --git a/pyload/plugins/hoster/SpeedyshareCom.py b/pyload/plugins/hoster/SpeedyshareCom.py index ed6fc443f..42bb3e453 100644 --- a/pyload/plugins/hoster/SpeedyshareCom.py +++ b/pyload/plugins/hoster/SpeedyshareCom.py @@ -1,43 +1,51 @@ # -*- coding: utf-8 -*- - -# Testlink: +# +# Test links: # http://speedy.sh/ep2qY/Zapp-Brannigan.jpg import re +from urlparse import urljoin + from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class SpeedyshareCom(SimpleHoster): __name__ = "SpeedyshareCom" __type__ = "hoster" - __pattern__ = r"https?://(www\.)?(speedyshare.com|speedy.sh)/.*" - __version__ = "0.01" - __description__ = """speedyshare.com hoster plugin""" - __author_name__ = ("zapp-brannigan") - __author_mail__ = ("fuerst.reinje@web.de") + __version__ = "0.02" + + __pattern__ = r"https?://(www\.)?(speedyshare\.com|speedy\.sh)/\w+" + + __description__ = """Speedyshare.com hoster plugin""" + __author_name__ = "zapp-brannigan" + __author_mail__ = "fuerst.reinje@web.de" + FILE_NAME_PATTERN = r'class=downloadfilename>(?P<N>.*)</span></td>' FILE_SIZE_PATTERN = r'class=sizetagtext>(?P<S>.*) (?P<U>[kKmM]?[iI]?[bB]?)</div>' - LINK_PATTERN = r'<a href=\'(.*)\'><img src=/gf/slowdownload.png alt=\'Slow Download\' border=0' + FILE_OFFLINE_PATTERN = r'class=downloadfilenamenotfound>.*</span>' - BASE_URL = 'www.speedyshare.com' + + LINK_PATTERN = r'<a href=\'(.*)\'><img src=/gf/slowdownload.png alt=\'Slow Download\' border=0' + def setup(self): self.multiDL = False self.chunkLimit = 1 - def process(self, pyfile): - self.html = self.load(pyfile.url, decode=True) - try: - dl_link = re.search(self.LINK_PATTERN, self.html).group(1) - self.logDebug("Link: " + dl_link) - except: - self.parseError("Unable to find download link") - self.download(self.BASE_URL + dl_link, disposition=True) - check = self.checkDownload({"is_html": re.compile("html")}) + + def handleFree(self): + m = re.search(self.LINK_PATTERN, self.html) + if m is None: + self.parseError("Download link not found") + + dl_link = urljoin("http://www.speedyshare.com", m.group(1)) + self.download(dl_link, disposition=True) + + check = self.checkDownload({'is_html': re.compile("html")}) if check == "is_html": - self.fail("The downloaded file is html, maybe the plugin is out of date") + self.parseError("Downloaded file is an html file") getInfo = create_getInfo(SpeedyshareCom) diff --git a/pyload/plugins/hoster/StreamcloudEu.py b/pyload/plugins/hoster/StreamcloudEu.py index 0e36a047c..875766fd7 100644 --- a/pyload/plugins/hoster/StreamcloudEu.py +++ b/pyload/plugins/hoster/StreamcloudEu.py @@ -13,20 +13,23 @@ class StreamcloudEu(XFileSharingPro): __type__ = "hoster" __version__ = "0.04" - __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\S+' + __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\w{12}' __description__ = """Streamcloud.eu hoster plugin""" __author_name__ = "seoester" __author_mail__ = "seoester@googlemail.com" + HOSTER_NAME = "streamcloud.eu" LINK_PATTERN = r'file: "(http://(stor|cdn)\d+\.streamcloud.eu:?\d*/.*/video\.(mp4|flv))",' def setup(self): - super(StreamcloudEu, self).setup() self.multiDL = True + self.chunkLimit = 1 + self.resumeDownload = self.premium + def getDownloadLink(self): m = re.search(self.LINK_PATTERN, self.html, re.S) @@ -58,6 +61,7 @@ class StreamcloudEu(XFileSharingPro): return m.group(1) + def getPostParameters(self): for i in xrange(3): if not self.errmsg: diff --git a/pyload/plugins/hoster/TurbobitNet.py b/pyload/plugins/hoster/TurbobitNet.py index 1fbdf9e87..9a6b26c97 100644 --- a/pyload/plugins/hoster/TurbobitNet.py +++ b/pyload/plugins/hoster/TurbobitNet.py @@ -17,31 +17,32 @@ from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, t class TurbobitNet(SimpleHoster): __name__ = "TurbobitNet" __type__ = "hoster" - __version__ = "0.11" + __version__ = "0.12" - __pattern__ = r'http://(?:www\.)?(turbobit.net|unextfiles.com)/(?!download/folder/)(?:download/free/)?(?P<ID>\w+).*' + __pattern__ = r'http://(?:www\.)?turbobit\.net/(?:download/free/)?(?P<ID>\w+)' - __description__ = """Turbobit.net plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __description__ = """ Turbobit.net hoster plugin """ + __author_name__ = ("zoidberg", "prOq") + __author_mail__ = ("zoidberg@mujmail.cz", None) - 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_NAME_PATTERN = r'id="file-title">(?P<N>.+?)<' + FILE_SIZE_PATTERN = r'class="file-size">(?P<S>[\d,.]+) (?P<U>\w+)' OFFLINE_PATTERN = r'<h2>File Not Found</h2>|html\(\'File (?:was )?not found' - FILE_URL_REPLACEMENTS = [(r"http://(?:www\.)?(turbobit.net|unextfiles.com)/(?:download/free/)?(?P<ID>\w+).*", - "http://turbobit.net/\g<ID>.html")] - SH_COOKIES = [(".turbobit.net", "user_lang", "en")] + FILE_URL_REPLACEMENTS = [(__pattern__, "http://turbobit.net/\g<ID>.html")] + + COOKIES = [(".turbobit.net", "user_lang", "en")] LINK_PATTERN = r'(?P<url>/download/redirect/[^"\']+)' - LIMIT_WAIT_PATTERN = r'<div id="time-limit-text">\s*.*?<span id=\'timeout\'>(\d+)</span>' + LIMIT_WAIT_PATTERN = r"<div id='timeout'>(\d+)<" CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"' - CAPTCHA_SRC_PATTERN = r'<img alt="Captcha" src="(.*?)"' + CAPTCHA_SRC_PATTERN = r'<img alt="Captcha" src="(.+?)"' def handleFree(self): self.url = "http://turbobit.net/download/free/%s" % self.file_info['ID'] - self.html = self.load(self.url) + self.html = self.load(self.url, ref=True, decode=True) rtUpdate = self.getRtUpdate() @@ -54,6 +55,7 @@ class TurbobitNet(SimpleHoster): self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With:"]) self.downloadFile() + def solveCaptcha(self): for _ in xrange(5): m = re.search(self.LIMIT_WAIT_PATTERN, self.html) @@ -83,7 +85,8 @@ class TurbobitNet(SimpleHoster): self.logDebug(inputs) self.html = self.load(self.url, post=inputs) - if not "<div class='download-timer-header'>" in self.html: + if '<div class="captcha-error">Incorrect, try again!<' in self.html: + self.logInfo("Invalid captcha") self.invalidCaptcha() else: self.correctCaptcha() @@ -91,11 +94,12 @@ class TurbobitNet(SimpleHoster): else: self.fail("Invalid captcha") + def getRtUpdate(self): rtUpdate = self.getStorage("rtUpdate") if not rtUpdate: - if self.getStorage("version") != self.__version__ or int( - self.getStorage("timestamp", 0)) + 86400000 < timestamp(): + if self.getStorage("version") != self.__version__ \ + or int(self.getStorage("timestamp", 0)) + 86400000 < timestamp(): # that's right, we are even using jdownloader updates rtUpdate = getURL("http://update0.jdownloader.org/pluginstuff/tbupdate.js") rtUpdate = self.decrypt(rtUpdate.splitlines()[1]) @@ -114,19 +118,23 @@ class TurbobitNet(SimpleHoster): return rtUpdate + def getDownloadUrl(self, rtUpdate): self.req.http.lastURL = self.url m = re.search("(/\w+/timeout\.js\?\w+=)([^\"\'<>]+)", self.html) - url = "http://turbobit.net%s%s" % (m.groups() if m else ( - '/files/timeout.js?ver=', ''.join(random.choice('0123456789ABCDEF') for _ in xrange(32)))) + if m: + url = "http://turbobit.net%s%s" % m.groups() + else: + url = "http://turbobit.net/files/timeout.js?ver=%s" % "".join(random.choice('0123456789ABCDEF') for _ in xrange(32)) + fun = self.load(url) self.setWait(65, False) for b in [1, 3]: self.jscode = "var id = \'%s\';var b = %d;var inn = \'%s\';%sout" % ( - self.file_info['ID'], b, quote(fun), rtUpdate) + self.file_info['ID'], b, quote(fun), rtUpdate) try: out = self.js.eval(self.jscode) @@ -141,26 +149,29 @@ class TurbobitNet(SimpleHoster): self.delStorage("rtUpdate") self.retry() + def decrypt(self, data): cipher = ARC4.new(hexlify('E\x15\xa1\x9e\xa3M\xa0\xc6\xa0\x84\xb6H\x83\xa8o\xa0')) return unhexlify(cipher.encrypt(unhexlify(data))) + def getLocalTimeString(self): lt = time.localtime() tz = time.altzone if lt.tm_isdst else time.timezone return "%s GMT%+03d%02d" % (time.strftime("%a %b %d %Y %H:%M:%S", lt), -tz // 3600, tz % 3600) + def handlePremium(self): self.logDebug("Premium download as user %s" % self.user) self.html = self.load(self.pyfile.url) # Useless in 0.5 self.downloadFile() + def downloadFile(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.parseError("download link") + self.parseError("Download link not found") self.url = "http://turbobit.net" + m.group('url') - self.logDebug(self.url) self.download(self.url) diff --git a/pyload/plugins/hoster/TusfilesNet.py b/pyload/plugins/hoster/TusfilesNet.py index 0e01ec805..bbed62a6a 100644 --- a/pyload/plugins/hoster/TusfilesNet.py +++ b/pyload/plugins/hoster/TusfilesNet.py @@ -6,21 +6,20 @@ from pyload.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf class TusfilesNet(XFileSharingPro): __name__ = "TusfilesNet" __type__ = "hoster" - __version__ = "0.03" + __version__ = "0.04" - __pattern__ = r'https?://(?:www\.)?tusfiles\.net/(?P<ID>\w+)' + __pattern__ = r'https?://(?:www\.)?tusfiles\.net/\w{12}' __description__ = """Tusfiles.net hoster plugin""" - __author_name__ = "Walter Purcaro" - __author_mail__ = "vuolter@gmail.com" + __author_name__ = ("Walter Purcaro", "guidobelix") + __author_mail__ = ("vuolter@gmail.com", "guidobelix@hotmail.it") + HOSTER_NAME = "tusfiles.net" FILE_INFO_PATTERN = r'\](?P<N>.+) - (?P<S>[\d.]+) (?P<U>\w+)\[' OFFLINE_PATTERN = r'>File Not Found|<Title>TusFiles - Fast Sharing Files!' - SH_COOKIES = [(".tusfiles.net", "lang", "english")] - def setup(self): self.multiDL = False @@ -28,4 +27,8 @@ class TusfilesNet(XFileSharingPro): self.resumeDownload = True + def handlePremium(self): + return self.handleFree() + + getInfo = create_getInfo(TusfilesNet) diff --git a/pyload/plugins/hoster/UlozTo.py b/pyload/plugins/hoster/UlozTo.py index c3957aaa0..b33c5dd5f 100644 --- a/pyload/plugins/hoster/UlozTo.py +++ b/pyload/plugins/hoster/UlozTo.py @@ -85,14 +85,14 @@ class UlozTo(SimpleHoster): if not action or not inputs: self.parseError("free download form") - self.logDebug('inputs.keys() = ' + str(inputs.keys())) + self.logDebug("inputs.keys = " + str(inputs.keys())) # get and decrypt captcha if all(key in inputs for key in ("captcha_value", "captcha_id", "captcha_key")): # Old version - last seen 9.12.2013 self.logDebug('Using "old" version') captcha_value = self.decryptCaptcha("http://img.uloz.to/captcha/%s.png" % inputs['captcha_id']) - self.logDebug('CAPTCHA ID: ' + inputs['captcha_id'] + ", CAPTCHA VALUE: " + captcha_value) + self.logDebug("CAPTCHA ID: " + inputs['captcha_id'] + ", CAPTCHA VALUE: " + captcha_value) inputs.update({'captcha_id': inputs['captcha_id'], 'captcha_key': inputs['captcha_key'], 'captcha_value': captcha_value}) @@ -101,11 +101,11 @@ class UlozTo(SimpleHoster): self.logDebug('Using "new" version') xapca = self.load("http://www.ulozto.net/reloadXapca.php", get={"rnd": str(int(time.time()))}) - self.logDebug('xapca = ' + str(xapca)) + self.logDebug("xapca = " + str(xapca)) data = json_loads(xapca) captcha_value = self.decryptCaptcha(str(data['image'])) - self.logDebug("CAPTCHA HASH: " + data['hash'] + ", CAPTCHA SALT: " + str(data['salt']) + ", CAPTCHA VALUE: " + captcha_value) + self.logDebug("CAPTCHA HASH: " + data['hash'], "CAPTCHA SALT: " + str(data['salt']), "CAPTCHA VALUE: " + captcha_value) inputs.update({'timestamp': data['timestamp'], 'salt': data['salt'], 'hash': data['hash'], 'captcha_value': captcha_value}) else: diff --git a/pyload/plugins/hoster/UloziskoSk.py b/pyload/plugins/hoster/UloziskoSk.py index f78a6e29a..5bfb2fc77 100644 --- a/pyload/plugins/hoster/UloziskoSk.py +++ b/pyload/plugins/hoster/UloziskoSk.py @@ -48,7 +48,7 @@ class UloziskoSk(SimpleHoster): self.parseError('ID') id = m.group(1) - self.logDebug('URL:' + parsed_url + ' ID:' + id) + self.logDebug("URL:" + parsed_url + ' ID:' + id) m = re.search(self.CAPTCHA_PATTERN, self.html) if m is None: @@ -57,7 +57,7 @@ class UloziskoSk(SimpleHoster): captcha = self.decryptCaptcha(captcha_url, cookies=True) - self.logDebug('CAPTCHA_URL:' + captcha_url + ' CAPTCHA:' + captcha) + self.logDebug("CAPTCHA_URL:" + captcha_url + ' CAPTCHA:' + captcha) self.download(parsed_url, post={ "antispam": captcha, diff --git a/pyload/plugins/hoster/UnibytesCom.py b/pyload/plugins/hoster/UnibytesCom.py index 1541265d9..6adfdbae2 100644 --- a/pyload/plugins/hoster/UnibytesCom.py +++ b/pyload/plugins/hoster/UnibytesCom.py @@ -63,7 +63,7 @@ class UnibytesCom(SimpleHoster): else: self.fail("No valid captcha code entered") - self.logDebug('Download link: ' + url) + self.logDebug("Download link: " + url) self.req.http.c.setopt(FOLLOWLOCATION, 1) self.download(url) diff --git a/pyload/plugins/hoster/UploadedTo.py b/pyload/plugins/hoster/UploadedTo.py index db620eea6..694a053eb 100644 --- a/pyload/plugins/hoster/UploadedTo.py +++ b/pyload/plugins/hoster/UploadedTo.py @@ -205,7 +205,7 @@ class UploadedTo(Hoster): self.wait() result = self.load(url, post=options) - self.logDebug("result: %s" % result) + self.logDebug("Result: %s" % result) if "limit-size" in result: self.fail("File too big for free download") @@ -220,7 +220,7 @@ class UploadedTo(Hoster): self.wait() self.retry() elif '"err":"captcha"' in result: - self.logError("ul.net captcha is disabled") + self.logError("captcha is disabled") self.invalidCaptcha() elif "type:'download'" in result: self.correctCaptcha() diff --git a/pyload/plugins/hoster/UploadheroCom.py b/pyload/plugins/hoster/UploadheroCom.py index f1f893c30..63155a23e 100644 --- a/pyload/plugins/hoster/UploadheroCom.py +++ b/pyload/plugins/hoster/UploadheroCom.py @@ -23,7 +23,7 @@ class UploadheroCom(SimpleHoster): FILE_SIZE_PATTERN = r'Taille du fichier : </span><strong>(?P<S>.*?)</strong>' OFFLINE_PATTERN = r'<p class="titre_dl_2">|<div class="raison"><strong>Le lien du fichier ci-dessus n\'existe plus.' - SH_COOKIES = [(".uploadhero.co", "lang", "en")] + COOKIES = [(".uploadhero.co", "lang", "en")] IP_BLOCKED_PATTERN = r'href="(/lightbox_block_download.php\?min=.*?)"' IP_WAIT_PATTERN = r'<span id="minutes">(\d+)</span>.*\s*<span id="seconds">(\d+)</span>' diff --git a/pyload/plugins/hoster/UpstoreNet.py b/pyload/plugins/hoster/UpstoreNet.py index bd084612c..d812d292d 100644 --- a/pyload/plugins/hoster/UpstoreNet.py +++ b/pyload/plugins/hoster/UpstoreNet.py @@ -31,7 +31,7 @@ class UpstoreNet(SimpleHoster): if m is None: self.parseError("could not detect hash") chash = m.group(1) - self.logDebug("read hash " + chash) + self.logDebug("Read hash " + chash) # continue to stage2 post_data = {'hash': chash, 'free': 'Slow download'} self.html = self.load(self.pyfile.url, post=post_data, decode=True) @@ -41,7 +41,7 @@ class UpstoreNet(SimpleHoster): recaptcha = ReCaptcha(self) if not recaptcha.detect_key(self.html): self.parseError("could not find recaptcha pattern") - self.logDebug("using captcha key " + recaptcha.recaptcha_key) + self.logDebug("Using captcha key " + recaptcha.recaptcha_key) # try the captcha 5 times for i in xrange(5): m = re.search(self.WAIT_PATTERN, self.html) @@ -68,7 +68,7 @@ class UpstoreNet(SimpleHoster): self.parseError("could not detect direct link") direct = m.group(1) - self.logDebug('found direct link: ' + direct) + self.logDebug("Found direct link: " + direct) self.download(direct, disposition=True) diff --git a/pyload/plugins/hoster/UptoboxCom.py b/pyload/plugins/hoster/UptoboxCom.py index 8fd5e6fa7..2786deb5a 100644 --- a/pyload/plugins/hoster/UptoboxCom.py +++ b/pyload/plugins/hoster/UptoboxCom.py @@ -2,68 +2,35 @@ import re -from urllib import unquote - from pyload.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo -from pyload.plugins.internal.CaptchaService import ReCaptcha, SolveMedia -from pyload.utils import html_unescape class UptoboxCom(XFileSharingPro): __name__ = "UptoboxCom" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" - __pattern__ = r'https?://(?:www\.)?uptobox\.com/\w+' + __pattern__ = r'https?://(?:www\.)?uptobox\.com/\w{12}' __description__ = """Uptobox.com hoster plugin""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" + HOSTER_NAME = "uptobox.com" - FILE_INFO_PATTERN = r'"para_title">(?P<N>.+) \((?P<S>[\d\.]+) (?P<U>\w+)\)' + FILE_INFO_PATTERN = r'"para_title">(?P<N>.+) \((?P<S>[\d.]+) (?P<U>\w+)\)' OFFLINE_PATTERN = r'>(File not found|Access Denied|404 Not Found)' TEMP_OFFLINE_PATTERN = r'>This server is in maintenance mode' WAIT_PATTERN = r'>(\d+)</span> seconds<' - LINK_PATTERN = r'"(https?://\w+\.uptobox\.com/d/.*?)"' - def handleCaptcha(self, inputs): - m = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if m: - captcha_key = m.group(1) - captcha = SolveMedia(self) - inputs['adcopy_challenge'], inputs['adcopy_response'] = captcha.challenge(captcha_key) - return 4 - else: - m = re.search(self.CAPTCHA_URL_PATTERN, self.html) - if m: - captcha_url = m.group(1) - inputs['code'] = self.decryptCaptcha(captcha_url) - return 2 - else: - m = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.DOTALL) - if m: - captcha_div = m.group(1) - self.logDebug(captcha_div) - numerals = re.findall(r'<span.*?padding-left\s*:\s*(\d+).*?>(\d)</span>', - html_unescape(captcha_div)) - inputs['code'] = "".join([a[1] for a in sorted(numerals, key=lambda num: int(num[0]))]) - self.logDebug("CAPTCHA", inputs['code'], numerals) - return 3 - else: - m = re.search(self.RECAPTCHA_URL_PATTERN, self.html) - if m: - recaptcha_key = unquote(m.group(1)) - self.logDebug("RECAPTCHA KEY: %s" % recaptcha_key) - recaptcha = ReCaptcha(self) - inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge( - recaptcha_key) - return 1 - return 0 + def setup(self): + self.multiDL = True + self.chunkLimit = 1 + self.resumeDownload = True getInfo = create_getInfo(UptoboxCom) diff --git a/pyload/plugins/hoster/VeehdCom.py b/pyload/plugins/hoster/VeehdCom.py index 4d76c3525..8a882a932 100644 --- a/pyload/plugins/hoster/VeehdCom.py +++ b/pyload/plugins/hoster/VeehdCom.py @@ -20,7 +20,7 @@ class VeehdCom(Hoster): def _debug(self, msg): - self.logDebug('[%s] %s' % (self.__name__, msg)) + self.logDebug("[%s] %s" % (self.__name__, msg)) def setup(self): self.multiDL = True diff --git a/pyload/plugins/hoster/VeohCom.py b/pyload/plugins/hoster/VeohCom.py index 31b21420a..057db56a3 100644 --- a/pyload/plugins/hoster/VeohCom.py +++ b/pyload/plugins/hoster/VeohCom.py @@ -22,7 +22,7 @@ class VeohCom(SimpleHoster): FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.veoh.com/watch/\g<ID>')] - SH_COOKIES = [(".veoh.com", "lassieLocale", "en")] + COOKIES = [(".veoh.com", "lassieLocale", "en")] def setup(self): diff --git a/pyload/plugins/hoster/VimeoCom.py b/pyload/plugins/hoster/VimeoCom.py index aebf1c344..d5dab556e 100644 --- a/pyload/plugins/hoster/VimeoCom.py +++ b/pyload/plugins/hoster/VimeoCom.py @@ -24,7 +24,7 @@ class VimeoCom(SimpleHoster): FILE_URL_REPLACEMENTS = [(__pattern__, r'https://www.vimeo.com/\g<ID>')] - SH_COOKIES = [(".vimeo.com", "language", "en")] + COOKIES = [(".vimeo.com", "language", "en")] def setup(self): diff --git a/pyload/plugins/hoster/WrzucTo.py b/pyload/plugins/hoster/WrzucTo.py index b766ea785..17d568f54 100644 --- a/pyload/plugins/hoster/WrzucTo.py +++ b/pyload/plugins/hoster/WrzucTo.py @@ -21,7 +21,7 @@ class WrzucTo(SimpleHoster): FILE_NAME_PATTERN = r'id="file_info">\s*<strong>(?P<N>.*?)</strong>' FILE_SIZE_PATTERN = r'class="info">\s*<tr>\s*<td>(?P<S>.*?)</td>' - SH_COOKIES = [(".wrzuc.to", "language", "en")] + COOKIES = [(".wrzuc.to", "language", "en")] def setup(self): diff --git a/pyload/plugins/hoster/XFileSharingPro.py b/pyload/plugins/hoster/XFileSharingPro.py index c7733600b..212ef23ef 100644 --- a/pyload/plugins/hoster/XFileSharingPro.py +++ b/pyload/plugins/hoster/XFileSharingPro.py @@ -21,22 +21,31 @@ class XFileSharingPro(SimpleHoster): """ __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.32" + __version__ = "0.36" __pattern__ = r'^unmatchable$' __description__ = """XFileSharingPro base hoster plugin""" - __author_name__ = ("zoidberg", "stickell") - __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") + __author_name__ = ("zoidberg", "stickell", "Walter Purcaro") + __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it", "vuolter@gmail.com") + + + HOSTER_NAME = None + + FILE_URL_REPLACEMENTS = [(r'/embed-(\w{12}).*', r'/\1')] #: support embedded files + + COOKIES = [(HOSTER_NAME, "lang", "english")] FILE_INFO_PATTERN = r'<tr><td align=right><b>Filename:</b></td><td nowrap>(?P<N>[^<]+)</td></tr>\s*.*?<small>\((?P<S>[^<]+)\)</small>' FILE_NAME_PATTERN = r'<input type="hidden" name="fname" value="(?P<N>[^"]+)"' FILE_SIZE_PATTERN = r'You have requested .*\((?P<S>[\d\.\,]+) ?(?P<U>\w+)?\)</font>' + OFFLINE_PATTERN = r'>\w+ (Not Found|file (was|has been) removed)' WAIT_PATTERN = r'<span id="countdown_str">.*?>(\d+)</span>' OVR_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)' + LINK_PATTERN = None #: final download url pattern CAPTCHA_URL_PATTERN = r'(http://[^"\']+?/captchas?/[^"\']+)' RECAPTCHA_URL_PATTERN = r'http://[^"\']+?recaptcha[^"\']+?\?k=([^"\']+)"' @@ -47,13 +56,33 @@ class XFileSharingPro(SimpleHoster): def setup(self): + self.chunkLimit = 1 + if self.__name__ == "XFileSharingPro": - self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] self.multiDL = True + self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] + self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1).lower() + self.COOKIES = [(self.HOSTER_NAME, "lang", "english")] else: self.resumeDownload = self.multiDL = self.premium - self.chunkLimit = 1 + + def prepare(self): + """ Initialize important variables """ + if not self.HOSTER_NAME: + self.fail("Missing HOSTER_NAME") + + if not self.LINK_PATTERN: + pattr = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<]+)' + self.LINK_PATTERN = pattr % self.HOSTER_NAME + + if isinstance(self.COOKIES, list): + set_cookies(self.req.cj, self.COOKIES) + + self.captcha = None + self.errmsg = None + self.passwords = self.getPassword().splitlines() + def process(self, pyfile): self.prepare() @@ -69,8 +98,8 @@ class XFileSharingPro(SimpleHoster): try: # Due to a 0.4.9 core bug self.load would use cookies even if # cookies=False. Workaround using getURL to avoid cookies. - # Can be reverted in 0.5 as the cookies bug has been fixed. - self.html = getURL(pyfile.url, decode=True) + # Can be reverted in 0.4.10 as the cookies bug has been fixed. + self.html = getURL(pyfile.url, decode=True, cookies=self.COOKIES) self.file_info = self.getFileInfo() except PluginParseError: self.file_info = None @@ -88,22 +117,13 @@ class XFileSharingPro(SimpleHoster): else: self.handleFree() - def prepare(self): - """ Initialize important variables """ - if not hasattr(self, "HOSTER_NAME"): - self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1) - if not hasattr(self, "LINK_PATTERN"): - self.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() def getDirectDownloadLink(self): """ Get download link for premium users with direct download enabled """ self.req.http.lastURL = self.pyfile.url self.req.http.c.setopt(FOLLOWLOCATION, 0) - self.html = self.load(self.pyfile.url, cookies=True, decode=True) + self.html = self.load(self.pyfile.url, decode=True) self.header = self.req.http.header self.req.http.c.setopt(FOLLOWLOCATION, 1) @@ -114,11 +134,13 @@ class XFileSharingPro(SimpleHoster): return location + def handleFree(self): url = self.getDownloadLink() self.logDebug("Download URL: %s" % url) self.startDownload(url) + def getDownloadLink(self): for i in xrange(5): self.logDebug("Getting download link: #%d" % i) @@ -145,6 +167,7 @@ class XFileSharingPro(SimpleHoster): return m.group(1) + def handlePremium(self): self.html = self.load(self.pyfile.url, post=self.getPostParameters()) m = re.search(self.LINK_PATTERN, self.html) @@ -152,6 +175,7 @@ class XFileSharingPro(SimpleHoster): self.parseError('DIRECT LINK') self.startDownload(m.group(1)) + def handleOverriden(self): #only tested with easybytez.com self.html = self.load("http://www.%s/" % self.HOSTER_NAME) @@ -189,13 +213,15 @@ class XFileSharingPro(SimpleHoster): else: self.retry() + def startDownload(self, link): link = link.strip() if self.captcha: self.correctCaptcha() - self.logDebug('DIRECT LINK: %s' % link) + self.logDebug("DIRECT LINK: %s" % link) self.download(link, disposition=True) + def checkErrors(self): m = re.search(self.ERROR_PATTERN, self.html) if m: @@ -227,6 +253,7 @@ class XFileSharingPro(SimpleHoster): return self.errmsg + def getPostParameters(self): for _ in xrange(3): if not self.errmsg: @@ -288,6 +315,7 @@ class XFileSharingPro(SimpleHoster): else: self.parseError('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) + def handleCaptcha(self, inputs): m = re.search(self.RECAPTCHA_URL_PATTERN, self.html) if m: diff --git a/pyload/plugins/hoster/ZeveraCom.py b/pyload/plugins/hoster/ZeveraCom.py index f76290ea5..64b93e14d 100644 --- a/pyload/plugins/hoster/ZeveraCom.py +++ b/pyload/plugins/hoster/ZeveraCom.py @@ -8,7 +8,7 @@ class ZeveraCom(Hoster): __type__ = "hoster" __version__ = "0.21" - __pattern__ = r'http://(?:www\.)?zevera.com/.*' + __pattern__ = r'http://(?:www\.)?zevera\.com/.*' __description__ = """Zevera.com hoster plugin""" __author_name__ = "zoidberg" @@ -24,7 +24,7 @@ class ZeveraCom(Hoster): self.logError(_("Please enter your %s account or deactivate this plugin") % "zevera.com") self.fail("No zevera.com account provided") - self.logDebug("zevera.com: Old URL: %s" % pyfile.url) + self.logDebug("Old URL: %s" % pyfile.url) if self.account.getAPIData(self.req, cmd="checklink", olink=pyfile.url) != "Alive": self.fail("Offline or not downloadable - contact Zevera support") @@ -38,71 +38,3 @@ class ZeveraCom(Hoster): check = self.checkDownload({"error": 'action="ErrorDownload.aspx'}) if check == "error": self.fail("Error response received - contact Zevera support") - - # BitAPI not used - defunct, probably abandoned by Zevera - # - # api_url = "http://zevera.com/API.ashx" - # - # def process(self, pyfile): - # if not self.account: - # self.logError(_("Please enter your zevera.com account or deactivate this plugin")) - # self.fail("No zevera.com account provided") - # - # self.logDebug("zevera.com: Old URL: %s" % pyfile.url) - # - # last_size = retries = 0 - # olink = pyfile.url #quote(pyfile.url.encode('utf_8')) - # - # for _ in xrange(100): - # self.retData = self.account.loadAPIRequest(self.req, cmd = 'download_request', olink = olink) - # self.checkAPIErrors(self.retData) - # - # if self.retData['FileInfo']['StatusID'] == 100: - # break - # elif self.retData['FileInfo']['StatusID'] == 99: - # self.fail('Failed to initialize download (99)') - # else: - # if self.retData['FileInfo']['Progress']['BytesReceived'] <= last_size: - # if retries >= 6: - # self.fail('Failed to initialize download (%d)' % self.retData['FileInfo']['StatusID'] ) - # retries += 1 - # else: - # retries = 0 - # - # last_size = self.retData['FileInfo']['Progress']['BytesReceived'] - # - # self.setWait(self.retData['Update_Wait']) - # self.wait() - # - # pyfile.name = self.retData['FileInfo']['RealFileName'] - # pyfile.size = self.retData['FileInfo']['FileSizeInBytes'] - # - # self.retData = self.account.loadAPIRequest(self.req, cmd = 'download_start', - # FileID = self.retData['FileInfo']['FileID']) - # self.checkAPIErrors(self.retData) - # - # self.download(self.api_url, get = { - # 'cmd': "open_stream", - # 'login': self.account.loginname, - # 'pass': self.account.password, - # 'FileID': self.retData['FileInfo']['FileID'], - # 'startBytes': 0 - # } - # ) - # - # def checkAPIErrors(self, retData): - # if not retData: - # self.fail('Unknown API response') - # - # if retData['ErrorCode']: - # self.logError(retData['ErrorCode'], retData['ErrorMessage']) - # #self.fail('ERROR: ' + retData['ErrorMessage']) - # - # if pyfile.size / 1024000 > retData['AccountInfo']['AvailableTODAYTrafficForUseInMBytes']: - # self.logWarning("Not enough data left to download the file") - # - # def crazyDecode(self, ustring): - # # accepts decoded ie. unicode string - API response is double-quoted, double-utf8-encoded - # # no idea what the proper order of calling these functions would be :-/ - # return html_unescape(unquote(unquote(ustring.replace( - # '@DELIMITER@','#'))).encode('raw_unicode_escape').decode('utf-8')) diff --git a/pyload/plugins/hoster/ZippyshareCom.py b/pyload/plugins/hoster/ZippyshareCom.py index d6b7375e2..60d152455 100644 --- a/pyload/plugins/hoster/ZippyshareCom.py +++ b/pyload/plugins/hoster/ZippyshareCom.py @@ -1,74 +1,72 @@ # -*- coding: utf-8 -*- -# -# Test links: -# http://www13.zippyshare.com/v/18665333/file.html import re +from os import path +from urlparse import urljoin + from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ZippyshareCom(SimpleHoster): __name__ = "ZippyshareCom" __type__ = "hoster" - __version__ = "0.49" + __version__ = "0.51" - __pattern__ = r'(?P<HOST>http://www\d{0,2}\.zippyshare.com)/v(?:/|iew.jsp.*key=)(?P<KEY>\d+)' + __pattern__ = r'(?P<HOST>http://www\d{0,2}\.zippyshare\.com)/v(?:/|iew\.jsp.*key=)(?P<KEY>\d+)' __description__ = """Zippyshare.com hoster plugin""" - __author_name__ = ("spoob", "zoidberg", "stickell", "skylab") - __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it", "development@sky-lab.de") + __author_name__ = "Walter Purcaro" + __author_mail__ = "vuolter@gmail.com" + + + FILE_NAME_PATTERN = r'>Name:.+?">(?P<N>.+?)<' + FILE_SIZE_PATTERN = r'>Size:.+?">(?P<S>[\d.]+) (?P<U>\w+)' - FILE_NAME_PATTERN = r'<title>Zippyshare\.com - (?P<N>[^<]+)</title>' - FILE_SIZE_PATTERN = r'>Size:</font>\s*<font [^>]*>(?P<S>[0-9.,]+) (?P<U>[kKMG]+)i?B</font><br />' - FILE_INFO_PATTERN = r'document\.getElementById\(\'dlbutton\'\)\.href = "[^;]*/(?P<N>[^"]+)";' - OFFLINE_PATTERN = r'>File does not exist on this server</div>' + OFFLINE_PATTERN = r'>File does not exist on this server<' - SH_COOKIES = [(".zippyshare.com", "ziplocale", "en")] + COOKIES = [(".zippyshare.com", "ziplocale", "en")] def setup(self): self.multiDL = True + self.chunkLimit = -1 + self.resumeDownload = True + def handleFree(self): - url = self.get_file_url() - if not url: - self.fail("Download URL not found.") + url = self.get_link() self.logDebug("Download URL: %s" % url) self.download(url) - def get_file_url(self): - """returns the absolute downloadable filepath""" - url_parts = re.search(r'(addthis:url="(http://www(\d+).zippyshare.com/v/(\d*)/file.html))', self.html) - number = url_parts.group(4) - check = re.search(r'<script type="text/javascript">([^<]*?)(var a = (\d*);)', self.html) - if check: - a = int(re.search(r'<script type="text/javascript">([^<]*?)(var a = (\d*);)', self.html).group(3)) - k = int(re.search(r'<script type="text/javascript">([^<]*?)(\d*%(\d*))', self.html).group(3)) - checksum = ((a + 3) % k) * ((a + 3) % 3) + 18 + + def get_checksum(self): + m = re.search(r'\(a\*b\+19\)', self.html) + if m: + m = re.findall(r'var \w = (\d+)\%(\d+);', self.html) + c = lambda a,b: a * b + 19 else: - # This might work but is insecure - # checksum = eval(re.search("((\d*)\s\%\s(\d*)\s\+\s(\d*)\s\%\s(\d*))", self.html).group(0)) - - m = re.search(r"((?P<a>\d*)\s%\s(?P<b>\d*)\s\+\s(?P<c>\d*)\s%\s(?P<k>\d*))", self.html) - if m is None: - self.parseError("Unable to detect values to calculate direct link") - a = int(m.group("a")) - b = int(m.group("b")) - c = int(m.group("c")) - k = int(m.group("k")) - if a == c: - checksum = ((a % b) + (a % k)) - else: - checksum = ((a % b) + (c % k)) - - self.logInfo('Checksum: %s' % checksum) - - filename = re.search(r'>Name:</font>\s*<font [^>]*>(?P<N>[^<]+)</font><br />', self.html).group('N') - - url = "/d/%s/%s/%s" % (number, checksum, filename) - self.logInfo(self.file_info['HOST'] + url) - return self.file_info['HOST'] + url + m = re.findall(r'(\d+) \% (\d+)', self.html) + c = lambda a,b: a + b + + if not m: + self.parseError("Unable to calculate checksum") + + a = map(lambda x: int(x), m[0]) + b = map(lambda x: int(x), m[1]) + + # Checksum is calculated as (a*b+19) or (a+b), where a and b are the result of modulo calculations + a = a[0] % a[1] + b = b[0] % b[1] + + return c(a, b) + + + def get_link(self): + checksum = self.get_checksum() + p_url = path.join("d", self.file_info['KEY'], str(checksum), self.pyfile.name) + dl_link = urljoin(self.file_info['HOST'], p_url) + return dl_link getInfo = create_getInfo(ZippyshareCom) |