From 6153be90519d11aa5678f1fa461cba75deb5a124 Mon Sep 17 00:00:00 2001 From: Jeix <devnull@localhost> Date: Sat, 17 Dec 2011 14:40:43 +0100 Subject: improve share online --- module/plugins/hoster/ShareonlineBiz.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 2a6645e86..ab7f5b249 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -13,7 +13,7 @@ from module.plugins.Plugin import chunks def getInfo(urls): - api_url_base = "http://www.share-online.biz/linkcheck/linkcheck.php" + api_url_base = "http://api.share-online.biz/linkcheck.php" for chunk in chunks(urls, 90): api_param_file = {"links": "\n".join(x.replace("http://www.share-online.biz/dl/","").rstrip("/") for x in chunk)} #api only supports old style links @@ -67,7 +67,7 @@ class ShareonlineBiz(Hoster): self.handleFree() def downloadAPIData(self): - api_url_base = "http://www.share-online.biz/linkcheck/linkcheck.php?md5=1" + api_url_base = "http://api.share-online.biz/linkcheck.php?md5=1" api_param_file = {"links": self.pyfile.url.replace("http://www.share-online.biz/dl/","")} #api only supports old style links src = self.load(api_url_base, cookies=False, post=api_param_file) @@ -116,9 +116,12 @@ class ShareonlineBiz(Hoster): self.download(download_url) - check = self.checkDownload({"invalid" : "Dieses Download-Ticket ist ungültig!"}) + check = self.checkDownload({"invalid" : "Dieses Download-Ticket ist ungültig!", + "error" : "Es ist ein unbekannter Fehler aufgetreten"}) if check == "invalid": self.retry(reason=_("Invalid download ticket")) + elif check == "error": + self.fail(reason=_("ShareOnline internal problems")) def handleAPIPremium(self): #should be working better -- cgit v1.2.3 From 4e918edba6c3808b095eab1bad137a2a8cab970d Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sat, 17 Dec 2011 21:53:57 +0100 Subject: updated plugin api and plugin manager --- module/plugins/hoster/RapidshareCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index 0d927c525..f3011a488 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -52,7 +52,7 @@ class RapidshareCom(Hoster): __pattern__ = r"https?://[\w\.]*?rapidshare.com/(?:files/(?P<id>\d*?)/(?P<name>[^?]+)|#!download\|(?:\w+)\|(?P<id_new>\d+)\|(?P<name_new>[^|]+))" __version__ = "1.37" __description__ = """Rapidshare.com Download Hoster""" - __config__ = [["server", "Cogent;Deutsche Telekom;Level(3);Level(3) #2;GlobalCrossing;Level(3) #3;Teleglobe;GlobalCrossing #2;TeliaSonera #2;Teleglobe #2;TeliaSonera #3;TeliaSonera", "Preferred Server", "None"]] + __config__ = [("server", "Cogent;Deutsche Telekom;Level(3);Level(3) #2;GlobalCrossing;Level(3) #3;Teleglobe;GlobalCrossing #2;TeliaSonera #2;Teleglobe #2;TeliaSonera #3;TeliaSonera", "Preferred Server", "None")] __author_name__ = ("spoob", "RaNaN", "mkaay") __author_mail__ = ("spoob@pyload.org", "ranan@pyload.org", "mkaay@mkaay.de") -- cgit v1.2.3 From 9da54933b2bcf58fb0d2342942815ce9e333a400 Mon Sep 17 00:00:00 2001 From: Jeix <devnull@localhost> Date: Sat, 24 Dec 2011 11:25:04 +0100 Subject: ShareOnline Premium, OronCom updates --- module/plugins/hoster/OronCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/OronCom.py b/module/plugins/hoster/OronCom.py index e3e157a6d..0be840d76 100755 --- a/module/plugins/hoster/OronCom.py +++ b/module/plugins/hoster/OronCom.py @@ -33,12 +33,12 @@ class OronCom(Hoster): __name__ = "OronCom" __type__ = "hoster" __pattern__ = r"http://(?:www.)?oron.com/" - __version__ = "0.12" + __version__ = "0.13" __description__ = "File Hoster: Oron.com" __author_name__ = ("chrox", "DHMH") __author_mail__ = ("chrox@pyload.org", "DHMH@pyload.org") - FILE_INFO_PATTERN = r'Dateiname: <b class="f_arial f_14px">(.*)</b> <br>Größe: ([0-9,.]+) (Kb|Mb|Gb)' + FILE_INFO_PATTERN = r'(?:Filename|Dateiname): <b class="f_arial f_14px">(.*?)</b>\s*<br>\s*(?:Größe|File size): ([0-9,\.]+) (Kb|Mb|Gb)' def init(self): self.resumeDownload = self.multiDL = True if self.account else False -- cgit v1.2.3 From 9538fd00584d24c871a3c6b4f47446e187348ff9 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sat, 24 Dec 2011 12:20:41 +0100 Subject: fix SO for new account manager --- module/plugins/hoster/ShareonlineBiz.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index d355eeffe..641a9b025 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -52,7 +52,7 @@ class ShareonlineBiz(Hoster): self.multiDL = False self.chunkLimit = 1 - if self.account and self.account.isPremium(self.user): + if self.premium: self.multiDL = True def process(self, pyfile): @@ -60,7 +60,7 @@ class ShareonlineBiz(Hoster): pyfile.name = self.api_data["filename"] pyfile.sync() - if self.account and self.account.isPremium(self.user): + if self.premium: self.handleAPIPremium() #self.handleWebsitePremium() else: @@ -127,7 +127,7 @@ class ShareonlineBiz(Hoster): def handleAPIPremium(self): #should be working better self.resumeDownload = True - info = self.account.getUserAPI(self.user, self.req) + info = self.account.getUserAPI(self.req) if info["dl"].lower() == "not_available": self.fail("DL API error") self.req.cj.setCookie("share-online.biz", "dl", info["dl"]) -- cgit v1.2.3 From 6e64aee6efdbd0ccf7d2d53418fbfaa0765300ef Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Tue, 27 Dec 2011 12:33:10 +0100 Subject: some account fixes --- module/plugins/hoster/RapidshareCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index f3011a488..a4a72eb53 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -132,7 +132,7 @@ class RapidshareCom(Hoster): self.handleFree() def handlePremium(self): - info = self.account.getAccountInfo(self.user, True) + info = self.account.getAccountInfo(True) self.log.debug("%s: Use Premium Account" % self.__name__) url = self.api_data["mirror"] self.download(url, get={"directstart":1}) -- cgit v1.2.3 From 35742c2cb023ac49ab3056752d2040cdb030cc2b Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sun, 1 Jan 2012 13:36:59 +0100 Subject: Happy new Year ! --- module/plugins/hoster/YoutubeCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 2b3ea7ed7..b6ea36a3c 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -75,10 +75,10 @@ class YoutubeCom(Hoster): fmt_dict[fmt] = unquote(url) self.logDebug("Found links: %s" % fmt_dict) - for fmt in fmt_dict.keys(): + for fmt in fmt_dict.keys(): if fmt not in self.formats: - self.logDebug("FMT not supported: %s" % fmt) - del fmt_dict[fmt] + self.logDebug("FMT not supported: %s" % fmt) + del fmt_dict[fmt] allowed = lambda x: self.getConfig(self.formats[x][0]) sel = lambda x: self.formats[x][3] #select quality index -- cgit v1.2.3 From 952395d3521ce94a41543d4bdc15f3b73a507397 Mon Sep 17 00:00:00 2001 From: zoidberg10 <zoidberg@mujmail.cz> Date: Tue, 3 Jan 2012 19:39:07 +0100 Subject: update mediafire, easybytez --- module/plugins/hoster/EasybytezCom.py | 69 +++++++++++++++++++++++++++++++---- module/plugins/hoster/MediafireCom.py | 6 +-- 2 files changed, 65 insertions(+), 10 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/EasybytezCom.py b/module/plugins/hoster/EasybytezCom.py index 5858dd935..dac35b1d3 100644 --- a/module/plugins/hoster/EasybytezCom.py +++ b/module/plugins/hoster/EasybytezCom.py @@ -18,12 +18,13 @@ import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from random import random class EasybytezCom(SimpleHoster): __name__ = "EasybytezCom" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)?easybytez.com/(\w+).*" - __version__ = "0.01" + __version__ = "0.03" __description__ = """easybytez.com""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -36,24 +37,78 @@ class EasybytezCom(SimpleHoster): FORM_INPUT_PATTERN = r'<input[^>]* name="([^"]+)" value="([^"]*)">' WAIT_PATTERN = r'<span id="countdown_str">[^>]*>(\d+)</span> seconds</span>' + DIRECT_LINK_PATTERN = r'(http://\w+\.easybytez\.com/files/\d+/\w+/[^"<]+)' + URL_FORM_PATTERN = r'<form name="url"[^>]*action="([^"]+)(.*?)</form>' + OVR_DOWNLOAD_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)' + OVR_KILL_LINK_PATTERN = r'<h2>Delete Link</h2>\s*<textarea[^>]*>([^<]+)' + + def process(self, pyfile): + if not re.match(self.__pattern__, self.pyfile.url): + if self.premium: + self.handleOverriden() + else: + self.fail("Only premium users can download from other hosters with EasyBytes") + else: + self.html = self.load(pyfile.url, cookies = False, decode = True) + self.file_info = self.getFileInfo() + + header = self.load(self.pyfile.url, just_header = True, cookies = True) + self.logDebug(header) + + if 'location' in header and re.match(self.DIRECT_LINK_PATTERN, header['location']): + self.downloadLink(header['location']) + elif self.premium: + self.handlePremium() + else: + self.handleFree() + def handleFree(self): self.download(self.pyfile.url, post = self.getPostParameters(), ref = True, cookies = True) + + def handlePremium(self): + self.html = self.load(self.pyfile.url, post = self.getPostParameters(premium=True)) + found = re.search(self.DIRECT_LINK_PATTERN, self.html) + if not found: self.parseError('DIRECT LINK') + self.downloadLink(found.group(1)) + + def handleOverriden(self): + self.html = self.load('http://www.easybytez.com/') + action, form = re.search(self.URL_FORM_PATTERN, self.html, re.DOTALL).groups() + inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) + action += "%d&js_on=1&utype=prem&upload_type=url" % int(random()*10**12) + inputs['tos'] = '1' + inputs['url_mass'] = self.pyfile.url + + self.html = self.load(action, post = inputs) + found = re.search(self.OVR_DOWNLOAD_LINK_PATTERN, self.html) + if not found: self.parseError('DIRECT LINK (OVR)') + self.downloadLink(found.group(1)) - def getPostParameters(self): + def downloadLink(self, link): + self.logDebug('DIRECT LINK: %s' % link) + self.download(link) + + def getPostParameters(self, premium=False): inputs = dict(re.findall(self.FORM_INPUT_PATTERN, self.html)) self.logDebug(inputs) - inputs['method_free'] = "Free Download" inputs['referer'] = self.pyfile.url - if 'method_premium' in inputs: del inputs['method_premium'] + + if 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 = True, cookies = True) inputs = dict(re.findall(self.FORM_INPUT_PATTERN, self.html)) self.logDebug(inputs) - found = re.search(self.WAIT_PATTERN, self.html) - self.setWait(int(found.group(1)) + 1 if found else 60) - self.wait() + if not premium: + found = re.search(self.WAIT_PATTERN, self.html) + self.setWait(int(found.group(1)) + 1 if found else 60) + self.wait() return inputs diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index 484b48ba6..14180ff3d 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -58,20 +58,20 @@ class MediafireCom(SimpleHoster): __name__ = "MediafireCom" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)*mediafire\.com/[^?].*" - __version__ = "0.70" + __version__ = "0.71" __description__ = """Mediafire.com plugin - free only""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") DOWNLOAD_LINK_PATTERN = r'<div class="download_link"[^>]*z-index:(?P<zindex>\d+)[^>]*>\s*<a href="(?P<href>[^"]+)"' - JS_KEY_PATTERN = r"DoShow\('mfpromo1'\);\s*((\w+)='';.*?)eval\(\2\);" + JS_KEY_PATTERN = r"DoShow\('mfpromo1'\);[^{]*{((\w+)='';.*?)eval\(\2\);" JS_ZMODULO_PATTERN = r"\('z-index'\)\) \% (\d+)\)\);" RECAPTCHA_PATTERN = r'src="http://(?:api.recaptcha.net|www.google.com/recaptcha/api)/challenge\?k=([^"]+)">' PAGE1_ACTION_PATTERN = r'<link rel="canonical" href="([^"]+)"/>' PASSWORD_PATTERN = r";break;}\s*dh\('" FILE_NAME_PATTERN = r'<META NAME="description" CONTENT="(?P<N>[^"]+)"/>' - FILE_SIZE_PATTERN = r'>Download <span>\((?P<S>[0-9.]+) (?P<U>[kKMG])i?B">\)</span>' + FILE_SIZE_PATTERN = r'>Download\s*<span>\((?P<S>[^)]+)\)</span>' FILE_OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>' def process(self, pyfile): -- cgit v1.2.3 From e370517032aeb5f8305d9e0fdc26f643ff30f883 Mon Sep 17 00:00:00 2001 From: zoidberg10 <zoidberg@mujmail.cz> Date: Wed, 4 Jan 2012 17:52:43 +0100 Subject: filesonic pattern fix (thanx Lino24), fix mu life account, closed #463 easybytez --- module/plugins/hoster/CrockoCom.py | 5 ++-- module/plugins/hoster/EasybytezCom.py | 45 ++++++++++++++++++++++++++++------- module/plugins/hoster/FilesonicCom.py | 6 ++--- 3 files changed, 43 insertions(+), 13 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py index 9598025ec..bf058b613 100644 --- a/module/plugins/hoster/CrockoCom.py +++ b/module/plugins/hoster/CrockoCom.py @@ -9,12 +9,13 @@ class CrockoCom(SimpleHoster): __name__ = "CrockoCom" __type__ = "hoster" __pattern__ = r"http://(www\.)?(crocko|easy-share).com/.*" - __version__ = "0.11" + __version__ = "0.12" __description__ = """Crocko Download Hoster""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - FILE_INFO_PATTERN = r'<strong>(?P<N>.*)\s*<span class="tip1"><span class="inner">(?P<S>[0-9,.]+) (?P<U>[kKMG])i?B</span></span>' + FILE_NAME_PATTERN = r'<span class="fz24">Download:\s*<strong>(?P<N>.*)' + FILE_NAME_PATTERN = r'<span class="tip1"><span class="inner">(?P<S>[^<]+)</span></span>' FILE_OFFLINE_PATTERN = r"<h1>Sorry,<br />the page you're looking for <br />isn't here.</h1>" DOWNLOAD_URL_PATTERN = r"window.location ='([^']+)';" CAPTCHA_URL_PATTERN = re.compile(r"u='(/file_contents/captcha/\w+)';\s*w='(\d+)';") diff --git a/module/plugins/hoster/EasybytezCom.py b/module/plugins/hoster/EasybytezCom.py index dac35b1d3..3ee2e9ba5 100644 --- a/module/plugins/hoster/EasybytezCom.py +++ b/module/plugins/hoster/EasybytezCom.py @@ -24,7 +24,7 @@ class EasybytezCom(SimpleHoster): __name__ = "EasybytezCom" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)?easybytez.com/(\w+).*" - __version__ = "0.03" + __version__ = "0.04" __description__ = """easybytez.com""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -33,22 +33,26 @@ class EasybytezCom(SimpleHoster): 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_OFFLINE_PATTERN = r'<h2>File Not Found</h2>' - FORM_INPUT_PATTERN = r'<input[^>]* name="([^"]+)" value="([^"]*)">' + FORM_INPUT_PATTERN = r'<input[^>]* name="([^"]+)"[^>]*value="([^"]*)"' WAIT_PATTERN = r'<span id="countdown_str">[^>]*>(\d+)</span> seconds</span>' DIRECT_LINK_PATTERN = r'(http://\w+\.easybytez\.com/files/\d+/\w+/[^"<]+)' - URL_FORM_PATTERN = r'<form name="url"[^>]*action="([^"]+)(.*?)</form>' + FORM_PATTERN = r'<form name=["\']?%s[^>]*action=["\']?([^"\' ]+)(.*?)</form>' OVR_DOWNLOAD_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)' OVR_KILL_LINK_PATTERN = r'<h2>Delete Link</h2>\s*<textarea[^>]*>([^<]+)' + TEXTAREA_PATTERN = r"<textarea name='([^']+)'>([^<]+)</textarea>" + + HOSTER_URL = "www.easybytez.com" def process(self, pyfile): if not re.match(self.__pattern__, self.pyfile.url): if self.premium: self.handleOverriden() else: - self.fail("Only premium users can download from other hosters with EasyBytes") + self.fail("Only premium users can download from other hosters with %s" % self.HOSTER_URL) else: self.html = self.load(pyfile.url, cookies = False, decode = True) self.file_info = self.getFileInfo() @@ -73,17 +77,36 @@ class EasybytezCom(SimpleHoster): self.downloadLink(found.group(1)) def handleOverriden(self): - self.html = self.load('http://www.easybytez.com/') - action, form = re.search(self.URL_FORM_PATTERN, self.html, re.DOTALL).groups() + self.html = self.load(self.HOSTER_URL) + action, form = re.search(self.FORM_PATTERN % "url", self.html, re.DOTALL).groups() inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) - action += "%d&js_on=1&utype=prem&upload_type=url" % int(random()*10**12) + upload_id = "%012d" % int(random()*10**12) + action += upload_id + "&js_on=1&utype=prem&upload_type=url" inputs['tos'] = '1' inputs['url_mass'] = self.pyfile.url + inputs['up1oad_type'] = 'url' + self.logDebug(action, inputs) self.html = self.load(action, post = inputs) + + found = re.search(self.FORM_PATTERN % "F1", self.html, re.S | re.I) + if not found: + self.logDebug(self.html) + self.fail("upload failed") + action, form = found.groups() + + inputs = dict(re.findall(self.TEXTAREA_PATTERN, form)) + if not inputs: parseError('TEXTAREA') + self.logDebug(inputs) + if inputs['st'] == 'OK': + self.html = self.load(action, post = inputs) + else: + self.fail(inputs['st']) + found = re.search(self.OVR_DOWNLOAD_LINK_PATTERN, self.html) if not found: self.parseError('DIRECT LINK (OVR)') - self.downloadLink(found.group(1)) + self.pyfile.url = found.group(1) + self.retry() def downloadLink(self, link): self.logDebug('DIRECT LINK: %s' % link) @@ -92,6 +115,9 @@ class EasybytezCom(SimpleHoster): def getPostParameters(self, premium=False): inputs = dict(re.findall(self.FORM_INPUT_PATTERN, self.html)) self.logDebug(inputs) + + if 'op' in inputs and inputs['op'] == 'download2': return inputs + inputs['referer'] = self.pyfile.url if premium: @@ -111,5 +137,8 @@ class EasybytezCom(SimpleHoster): self.wait() return inputs + + def urlParseFileName(self): + return html_unescape(urlparse(self.pyfile.url).path.split("/")[-1]) getInfo = create_getInfo(EasybytezCom) \ No newline at end of file diff --git a/module/plugins/hoster/FilesonicCom.py b/module/plugins/hoster/FilesonicCom.py index 813333acb..6094859ef 100644 --- a/module/plugins/hoster/FilesonicCom.py +++ b/module/plugins/hoster/FilesonicCom.py @@ -45,15 +45,15 @@ def getId(url): class FilesonicCom(Hoster): __name__ = "FilesonicCom" __type__ = "hoster" - __pattern__ = r"http://[\w\.]*?(sharingmatrix|filesonic)\..*?/file/(([a-z][0-9]+/)?[0-9]+)(/.*)?" - __version__ = "0.33" + __pattern__ = r"http://[\w\.]*?(sharingmatrix|filesonic)\..*?/file/(([a-z][0-9]+/)?[a-zA-Z0-9\-._+]+)(/.*)?" + __version__ = "0.34" __description__ = """FilesonicCom und Sharingmatrix Download Hoster""" __author_name__ = ("jeix", "paulking") __author_mail__ = ("jeix@hasnomail.de", "") API_ADDRESS = "http://api.filesonic.com" URL_DOMAIN_PATTERN = r'(?P<prefix>.*?)(?P<domain>.(filesonic|sharingmatrix)\..+?)(?P<suffix>/.*)' - FILE_ID_PATTERN = r'/file/(?P<id>([a-z][0-9]+/)?[0-9]+)(/.*)?' #change may break wupload - be careful + FILE_ID_PATTERN = r'/file/(?P<id>([a-z][0-9]+/)?[a-zA-Z0-9\-._+]+)(/.*)?' #change may break wupload - be careful FILE_LINK_PATTERN = r'<p><a href="(http://.+?\.(filesonic|sharingmatrix)\..+?)"><span>Start download' WAIT_TIME_PATTERN = r'countDownDelay = (?P<wait>\d+)' WAIT_TM_PATTERN = r"name='tm' value='(.*?)' />" -- cgit v1.2.3 From 0047cf8d757eb9866b53164b26e89c9b102d2a60 Mon Sep 17 00:00:00 2001 From: zoidberg10 <zoidberg@mujmail.cz> Date: Sat, 7 Jan 2012 23:28:39 +0100 Subject: xfilesharingpro - fix patterns --- module/plugins/hoster/EasybytezCom.py | 4 ++-- module/plugins/hoster/TurbouploadCom.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/EasybytezCom.py b/module/plugins/hoster/EasybytezCom.py index 3ee2e9ba5..4c1c885a7 100644 --- a/module/plugins/hoster/EasybytezCom.py +++ b/module/plugins/hoster/EasybytezCom.py @@ -23,8 +23,8 @@ from random import random class EasybytezCom(SimpleHoster): __name__ = "EasybytezCom" __type__ = "hoster" - __pattern__ = r"http://(?:\w*\.)?easybytez.com/(\w+).*" - __version__ = "0.04" + __pattern__ = r"http://(?:\w*\.)?easybytez.com/(\w{6,}).*" + __version__ = "0.05" __description__ = """easybytez.com""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") diff --git a/module/plugins/hoster/TurbouploadCom.py b/module/plugins/hoster/TurbouploadCom.py index 59939d3c7..5fd81fb69 100644 --- a/module/plugins/hoster/TurbouploadCom.py +++ b/module/plugins/hoster/TurbouploadCom.py @@ -23,8 +23,8 @@ from module.plugins.hoster.EasybytezCom import EasybytezCom class TurbouploadCom(EasybytezCom): __name__ = "TurbouploadCom" __type__ = "hoster" - __pattern__ = r"http://(?:\w*\.)?turboupload.com/(\w+).*" - __version__ = "0.01" + __pattern__ = r"http://(?:\w*\.)?turboupload.com/(\w{6,}).*" + __version__ = "0.02" __description__ = """turboupload.com""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") -- cgit v1.2.3 From bac28b7740aae772636d8b90e291d9c17dfd59a7 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sun, 8 Jan 2012 14:44:59 +0100 Subject: new MultiHoster hook --- module/plugins/hoster/RealdebridCom.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 62c09aaa8..376ae3414 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -8,12 +8,11 @@ from random import randrange from module.plugins.Hoster import Hoster class RealdebridCom(Hoster): - __name__ = "RealdebridCom" __version__ = "0.41" - __type__ = "hoster" - __pattern__ = r"https?://.*real-debrid\..*" __description__ = """Real-Debrid.com hoster plugin""" + __config__ = [("https", "bool", _("Enable HTTPS"), False)] + __author_name__ = ("Devirex, Hazzard") __author_mail__ = ("naibaf_11@yahoo.de") -- cgit v1.2.3 From c7ad1cc5b4a5d190a060e3ddd9274c3065da6708 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Fri, 13 Jan 2012 23:24:21 +0100 Subject: plugin unit test, closed #499, #500 --- module/plugins/hoster/FilesMailRu.py | 3 +-- module/plugins/hoster/HotfileCom.py | 3 +-- module/plugins/hoster/NetloadIn.py | 4 +--- module/plugins/hoster/ShareonlineBiz.py | 4 +--- module/plugins/hoster/UploadedTo.py | 3 +-- 5 files changed, 5 insertions(+), 12 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/FilesMailRu.py b/module/plugins/hoster/FilesMailRu.py index 6002ab3dc..1284329b5 100644 --- a/module/plugins/hoster/FilesMailRu.py +++ b/module/plugins/hoster/FilesMailRu.py @@ -2,9 +2,8 @@ # -*- coding: utf-8 -*- import re -from module.plugins.Hoster import Hoster +from module.plugins.Hoster import Hoster, chunks from module.network.RequestFactory import getURL -from module.plugins.Plugin import chunks def getInfo(urls): result = [] diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py index 9c056d899..d36a4df2e 100644 --- a/module/plugins/hoster/HotfileCom.py +++ b/module/plugins/hoster/HotfileCom.py @@ -2,11 +2,10 @@ # -*- coding: utf-8 -*- import re -from module.plugins.Hoster import Hoster +from module.plugins.Hoster import Hoster, chunks from module.plugins.ReCaptcha import ReCaptcha from module.network.RequestFactory import getURL -from module.plugins.Plugin import chunks def getInfo(urls): api_url_base = "http://api.hotfile.com/" diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index b2bec873d..382328496 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -5,11 +5,9 @@ import re from time import sleep, time +from module.utils import chunks from module.plugins.Hoster import Hoster from module.network.RequestFactory import getURL -from module.plugins.Plugin import chunks - - def getInfo(urls): ## returns list of tupels (name, size (in bytes), status (see FileDatabase), url) diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 641a9b025..2d1fc8d85 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -7,10 +7,8 @@ import hashlib import random from time import sleep -from module.plugins.Hoster import Hoster +from module.plugins.Hoster import Hoster, chunks from module.network.RequestFactory import getURL -from module.plugins.Plugin import chunks - def getInfo(urls): api_url_base = "http://api.share-online.biz/linkcheck.php" diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 39483cf86..751dcda25 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -2,11 +2,10 @@ import re -from module.utils import html_unescape, parseFileSize +from module.utils import html_unescape, parseFileSize, chunks from module.plugins.Hoster import Hoster from module.network.RequestFactory import getURL -from module.plugins.Plugin import chunks from module.plugins.ReCaptcha import ReCaptcha key = "bGhGMkllZXByd2VEZnU5Y2NXbHhYVlZ5cEE1bkEzRUw=".decode('base64') -- cgit v1.2.3 From 17b3595dc5db8b3270e6bcd07176ed4b7b47930a Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sun, 15 Jan 2012 19:28:12 +0100 Subject: improved handling of content-disposition --- module/plugins/hoster/BasePlugin.py | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 2de47940d..7b204b90d 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -62,28 +62,5 @@ class BasePlugin(Hoster): def downloadFile(self, pyfile): - header = self.load(pyfile.url, just_header = True) - #self.logDebug(header) - - if 'location' in header: - self.logDebug("Location: " + header['location']) - url = unquote(header['location']) - else: - url = pyfile.url - - name = html_unescape(urlparse(url).path.split("/")[-1]) - - if 'content-disposition' in header: - self.logDebug("Content-Disposition: " + header['content-disposition']) - m = search("filename(?P<type>=|\*=(?P<enc>.+)'')(?P<name>.*)", header['content-disposition']) - if m: - disp = m.groupdict() - self.logDebug(disp) - if not disp['enc']: disp['enc'] = 'utf-8' - name = remove_chars(disp['name'], "\"';").strip() - name = unicode(unquote(name), disp['enc']) - - if not name: name = url - pyfile.name = name - self.logDebug("Filename: %s" % pyfile.name) - self.download(url, disposition=True) \ No newline at end of file + pyfile.name = html_unescape(urlparse(pyfile.url).path.split("/")[-1]) + self.download(pyfile.url, disposition=True) \ No newline at end of file -- cgit v1.2.3 From 247ae6fbec98dbc42c3910df2942842ef5256715 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sun, 15 Jan 2012 21:17:23 +0100 Subject: fix test cases --- module/plugins/hoster/BasePlugin.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 7b204b90d..0e9595265 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -1,12 +1,10 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- from urlparse import urlparse -from re import search -from urllib import unquote from module.network.HTTPRequest import BadHeader from module.plugins.Hoster import Hoster -from module.utils import html_unescape, remove_chars +from module.utils import html_unescape class BasePlugin(Hoster): __name__ = "BasePlugin" @@ -63,4 +61,4 @@ class BasePlugin(Hoster): def downloadFile(self, pyfile): pyfile.name = html_unescape(urlparse(pyfile.url).path.split("/")[-1]) - self.download(pyfile.url, disposition=True) \ No newline at end of file + self.download(pyfile.url, disposition=True) -- cgit v1.2.3 From a72688b208ed4ba3e98234e995f7bc1eb4afec42 Mon Sep 17 00:00:00 2001 From: zoidberg10 <zoidberg@mujmail.cz> Date: Mon, 16 Jan 2012 20:44:19 +0100 Subject: merge in plugin updates --- module/plugins/hoster/BezvadataCz.py | 4 +- module/plugins/hoster/EasybytezCom.py | 4 +- module/plugins/hoster/EuroshareEu.py | 2 +- module/plugins/hoster/FilepostCom.py | 105 +++++++++++------- module/plugins/hoster/FilesonicCom.py | 15 +-- module/plugins/hoster/FourSharedCom.py | 4 +- module/plugins/hoster/HotfileCom.py | 9 +- module/plugins/hoster/LetitbitNet.py | 64 +++++------ module/plugins/hoster/MediafireCom.py | 59 ++++++---- module/plugins/hoster/MegauploadCom.py | 11 +- module/plugins/hoster/MultishareCz.py | 14 +-- module/plugins/hoster/OneFichierCom.py | 130 +++++----------------- module/plugins/hoster/Premium4Me.py | 58 ++++++++++ module/plugins/hoster/UlozTo.py | 192 ++++++++++++++++----------------- module/plugins/hoster/WuploadCom.py | 7 +- 15 files changed, 349 insertions(+), 329 deletions(-) create mode 100644 module/plugins/hoster/Premium4Me.py (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py index f061fa2b5..a0717ad64 100644 --- a/module/plugins/hoster/BezvadataCz.py +++ b/module/plugins/hoster/BezvadataCz.py @@ -23,13 +23,13 @@ class BezvadataCz(SimpleHoster): __name__ = "BezvadataCz" __type__ = "hoster" __pattern__ = r"http://(\w*\.)*bezvadata.cz/stahnout/.*" - __version__ = "0.22" + __version__ = "0.23" __description__ = """BezvaData.cz""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") FILE_NAME_PATTERN = r'<p><b>Soubor: (?P<N>[^<]+)</b></p>' - FILE_SIZE_PATTERN = r'<li><strong>Velikost:</strong> (?P<S>[0-9.]+) (?P<U>[kKMG])i?)</li>' + FILE_SIZE_PATTERN = r'<li><strong>Velikost:</strong> (?P<S>[^<]+)</li>' FILE_OFFLINE_PATTERN = r'<title>BezvaData \| Soubor nenalezen</title>' DOWNLOAD_FORM_PATTERN = r'<form class="download" action="([^"]+)" method="post" id="frm-stahnoutForm">' diff --git a/module/plugins/hoster/EasybytezCom.py b/module/plugins/hoster/EasybytezCom.py index 4c1c885a7..0b46acb83 100644 --- a/module/plugins/hoster/EasybytezCom.py +++ b/module/plugins/hoster/EasybytezCom.py @@ -24,7 +24,7 @@ class EasybytezCom(SimpleHoster): __name__ = "EasybytezCom" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)?easybytez.com/(\w{6,}).*" - __version__ = "0.05" + __version__ = "0.06" __description__ = """easybytez.com""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -38,7 +38,7 @@ class EasybytezCom(SimpleHoster): FORM_INPUT_PATTERN = r'<input[^>]* name="([^"]+)"[^>]*value="([^"]*)"' WAIT_PATTERN = r'<span id="countdown_str">[^>]*>(\d+)</span> seconds</span>' - DIRECT_LINK_PATTERN = r'(http://\w+\.easybytez\.com/files/\d+/\w+/[^"<]+)' + DIRECT_LINK_PATTERN = r'(http://(\w+\.easybytez\.com|\d+\.\d+\.\d+\.\d+)/files/\d+/\w+/[^"<]+)' FORM_PATTERN = r'<form name=["\']?%s[^>]*action=["\']?([^"\' ]+)(.*?)</form>' OVR_DOWNLOAD_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)' diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py index a0bfe0ab2..1e1cc0b4b 100644 --- a/module/plugins/hoster/EuroshareEu.py +++ b/module/plugins/hoster/EuroshareEu.py @@ -37,7 +37,7 @@ class EuroshareEu(Hoster): __name__ = "EuroshareEu" __type__ = "hoster" __pattern__ = r"http://(\w*\.)?euroshare.eu/file/.*" - __version__ = "0.2b" + __version__ = "0.30" __description__ = """Euroshare.eu""" __author_name__ = ("zoidberg") diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py index 42ec0788b..d12fad738 100644 --- a/module/plugins/hoster/FilepostCom.py +++ b/module/plugins/hoster/FilepostCom.py @@ -18,7 +18,6 @@ import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.network.RequestFactory import getURL from module.plugins.ReCaptcha import ReCaptcha from module.common.json_layer import json_loads from time import time @@ -26,16 +25,17 @@ from time import time class FilepostCom(SimpleHoster): __name__ = "FilepostCom" __type__ = "hoster" - __pattern__ = r"https?://(?:www\.)?filepost\.com/files/([^/]+).*" - __version__ = "0.23" + __pattern__ = r"https?://(?:www\.)?(?:filepost\.com/files|fp.io)/([^/]+).*" + __version__ = "0.25" __description__ = """Filepost.com plugin - free only""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - FILE_INFO_PATTERN = r'<h1>(?P<N>[^<]+)</h1>\s*<div class="ul">\s*<ul>\s*<li><span>Size:</span> (?P<S>[0-9.]+) (?P<U>[kKMG])i?B</li>' + FILE_INFO_PATTERN = r'<input type="text" id="url" value=\'<a href[^>]*>(?P<N>[^>]+?) - (?P<S>[0-9\.]+ [kKMG]i?B)</a>\' class="inp_text"/>' + #FILE_INFO_PATTERN = r'<h1>(?P<N>[^<]+)</h1>\s*<div class="ul">\s*<ul>\s*<li><span>Size:</span> (?P<S>[0-9.]+) (?P<U>[kKMG])i?B</li>' FILE_OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>' RECAPTCHA_KEY_PATTERN = r"Captcha.init\({\s*key:\s*'([^']+)'" - FLP_TOKEN_PATTERN = r"store.set\('(?:flp_)?token', '([^']+)'\);" + FLP_TOKEN_PATTERN = r"set_store_options\({token: '([^']+)'" def handleFree(self): # Find token and captcha key @@ -49,42 +49,71 @@ class FilepostCom(SimpleHoster): if not found: self.parseError("Captcha key") captcha_key = found.group(1) - url = 'https://filepost.com/files/get/' - # Get wait time get_dict = {'SID' : self.req.cj.getCookie('SID'), 'JsHttpRequest' : str(int(time()*10000)) + '-xml'} - post_dict = {'action' : 'set_download', 'download' : flp_token, 'code' : file_id} - json_response = json_loads(self.load(url, get = get_dict, post = post_dict)) - self.logDebug(json_response) - try: - self.setWait(int(json_response['js']['answer']['wait_time'])) - except Exception, e: - self.logError(e) - self.self.parseError("Wait time") - self.wait() - - # Solve recaptcha - recaptcha = ReCaptcha(self) - for i in range(5): - captcha_challenge, captcha_response = recaptcha.challenge(captcha_key) - self.logDebug("RECAPTCHA: %s : %s : %s" % (captcha_key, captcha_challenge, captcha_response)) - - get_dict['JsHttpRequest'] = str(int(time()*10000)) + '-xml' - post_dict = {'download' : flp_token, 'code' : file_id, - "recaptcha_challenge_field" : captcha_challenge, - "recaptcha_response_field" : captcha_response - } - - json_response = json_loads(self.load(url, get = get_dict, post = post_dict)) - try: - download_url = json_response['js']['answer']['link'] - self.correctCaptcha() - break - except: - self.invalidCaptcha() - else: self.fail("Invalid captcha") + post_dict = {'action' : 'set_download', 'token' : flp_token, 'code' : file_id} + wait_time = int(self.getJsonResponse(get_dict, post_dict, 'wait_time')) + if wait_time > 0: + self.setWait(wait_time) + self.wait() + + post_dict = {"token" : flp_token, "code" : file_id, "file_pass" : ''} + + if 'var is_pass_exists = true;' in self.html: + # Solve password + for file_pass in self.getPassword().splitlines(): + get_dict['JsHttpRequest'] = str(int(time()*10000)) + '-xml' + post_dict['file_pass'] = file_pass + self.logInfo("Password protected link, trying " + file_pass) + + download_url = self.getJsonResponse(get_dict, post_dict, 'link') + if download_url: + break + + else: self.fail("No or incorrect password") + + else: + # Solve recaptcha + recaptcha = ReCaptcha(self) + + for pokus in range(5): + get_dict['JsHttpRequest'] = str(int(time()*10000)) + '-xml' + if pokus: + post_dict["recaptcha_challenge_field"], post_dict["captcha_response_field"] = recaptcha.challenge(captcha_key) + self.logDebug(u"RECAPTCHA: %s : %s : %s" % (captcha_key, post_dict["recaptcha_challenge_field"], post_dict["captcha_response_field"])) + + download_url = self.getJsonResponse(get_dict, post_dict, 'link') + if download_url: + if pokus: self.correctCaptcha() + break + elif pokus: + self.invalidCaptcha() + + else: self.fail("Invalid captcha") + # Download - self.download(download_url) + self.download(download_url) + + def getJsonResponse(self, get_dict, post_dict, field): + json_response = json_loads(self.load('https://filepost.com/files/get/', get = get_dict, post = post_dict)) + self.logDebug(json_response) + + if not 'js' in json_response: self.parseError('JSON %s 1' % field) + + if 'error' in json_response['js']: + if json_response['js']['error'] == 'download_delay': + self.retry(js_answer['params']['next_download']) + elif 'Wrong file password' in json_response['js']['error']: + return None + elif 'You entered a wrong CAPTCHA code' in json_response['js']['error']: + return None + else: + self.fail(js_answer['error']) + + if not 'answer' in json_response['js'] or not field in json_response['js']['answer']: + self.parseError('JSON %s 2' % field) + + return json_response['js']['answer'][field] getInfo = create_getInfo(FilepostCom) \ No newline at end of file diff --git a/module/plugins/hoster/FilesonicCom.py b/module/plugins/hoster/FilesonicCom.py index 6094859ef..f0fbab1d9 100644 --- a/module/plugins/hoster/FilesonicCom.py +++ b/module/plugins/hoster/FilesonicCom.py @@ -3,10 +3,11 @@ import re import string +from urllib import unquote from module.plugins.Hoster import Hoster from module.plugins.ReCaptcha import ReCaptcha -from module.plugins.Plugin import chunks +from module.utils import chunks from module.network.RequestFactory import getURL from module.common.json_layer import json_loads @@ -28,9 +29,9 @@ def getInfo(urls): response = json_loads(getURL(check_url, decode=True)) for item in response["FSApi_Link"]["getInfo"]["response"]["links"]: if item["status"] != "AVAILABLE": - result.append((None, 0, 1, ids[str(item["id"])])) + result.append((ids[str(item["id"])], 0, 1, ids[str(item["id"])])) else: - result.append((item["filename"], item["size"], 2, ids[str(item["id"])])) + result.append((unquote(item["filename"]), item["size"], 2, ids[str(item["id"])])) yield result @@ -45,8 +46,8 @@ def getId(url): class FilesonicCom(Hoster): __name__ = "FilesonicCom" __type__ = "hoster" - __pattern__ = r"http://[\w\.]*?(sharingmatrix|filesonic)\..*?/file/(([a-z][0-9]+/)?[a-zA-Z0-9\-._+]+)(/.*)?" - __version__ = "0.34" + __pattern__ = r"http://[\w\.]*?(sharingmatrix|filesonic)\..*?/.*?file/([a-zA-Z0-9]+(/.+)?|[a-z0-9]+/[0-9]+(/.+)?|[0-9]+(/.+)?)" + __version__ = "0.35" __description__ = """FilesonicCom und Sharingmatrix Download Hoster""" __author_name__ = ("jeix", "paulking") __author_mail__ = ("jeix@hasnomail.de", "") @@ -54,7 +55,7 @@ class FilesonicCom(Hoster): API_ADDRESS = "http://api.filesonic.com" URL_DOMAIN_PATTERN = r'(?P<prefix>.*?)(?P<domain>.(filesonic|sharingmatrix)\..+?)(?P<suffix>/.*)' FILE_ID_PATTERN = r'/file/(?P<id>([a-z][0-9]+/)?[a-zA-Z0-9\-._+]+)(/.*)?' #change may break wupload - be careful - FILE_LINK_PATTERN = r'<p><a href="(http://.+?\.(filesonic|sharingmatrix)\..+?)"><span>Start download' + FILE_LINK_PATTERN = r'Your download is ready</p>\s*<a href="(http://[^"]+)' WAIT_TIME_PATTERN = r'countDownDelay = (?P<wait>\d+)' WAIT_TM_PATTERN = r"name='tm' value='(.*?)' />" WAIT_TM_HASH_PATTERN = r"name='tm_hash' value='(.*?)' />" @@ -97,7 +98,7 @@ class FilesonicCom(Hoster): #if item["is_premium_only"] != 0 and not self.premium: # self.fail("need premium account for file") - self.pyfile.name = item["filename"] + self.pyfile.name = unquote(item["filename"]) # Fix the url and resolve the domain to the correct regional variation url = item["url"] diff --git a/module/plugins/hoster/FourSharedCom.py b/module/plugins/hoster/FourSharedCom.py index b1cc252e2..2b27eed28 100644 --- a/module/plugins/hoster/FourSharedCom.py +++ b/module/plugins/hoster/FourSharedCom.py @@ -8,7 +8,7 @@ class FourSharedCom(SimpleHoster): __name__ = "FourSharedCom" __type__ = "hoster" __pattern__ = r"http://[\w\.]*?4shared(-china)?\.com/(account/)?(download|get|file|document|photo|video|audio)/.+?/.*" - __version__ = "0.24" + __version__ = "0.25" __description__ = """4Shared Download Hoster""" __author_name__ = ("jeix", "zoidberg") __author_mail__ = ("jeix@hasnomail.de", "zoidberg@mujmail.cz") @@ -19,7 +19,7 @@ class FourSharedCom(SimpleHoster): FILE_NAME_REPLACEMENTS = [(r"&#(\d+).", lambda m: unichr(int(m.group(1))))] DOWNLOAD_BUTTON_PATTERN = '<a href="([^"]+)"\s*class="dbtn' - DOWNLOAD_URL_PATTERN = "<div class=\"(?:dl|xxlarge bold)\">\s*<a href='([^']+)'" + DOWNLOAD_URL_PATTERN = r"<a class=\"linkShowD3\" href='([^']+)'>Download file now</a>" def handleFree(self): found = re.search(self.DOWNLOAD_BUTTON_PATTERN, self.html) diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py index d36a4df2e..1447e7c9e 100644 --- a/module/plugins/hoster/HotfileCom.py +++ b/module/plugins/hoster/HotfileCom.py @@ -2,10 +2,11 @@ # -*- coding: utf-8 -*- import re -from module.plugins.Hoster import Hoster, chunks +from module.plugins.Hoster import Hoster from module.plugins.ReCaptcha import ReCaptcha from module.network.RequestFactory import getURL +from module.plugins.Plugin import chunks def getInfo(urls): api_url_base = "http://api.hotfile.com/" @@ -31,7 +32,7 @@ class HotfileCom(Hoster): __name__ = "HotfileCom" __type__ = "hoster" __pattern__ = r"http://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+/" - __version__ = "0.31" + __version__ = "0.32" __description__ = """Hotfile.com Download Hoster""" __author_name__ = ("sitacuisses","spoob","mkaay") __author_mail__ = ("sitacuisses@yhoo.de","spoob@pyload.org","mkaay@mkaay.de") @@ -56,7 +57,7 @@ class HotfileCom(Hoster): elif self.account and login: return self.account.apiCall(method, post, self.user) post.update({"action": method}) - return self.load("http://api.hotfile.com/", post=post) + return self.load("http://api.hotfile.com/", post=post, decode=True) def process(self, pyfile): self.wantReconnect = False @@ -99,7 +100,7 @@ class HotfileCom(Hoster): self.fail("Form not found in HTML. Can not proceed.") form_content = form_content.group(0) - form_posts = re.findall(r"<input\stype=hidden\sname=(\S*)\svalue=(\S*)>", form_content) + form_posts = dict(re.findall(r"<input\stype=hidden\sname=(\S*)\svalue=(\S*)>", form_content)) self.html[1] = self.load(self.pyfile.url, post=form_posts) diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py index 8ac4b8f7f..4ff2b9750 100644 --- a/module/plugins/hoster/LetitbitNet.py +++ b/module/plugins/hoster/LetitbitNet.py @@ -17,56 +17,41 @@ """ import re +from random import random from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class LetitbitNet(SimpleHoster): __name__ = "LetitbitNet" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)*letitbit.net/download/.*" - __version__ = "0.12" + __version__ = "0.13" __description__ = """letitbit.net""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - FORM_PATTERN = r'<form%s action="([^"]+)" method="post"%s>(.*?)</form>' - FORM_INPUT_PATTERN = r'<input[^>]* name="([^"]+)" value="([^"]+)" />' - CHECK_URL_PATTERN = r"ajax_check_url\s*=\s*'([^']+)';" + CHECK_URL_PATTERN = r"ajax_check_url\s*=\s*'((http://[^/]+)[^']+)';" SECONDS_PATTERN = r"seconds\s*=\s*(\d+);" - FILE_INFO_PATTERN = r'<h1[^>]*>File: <a[^>]*><span>(?P<N>[^<]+)</span></a> [<span>(?P<S>[0-9.]+)\s*(?P<U>[kKMG])i?[Bb]</span>]</h1>' + FILE_INFO_PATTERN = r'<h1[^>]*>File: <a[^>]*><span>(?P<N>[^<]+)</span></a>\s*\[<span>(?P<S>[^<]+)</span>]</h1>' FILE_OFFLINE_PATTERN = r'<div id="download_content" class="hide-block">[^<]*<br>File not found<br /></div>' - def setup(self): - self.resumeDownload = self.multiDL = True if self.account else False - self.chunkLimit = 1 + def handleFree(self): + action, inputs = self.parseHtmlForm('id="ifree_form"') + if not action: self.parseError("page 1 / ifree_form") + self.pyfile.size = float(inputs['sssize']) + #self.logDebug(action, inputs) + inputs['desc'] = "" - def process(self, pyfile): - self.html = self.load(pyfile.url, decode=True) - if re.search(self.FILE_OFFLINE_PATTERN, self.html): self.offline() + self.html = self.load("http://letitbit.net" + action, post = inputs, cookies = True) - try: - action, form = re.search(self.FORM_PATTERN % (' id="ifree_form"', ''), self.html, re.DOTALL).groups() - inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) - pyfile.name = inputs['name'] - pyfile.size = float(inputs['sssize'])/1024 - except Exception, e: - self.logError(e) - self.parseError("page 1 / ifree_form") + action, inputs = self.parseHtmlForm('id="d3_form"') + if not action: self.parseError("page 2 / d3_form") + #self.logDebug(action, inputs) - #self.logDebug(inputs) - inputs['desc'] = "" - self.html = self.load("http://letitbit.net" + action, post = inputs) - - try: - action, form = re.search(self.FORM_PATTERN % ('', ' id="d3_form"'), self.html, re.DOTALL).groups() - inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) - except Exception, e: - self.logError(e) - self.parseError("page 2 / d3_form") + self.html = self.load(action, post = inputs, cookies = True) - self.html = self.load(action, post = inputs) try: - ajax_check_url = re.search(self.CHECK_URL_PATTERN, self.html).group(1) + ajax_check_url, captcha_url = re.search(self.CHECK_URL_PATTERN, self.html).groups() found = re.search(self.SECONDS_PATTERN, self.html) seconds = int(found.group(1)) if found else 60 self.setWait(seconds+1) @@ -75,7 +60,22 @@ class LetitbitNet(SimpleHoster): self.logError(e) self.parseError("page 3 / js") - download_url = self.load(ajax_check_url, post = inputs) + response = self.load(ajax_check_url, post = inputs, cookies = True) + if response != '1': self.fail('Unknown response (ajax_check_url)') + + for i in range(5): + captcha = self.decryptCaptcha('%s/captcha_new.php?rand=%d' % (captcha_url, random() * 100000), cookies = True) + response = self.load(captcha_url + '/ajax/check_captcha.php', post = {"code": captcha}, cookies = True) + self.logDebug(response) + if response.startswith('http://'): + download_url = response + self.correctCaptcha() + break + else: + self.invalidCaptcha() + else: + self.fail("No valid captcha solution received") + self.download(download_url) getInfo = create_getInfo(LetitbitNet) \ No newline at end of file diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index 14180ff3d..f40071478 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -58,21 +58,24 @@ class MediafireCom(SimpleHoster): __name__ = "MediafireCom" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)*mediafire\.com/[^?].*" - __version__ = "0.71" + __version__ = "0.73" __description__ = """Mediafire.com plugin - free only""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - DOWNLOAD_LINK_PATTERN = r'<div class="download_link"[^>]*z-index:(?P<zindex>\d+)[^>]*>\s*<a href="(?P<href>[^"]+)"' + DOWNLOAD_LINK_PATTERN = r'<div class="download_link"[^>]*(?:z-index:(?P<zindex>\d+))?[^>]*>\s*<a href="(?P<href>http://[^"]+)"' JS_KEY_PATTERN = r"DoShow\('mfpromo1'\);[^{]*{((\w+)='';.*?)eval\(\2\);" JS_ZMODULO_PATTERN = r"\('z-index'\)\) \% (\d+)\)\);" RECAPTCHA_PATTERN = r'src="http://(?:api.recaptcha.net|www.google.com/recaptcha/api)/challenge\?k=([^"]+)">' PAGE1_ACTION_PATTERN = r'<link rel="canonical" href="([^"]+)"/>' - PASSWORD_PATTERN = r";break;}\s*dh\('" + PASSWORD_PATTERN = r'<form name="form_password"' FILE_NAME_PATTERN = r'<META NAME="description" CONTENT="(?P<N>[^"]+)"/>' FILE_SIZE_PATTERN = r'>Download\s*<span>\((?P<S>[^)]+)\)</span>' FILE_OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>' + + def setup(self): + self.multiDL = True def process(self, pyfile): self.url, result = checkHTMLHeader(pyfile.url) @@ -92,8 +95,8 @@ class MediafireCom(SimpleHoster): self.download(self.url, disposition = True) def handleFree(self): - passwords = self.getPassword().split() - while re.search(self.PASSWORD_PATTERN, self.html): + passwords = self.getPassword().splitlines() + while self.PASSWORD_PATTERN in self.html: if len(passwords): password = passwords.pop(0) self.logInfo("Password protected link, trying " + password) @@ -101,25 +104,35 @@ class MediafireCom(SimpleHoster): else: self.fail("No or incorrect password") - found = re.search(self.JS_KEY_PATTERN, self.html) - try: - result = self.js.eval(found.group(1)) - zmodulo = int(re.search(self.JS_ZMODULO_PATTERN, result).group(1)) - self.logDebug("ZMODULO: %d" % zmodulo) - except Exception, e: - self.logDebug(e) - self.retry(3, 0, "Parse error (MODULO)") + links = re.findall(self.DOWNLOAD_LINK_PATTERN, self.html) + link_count = len(links) + self.logDebug('LINKS ', links) - vlink = {'zindex': 0, 'href': ''} - for found in re.finditer(self.DOWNLOAD_LINK_PATTERN, self.html): - dlink = found.groupdict() - #self.logDebug(dlink) - dlink['zindex'] = int(dlink['zindex']) % zmodulo - if dlink['zindex'] >= vlink['zindex']: - vlink = dlink - - self.logDebug("DOWNLOAD LINK:", vlink) - self.download(vlink['href']) + if link_count == 0: + self.retry(3, 0, "No links found") + + elif link_count > 1: + found = re.search(self.JS_KEY_PATTERN, self.html) + try: + result = self.js.eval(found.group(1)) + zmodulo = int(re.search(self.JS_ZMODULO_PATTERN, result).group(1)) + self.logDebug("ZMODULO: %d" % zmodulo) + except Exception, e: + self.logDebug(e) + self.parseError("ZMODULO") + + max_index = 0 + for index, url in links: + index = int(index) % zmodulo + if index >= max_index: + download_url = url + + self.logDebug("DOWNLOAD LINK:", download_url) + + else: + zindex, download_url = links[0] + + self.download(download_url) def checkCaptcha(self): for i in range(5): diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py index 100553ebf..81d528668 100644 --- a/module/plugins/hoster/MegauploadCom.py +++ b/module/plugins/hoster/MegauploadCom.py @@ -65,7 +65,7 @@ class MegauploadCom(Hoster): __name__ = "MegauploadCom" __type__ = "hoster" __pattern__ = r"http://[\w\.]*?(megaupload)\.com/.*?(\?|&)d=(?P<id>[0-9A-Za-z]+)" - __version__ = "0.28" + __version__ = "0.31" __description__ = """Megaupload.com Download Hoster""" __author_name__ = ("spoob") __author_mail__ = ("spoob@pyload.org") @@ -74,6 +74,7 @@ class MegauploadCom(Hoster): API_STATUS_MAPPING = {"0": statusMap['online'], "1": statusMap['offline'], "3": statusMap['temp. offline']} FILE_URL_PATTERN = r'<a href="([^"]+)" class="download_regular_usual"' + PREMIUM_URL_PATTERN = r'href=\"(http://[^\"]*?)\" class=\"download_premium_but\">' def init(self): self.html = [None, None] @@ -125,12 +126,12 @@ class MegauploadCom(Hoster): if e.args and e.args[0] == 33: # undirect download and resume , not a good idea page = self.load(pyfile.url) - self.download(re.search(r'href=\"(http://[^\"]*?)\" class=\"down_ad_butt1\">', page).group(1)) + self.download(re.search(self.PREMIUM_URL_PATTERN, page).group(1)) return else: raise - check = self.checkDownload({"dllink": re.compile(r'href=\"(http://[^\"]*?)\" class=\"down_ad_butt1\">')}) + check = self.checkDownload({"dllink": re.compile(self.PREMIUM_URL_PATTERN)}) if check == "dllink": self.log.warning(_("You should enable direct Download in your Megaupload Account settings")) @@ -171,7 +172,7 @@ class MegauploadCom(Hoster): if "The file that you're trying to download is larger than 1 GB" in self.html[0]: self.fail(_("You need premium to download files larger than 1 GB")) - if r'Please enter the password below' in self.html[0]: + if re.search(r'<input[^>]*name="filepassword"', self.html[0]): pw = self.getPassword() if not pw: self.fail(_("The file is password protected, enter a password and restart.")) @@ -270,4 +271,4 @@ class MegauploadCom(Hoster): if re.search("The password you have entered is not correct", self.html[1]): self.fail(_("Wrong password for download link.")) - return True \ No newline at end of file + return True diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index a0dda30b8..af7aa94cf 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -24,7 +24,7 @@ class MultishareCz(SimpleHoster): __name__ = "MultishareCz" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)?multishare.cz/stahnout/(?P<ID>\d+).*" - __version__ = "0.34" + __version__ = "0.40" __description__ = """MultiShare.cz""" __author_name__ = ("zoidberg") @@ -50,11 +50,12 @@ class MultishareCz(SimpleHoster): self.download("http://www.multishare.cz/html/download_free.php?ID=%s" % self.fileID) def handlePremium(self): - if not self.checkCredit(): + if not self.checkTrafficLeft(): self.logWarning("Not enough credit left to download file") self.resetAccount() self.download("http://www.multishare.cz/html/download_premium.php?ID=%s" % self.fileID) + self.checkTrafficLeft() def handleOverriden(self): if not self.premium: @@ -63,18 +64,13 @@ class MultishareCz(SimpleHoster): self.html = self.load('http://www.multishare.cz/html/mms_ajax.php', post = {"link": self.pyfile.url}, decode = True) self.getFileInfo() - if not self.checkCredit(): + if not self.checkTrafficLeft(): self.fail("Not enough credit left to download file") url = "http://dl%d.mms.multishare.cz/html/mms_process.php" % round(random()*10000*random()) params = {"u_ID" : self.acc_info["u_ID"], "u_hash" : self.acc_info["u_hash"], "link" : self.pyfile.url} self.logDebug(url, params) self.download(url, get = params) - - def checkCredit(self): - self.acc_info = self.account.getAccountInfo(self.user, True) - self.logInfo("User %s has %i MB left" % (self.user, self.acc_info["trafficleft"]/1024)) - - return self.pyfile.size / 1024 <= self.acc_info["trafficleft"] + self.checkTrafficLeft() getInfo = create_getInfo(MultishareCz) \ No newline at end of file diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 3343c7c8c..16401891b 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -1,80 +1,29 @@ # -*- coding: utf-8 -*- import re +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.plugins.Hoster import Hoster -from module.network.RequestFactory import getURL - - -def getInfo(urls): - result = [] - - for url in urls: - - # Get file info html - id = re.match(OneFichierCom.__pattern__, url).group('id') - url = 'http://%s.1fichier.com/en' % id # Force response in english - html = getURL(url) - - # Offline? - if re.search(OneFichierCom.FILE_OFFLINE_PATTERN, html): - result.append((url, 0, 1, url)) - continue - - # Name - for pattern in OneFichierCom.FILE_NAME_PATTERNS: - m = re.search(pattern, html) - if m is not None: - name = m.group('name').strip() - - # Size - m = re.search(OneFichierCom.FILE_SIZE_PATTERN, html) - value = float(m.group('size')) - units = m.group('units')[0].upper() - pow = {'K' : 1, 'M' : 2, 'G' : 3}[units] - size = int(value*1024**pow) - - # Return info - result.append((name, size, 2, url)) - - yield result - - -class OneFichierCom(Hoster): +class OneFichierCom(SimpleHoster): __name__ = "OneFichierCom" __type__ = "hoster" - __pattern__ = r"http://(?P<id>[a-z0-9]+)\.1fichier\.com(?P<remain>.*)" - __version__ = "0.3" + __pattern__ = r"(http://\w+\.((1fichier|d(es)?fichiers|pjointe)\.(com|fr|net|org)|(cjoint|mesfichiers|piecejointe|oi)\.(org|net)|tenvoi\.(com|org|net)|dl4free\.com|alterupload\.com|megadl.fr))" + __version__ = "0.4" __description__ = """1fichier.com download hoster""" - __author_name__ = ("fragonib") - __author_mail__ = ("fragonib[AT]yahoo[DOT]es") + __author_name__ = ("fragonib", "the-razer", "zoidberg") + __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "daniel_ AT gmx DOT net", "zoidberg@mujmail.cz") + + FILE_NAME_PATTERN = r'">File name :</th>[\t\r\n ]+<td>(?P<N>.*?)</td>' + FILE_SIZE_PATTERN = r'<th>File size :</th>\s+<td>(?P<S>[\d\.]*) (?P<U>\w+)</td>' + FILE_OFFLINE_PATTERN = r'The (requested)? file (could not be found|has been deleted)' + FILE_URL_REPLACEMENTS = [(r'(http://[^/]*).*', r'\1/en/')] - FILE_NAME_PATTERNS = ( - r'">File name :</th>[\t\r\n ]+<td>(?P<name>.*?)</td>', - r">Click here to download (?P<name>.*?)</a>", - r"content=\"Download the file named (?P<name>.*?)\">", - r"<title>Download the file\s*:\s*(?P<name>.*?)</title>" - ) - FILE_SIZE_PATTERN = r"<th>File size :</th>\s+<td>(?P<size>[\d\.]*) (?P<units>\w+)</td>" - DOWNLOAD_LINK_PATTERN = r'<br/> <br/> <br/> \s+<a href="(?P<url>http://.*?)"' - FILE_OFFLINE_PATTERN = r"(The requested file could not be found|The file may has been deleted by its owner)" + DOWNLOAD_LINK_PATTERN = r'<br/> <br/> <br/> \s+<a href="(?P<url>http://.*?)"' PASSWORD_PROTECTED_TOKEN = "protected by password" WAITING_TOKEN = "Please wait a few seconds" - - def setup(self): - self.html = None - self.multiDL = False - - def process(self, pyfile): - - # Get main page (english version) - url = self.getEnglishURL() - self.html = self.load(url) - self.handleErrors() - - # Get file info - pyfile.name = self.getFileName() - pyfile.size = self.getFileSize() + + def handleFree(self): + if self.WAITING_TOKEN in self.html: + self.waitAndRetry(60) # Check for protection if self.isProtected(): @@ -86,33 +35,7 @@ class OneFichierCom(Hoster): self.download(downloadLink) # Check download - self.handleDownloadedFile() - - def getEnglishURL(self): - id = re.match(self.__pattern__, self.pyfile.url).group('id') - url = 'http://%s.1fichier.com/en' % id - return url - - def getFileName(self): - for pattern in self.FILE_NAME_PATTERNS: - m = re.search(pattern, self.html) - if m is not None: - name = m.group('name').strip() - self.logDebug("Got file name [%s]" % name) - return name - - def getFileSize(self): - m = re.search(self.FILE_SIZE_PATTERN, self.html) - if m is not None: - size = float(m.group('size')) - units = m.group('units')[0].upper() - try: - multiplier = 1024 ** {"K":1, "M":2, "G":3}[units] - except KeyError: - multiplier = 1 - bytes = int(size * multiplier) - self.logDebug("Got file size of [%s] bytes" % bytes) - return bytes + self.checkDownloadedFile() def isProtected(self): if self.PASSWORD_PROTECTED_TOKEN in self.html: @@ -126,16 +49,15 @@ class OneFichierCom(Hoster): url = m.group('url') self.logDebug("Got file URL [%s]" % url) return url - - def handleErrors(self): - if re.search(self.FILE_OFFLINE_PATTERN, self.html) is not None: - self.logDebug("File not yet available.") - self.offline() - def handleDownloadedFile(self): + def checkDownloadedFile(self): check = self.checkDownload({"wait": self.WAITING_TOKEN}) if check == "wait": - wait = 5 - self.setWait(wait, True) - self.wait() - self.retry() \ No newline at end of file + self.waitAndRetry(60) + + def waitAndRetry(self, wait_time): + self.setWait(wait_time, True) + self.wait() + self.retry() + +getInfo = create_getInfo(OneFichierCom) \ No newline at end of file diff --git a/module/plugins/hoster/Premium4Me.py b/module/plugins/hoster/Premium4Me.py new file mode 100644 index 000000000..cd47a9e91 --- /dev/null +++ b/module/plugins/hoster/Premium4Me.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from urllib import quote +from module.plugins.Hoster import Hoster + +class Premium4Me(Hoster): + __name__ = "Premium4Me" + __version__ = "0.10" + __type__ = "hoster" + + __pattern__ = r"http://premium4.me/.*" + __description__ = """premium4.me hoster plugin""" + __author_name__ = ("RaNaN", "zoidberg") + __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz") + + def setup(self): + self.resumeDownload = True + self.chunkLimit = 1 + + 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.logDebug("premium4.me: Old URL: %s" % pyfile.url) + + tra = self.getTraffic() + + #raise timeout to 2min + self.req.setOption("timeout", 120) + + self.download("http://premium4.me/api/getfile.php?authcode=%s&link=%s" % (self.account.authcode, quote(pyfile.url, "")), disposition=True) + + err = '' + if self.req.http.code == '420': + # Custom error code send - fail + lastDownload = fs_encode(self.lastDownload) + + if exists(lastDownload): + f = open(lastDownload, "rb") + err = f.read(256).strip() + f.close() + remove(lastDownload) + else: + err = 'File does not exist' + + trb = self.getTraffic() + self.logInfo("Filesize: %d, Traffic used %d, traffic left %d" % (pyfile.size, tra-trb, trb)) + + if err: self.fail(err) + + def getTraffic(self): + try: + traffic = int(self.load ("http://premium4.me/api/traffic.php?authcode=%s" % self.account.authcode)) + except: + traffic = 0 + return traffic \ No newline at end of file diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index 53c5cd81f..6b699e39f 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -18,121 +18,119 @@ import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.network.RequestFactory import getURL + +def convertDecimalPrefix(m): + # decimal prefixes used in filesize and traffic + return ("%%.%df" % {'k':3,'M':6,'G':9}[m.group(2)] % float(m.group(1))).replace('.','') class UlozTo(SimpleHoster): __name__ = "UlozTo" __type__ = "hoster" __pattern__ = r"http://(\w*\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/.*" - __version__ = "0.74" + __version__ = "0.81" __description__ = """uloz.to""" - __config__ = [("reuseCaptcha", "bool", "Reuse captcha", "True"), - ("captchaUser", "str", "captcha_user", ""), - ("captchaNb", "str", "captcha_nb", "")] __author_name__ = ("zoidberg") - FILE_URL_PATTERN = r'<form name="dwn" action="([^"]+)"' - FILE_NAME_PATTERN = r'<h2 class="nadpis" style="margin-left:196px;"><a href="[^"]+">(?P<N>[^<]+)</a></h2>' - CAPTCHA_PATTERN = r'<img style=".*src="([^"]+)" alt="Captcha" class="captcha"' - CAPTCHA_NB_PATTERN = r'<input class="captcha_nb" type="hidden" name="captcha_nb" value="([0-9]+)" >' + FILE_NAME_PATTERN = r'<a share_url="[^&]*&t=(?P<N>[^"]+)"' + #FILE_NAME_PATTERN = r'<h2 class="nadpis" style="margin-left:196px;"><a href="[^"]+">(?P<N>[^<]+)</a></h2>' + FILE_SIZE_PATTERN = r'<div class="info_velikost" style="top:-55px;">\s*<div>[^<]*\s+(?P<S>[0-9.]+\s[kMG]B)\s*</div>\s*</div>' + FILE_SIZE_REPLACEMENTS = [('([0-9.]+)\s([kMG])B', convertDecimalPrefix)] FILE_OFFLINE_PATTERN = r'http://www.uloz.to/(neexistujici|smazano|nenalezeno)' + PASSWD_PATTERN = r'<input type="password" class="text" name="file_password" id="frmfilepasswordForm-file_password" />' - LIVE_URL_PATTERN = r'<div id="flashplayer"[^>]*>\s*<a href="([^"]+)"' - LIVE_NAME_PATTERN = r'<a share_url="[^&]*&t=([^"]+)"' - FILE_SIZE_PATTERN = r'<div class="info_velikost" style="top:-55px;">\s*<div>[^<]*\s+(?P<S>[0-9.]+)\s(?P<U>[kKMG])i?B\s*</div>\s*</div>' - VIPLINK_PATTERN = r'<a href="[^"]*\?disclaimer=1" class="linkVip">' - - def setup(self): - self.multiDL = False + VIPLINK_PATTERN = r'<a href="[^"]*\?disclaimer=1" class="linkVip">' + FREE_URL_PATTERN = r'<form name="dwn" action="([^"]+)"' + PREMIUM_URL_PATTERN = r'<a onclick[^>]*href="([^"]+)[^>]*class="linkVip"' + CAPTCHA_PATTERN = r'<img style=".*src="([^"]+)" alt="Captcha" class="captcha"' + CAPTCHA_NB_PATTERN = r'<input class="captcha_nb" type="hidden" name="captcha_nb" value="([0-9]+)" >' def process(self, pyfile): + # check file online header = self.load(pyfile.url, just_header=True) if "location" in header: self.logDebug('LOCATION: ' + header['location']) if "utm_source=old" in header['location'] or re.search(self.FILE_OFFLINE_PATTERN, header['location']): - self.offline() - + self.offline() + self.html = self.load(pyfile.url, decode=True) - if self.PASSWD_PATTERN in self.html: - self.fail("Password protected link") - + # password protected links + passwords = self.getPassword().splitlines() + while self.PASSWD_PATTERN in self.html: + if passwords: + password = passwords.pop(0) + self.logInfo("Password protected link, trying " + password) + self.html = self.load(pyfile.url, get = {"do": "filepasswordForm-submit"}, post={"file_password": password, "fpwdsend": 'Odeslat'}, cookies=True) + else: + self.fail("No or incorrect password") + + self.file_info = self.getFileInfo() + + # adult content if re.search(self.VIPLINK_PATTERN, self.html): self.html = self.load(pyfile.url, get={"disclaimer": "1"}) + + if self.premium and self.checkTrafficLeft(): + self.handlePremium() + else: + self.handleFree() + + def handleFree(self): + parsed_url = self.findDownloadURL(premium=False) + + # get and decrypt captcha + captcha = self.getStorage("captchaUser") + captcha_nb = self.getStorage("captchaNb") + captcha_url = "DUMMY" + + if not captcha or not captcha_nb: + found = re.search(self.CAPTCHA_PATTERN, self.html) + if not found: self.parseError("CAPTCHA") + captcha_url = found.group(1) + + found = re.search(self.CAPTCHA_NB_PATTERN, self.html) + if not found: self.parseError("CAPTCHA_NB") + captcha_nb = found.group(1) + + captcha = self.decryptCaptcha(captcha_url) + + self.log.debug('CAPTCHA_URL:' + captcha_url + ' CAPTCHA:' + captcha + ' CAPTCHA_NB:' + captcha_nb) - found = re.search(self.LIVE_URL_PATTERN, self.html) - if found is not None: - # Uloz.to LIVE - parsed_url = found.group(1) - self.logDebug("LIVE URL:" + parsed_url) - - found = re.search(self.LIVE_NAME_PATTERN, self.html) - if found is None: - self.fail("Parse error (LIVE_NAME)") - pyfile.name = found.group(1) - self.log.debug("LIVE NAME:" + pyfile.name) - - self.download(parsed_url) - else: - # Uloz.to DATA - # parse the name from the site and set attribute in pyfile - found = re.search(self.FILE_NAME_PATTERN, self.html) - if found is None: - self.fail("Parse error (FILENAME)") - pyfile.name = found.group(1) - self.log.debug("PARSED_NAME:" + pyfile.name) - - found = re.search(self.FILE_URL_PATTERN, self.html) - if found is None: - self.fail("Parse error (URL)") - parsed_url = found.group(1) - self.log.debug("PARSED_URL:" + parsed_url) - - # get and decrypt captcha - reuse_captcha = self.getConfig("reuseCaptcha") - captcha = self.getConfig("captchaUser") - captcha_nb = self.getConfig("captchaNb") - captcha_url = "DUMMY" - - if not reuse_captcha or not captcha or not captcha_nb: - found = re.search(self.CAPTCHA_PATTERN, self.html) - if found is None: - self.fail("Parse error (CAPTCHA)") - captcha_url = found.group(1) - captcha = self.decryptCaptcha(captcha_url) - found = re.search(self.CAPTCHA_NB_PATTERN, self.html) - if found is None: - self.fail("Parse error (CAPTCHA_NB)") - captcha_nb = found.group(1) - self.log.debug('CAPTCHA_URL:' + captcha_url + ' CAPTCHA:' + captcha + ' CAPTCHA_NB:' + captcha_nb) - - # download the file, destination is determined by pyLoad - self.download(parsed_url, post={ - "captcha_user": captcha, - "captcha_nb": captcha_nb - }) - - check = self.checkDownload({ - "wrong_captcha": re.compile(self.CAPTCHA_PATTERN), - "offline": re.compile(self.FILE_OFFLINE_PATTERN), - "passwd": self.PASSWD_PATTERN - }) - - if check == "wrong_captcha": - if reuse_captcha: - self.setConfig("captchaUser", "") - self.setConfig("captchaNb", "") - self.invalidCaptcha() - self.retry(reason="Wrong captcha code") - elif check == "offline": - self.offline() - elif check == "passwd": - self.fail("Password protected") - - if reuse_captcha: - self.setConfig("captchaUser", captcha) - self.setConfig("captchaNb", captcha_nb) - -getInfo = create_getInfo(UlozTo) - - \ No newline at end of file + # download and check + self.download(parsed_url, post={"captcha_user": captcha, "captcha_nb": captcha_nb}, cookies=True) + self.doCheckDownload() + + self.setStorage("captchaUser", captcha) + self.setStorage("captchaNb", captcha_nb) + + def handlePremium(self): + parsed_url = self.findDownloadURL(premium=True) + self.download(parsed_url) + self.doCheckDownload() + + def findDownloadURL(self, premium=False): + msg = "%s link" % ("Premium" if premium else "Free") + found = re.search(self.PREMIUM_URL_PATTERN if premium else self.FREE_URL_PATTERN, self.html) + if not found: self.parseError(msg) + parsed_url = found.group(1) + self.logDebug("%s: %s" % (msg, parsed_url)) + return parsed_url + + def doCheckDownload(self): + check = self.checkDownload({ + "wrong_captcha": re.compile(self.CAPTCHA_PATTERN), + "offline": re.compile(self.FILE_OFFLINE_PATTERN), + "passwd": self.PASSWD_PATTERN + }) + + if check == "wrong_captcha": + self.delStorage("captchaUser") + self.delStorage("captchaNb") + self.invalidCaptcha() + self.retry(reason="Wrong captcha code") + elif check == "offline": + self.offline() + elif check == "passwd": + self.fail("Wrong password") + +getInfo = create_getInfo(UlozTo) \ No newline at end of file diff --git a/module/plugins/hoster/WuploadCom.py b/module/plugins/hoster/WuploadCom.py index 11b61ae59..ffb082cbe 100644 --- a/module/plugins/hoster/WuploadCom.py +++ b/module/plugins/hoster/WuploadCom.py @@ -3,11 +3,12 @@ import re import string +from urllib import unquote from types import MethodType from module.plugins.Hoster import Hoster -from module.plugins.Plugin import chunks +from module.utils import chunks from module.network.RequestFactory import getURL from module.common.json_layer import json_loads @@ -31,7 +32,7 @@ def getInfo(urls): if item["status"] != "AVAILABLE": result.append((None, 0, 1, ids[str(item["id"])])) else: - result.append((item["filename"], item["size"], 2, ids[str(item["id"])])) + result.append((unquote(item["filename"]), item["size"], 2, ids[str(item["id"])])) yield result @@ -47,7 +48,7 @@ class WuploadCom(Hoster): __name__ = "WuploadCom" __type__ = "hoster" __pattern__ = r"http://[\w\.]*?wupload\..*?/file/(([a-z][0-9]+/)?[0-9]+)(/.*)?" - __version__ = "0.1" + __version__ = "0.2" __description__ = """Wupload com""" __author_name__ = ("jeix", "paulking") __author_mail__ = ("jeix@hasnomail.de", "") -- cgit v1.2.3 From 03aad64b6b714e55b30d27cbe6e3cda6b190d399 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio <pedro@algarvio.me> Date: Wed, 18 Jan 2012 06:43:47 +0000 Subject: Support file hosters under maintenance and generated links spans. --- module/plugins/hoster/RealdebridCom.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 376ae3414..34c637a0e 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -48,6 +48,9 @@ class RealdebridCom(Hoster): page = self.load(url) error = re.search(r'<span id="generation-error">(.*)</span>', page) + generation_ok = re.search(r'<span id="generation-ok"><a href="(.*)">(.*)</a></span>', page) + if generation_ok: + page = generation_ok.group(1).strip() if error: msg = error.group(1).strip() @@ -58,6 +61,9 @@ class RealdebridCom(Hoster): self.fail(msg) elif url == 'error': self.fail("Your IP is most likely blocked. Please contact RealDebrid support") + elif page == "File's hoster is in maintenance. Try again later.": + self.log.warning(page) + self.tempOffline() else: new_url = page -- cgit v1.2.3 From 6039164d1fb02be9db04b59d2256b5cca3a3523f Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Wed, 18 Jan 2012 10:17:34 +0100 Subject: corrected log method --- module/plugins/hoster/RealdebridCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 34c637a0e..ac55ea3f0 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -62,7 +62,7 @@ class RealdebridCom(Hoster): elif url == 'error': self.fail("Your IP is most likely blocked. Please contact RealDebrid support") elif page == "File's hoster is in maintenance. Try again later.": - self.log.warning(page) + self.logWarning(page) self.tempOffline() else: new_url = page -- cgit v1.2.3 From 567c1d512e2e7452969d42d272d600d694e40058 Mon Sep 17 00:00:00 2001 From: zoidberg10 <zoidberg@mujmail.cz> Date: Fri, 20 Jan 2012 01:58:41 +0100 Subject: fix threadmanager limitdl, add zevera.com --- module/plugins/hoster/DlFreeFr.py | 82 +++++++++++-------------------------- module/plugins/hoster/ZeveraCom.py | 83 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 59 deletions(-) create mode 100644 module/plugins/hoster/ZeveraCom.py (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/DlFreeFr.py b/module/plugins/hoster/DlFreeFr.py index 8ab9dd8eb..7cb58e6f4 100644 --- a/module/plugins/hoster/DlFreeFr.py +++ b/module/plugins/hoster/DlFreeFr.py @@ -2,72 +2,36 @@ # -*- coding: utf-8 -*- import re +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.plugins.Hoster import Hoster - -class DlFreeFr(Hoster): +class DlFreeFr(SimpleHoster): __name__ = "DlFreeFr" __type__ = "hoster" __pattern__ = r"http://dl\.free\.fr/([a-zA-Z0-9]+|getfile\.pl\?file=/[a-zA-Z0-9]+)$" - __version__ = "0.1" + __version__ = "0.2" __description__ = """dl.free.fr download hoster""" - __author_name__ = ("the-razer") - __author_mail__ = ("daniel_ AT gmx DOT net") - + __author_name__ = ("the-razer", "zoidberg") + __author_mail__ = ("daniel_ AT gmx DOT net", "zoidberg@mujmail.cz") + + FILE_NAME_PATTERN = r"Fichier:</td>\s*<td[^>]*>(?P<N>[^>]*)</td>" + FILE_SIZE_PATTERN = r"Taille:</td>\s*<td[^>]*>(?P<S>[\d.]+[KMG])</td>" + FILE_OFFLINE_PATTERN = r"Erreur 404 - Document non trouv|Fichier inexistant|Le fichier demandé n'a pas été trouvé" + FILE_URL_PATTERN = r'href="(?P<url>http://.*?)">Télécharger ce fichier' + def setup(self): - self.html = None - self.multiDL = False - - def process(self, pyfile): - - self.download_html() - - if not self.file_exists(): - self.log.debug(self.__name__+": File not yet available.") - self.offline() - - pyfile.name = self.get_file_name() - - url = self.get_file_url() - if url: - self.download(url) - else: - self.offline() + self.limitDL = 5 + self.resumeDownload = True + self.chunkLimit = 1 - def download_html(self): - self.html = self.load(self.pyfile.url, cookies=False) - - def file_exists(self): - warnings = (r"Erreur 404 - Document non trouv", - r"Fichier inexistant.", - r"Le fichier demandé n'a pas été trouvé") - expr = '(' + '|'.join(warnings) + ')' - if re.search(expr, self.html) is not None: - return False - return True + def handleFree(self): + if "Trop de slots utilisés" in self.html: + self.retry(300) - def get_file_url(self): - self.log.debug(self.__name__+": Getting file URL") - file_url_pattern = r'href="(?P<url>http://.*?)">Télécharger ce fichier' + m = re.search(self.FILE_URL_PATTERN, self.html) + if not m: self.parseError('URL') - m = re.search(file_url_pattern, self.html) - if m is not None: - url = m.group('url') - self.log.debug(self.__name__+": File URL [%s]" % url) - return url - else: - self.log.debug(self.__name__+": Error getting URL") - return False + url = m.group('url') + self.logDebug("File URL [%s]" % url) + self.download(url) - def get_file_name(self): - self.log.debug(self.__name__+": Getting file name") - - file_name_pattern = r"Fichier:</td>\s*<td.*>(?P<name>.*?)</td>" - m = re.search(file_name_pattern, self.html) - - if m is not None: - name = m.group('name').strip() - self.log.debug(self.__name__+": File name [%s]" % name) - return name - else: - self.log.debug(self.__name__+": Could not find filename") +getInfo = create_getInfo(DlFreeFr) \ No newline at end of file diff --git a/module/plugins/hoster/ZeveraCom.py b/module/plugins/hoster/ZeveraCom.py new file mode 100644 index 000000000..d1fa80802 --- /dev/null +++ b/module/plugins/hoster/ZeveraCom.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from module.plugins.Hoster import Hoster +from module.utils import html_unescape +from urllib import quote, unquote +from time import sleep + +class ZeveraCom(Hoster): + __name__ = "ZeveraCom" + __version__ = "0.11" + __type__ = "hoster" + __pattern__ = r"http://zevera.com/.*" + __description__ = """zevera.com hoster plugin""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + 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 = self.pyfile.url #quote(self.pyfile.url.encode('utf_8')) + + for i in range(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'] + + pyfile.progress = self.retData['FileInfo']['Progress']['Percentage'] + + self.setWait(self.retData['Update_Wait']) + self.wait() + + pyfile.progress = 0 + pyfile.name = self.crazyDecode(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 self.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')) \ No newline at end of file -- cgit v1.2.3 From cea5a881e0f2f0c0a4dd7ac4090d4d415192496e Mon Sep 17 00:00:00 2001 From: Pedro Algarvio <pedro@algarvio.me> Date: Sun, 22 Jan 2012 11:26:37 +0000 Subject: Bring Oron's premium account handling to latest api. --- module/plugins/hoster/OronCom.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/OronCom.py b/module/plugins/hoster/OronCom.py index 0be840d76..120aa8ff4 100755 --- a/module/plugins/hoster/OronCom.py +++ b/module/plugins/hoster/OronCom.py @@ -129,13 +129,13 @@ class OronCom(Hoster): self.logError("error in parsing site") def handlePremium(self): - info = self.account.getAccountInfo(self.user, True) - self.logDebug("Traffic left: %s" % info['trafficleft']) + self.account.getAccountInfo(True) + self.logDebug("Traffic left: %s" % self.account.trafficleft) self.logDebug("File Size: %d" % int(self.pyfile.size / 1024)) - if int(self.pyfile.size / 1024) > info["trafficleft"]: + if int(self.pyfile.size / 1024) > self.account.trafficleft: self.logInfo(_("Not enough traffic left")) - self.account.empty(self.user) + self.account.empty() self.fail(_("Traffic exceeded")) post_url = "http://oron.com/" + self.file_id @@ -147,3 +147,4 @@ class OronCom(Hoster): self.html = self.load(post_url, post=post_dict, ref=False, decode=True).encode("utf-8") link = re.search('href="(.*?)" class="atitle"', self.html).group(1) self.download(link) + -- cgit v1.2.3 From 66f817d6d1fa24713b556982a0de209f3322e868 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sun, 22 Jan 2012 12:30:16 +0100 Subject: realdebrid encoding fix --- module/plugins/hoster/RealdebridCom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index ac55ea3f0..3a3ac99b0 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -5,6 +5,7 @@ import re from urllib import quote, unquote from random import randrange +from module.utils import encode from module.plugins.Hoster import Hoster class RealdebridCom(Hoster): @@ -43,8 +44,8 @@ class RealdebridCom(Hoster): password = self.getPassword().splitlines() if not password: password = "" else: password = password[0] - - url = "http://real-debrid.com/ajax/deb.php?lang=en&sl=1&link=%s&passwort=%s" % (quote(pyfile.url, ""), password) + + url = "http://real-debrid.com/ajax/deb.php?lang=en&sl=1&link=%s&passwort=%s" % (quote(encode(pyfile.url), ""), password) page = self.load(url) error = re.search(r'<span id="generation-error">(.*)</span>', page) -- cgit v1.2.3 From babe9443952f60cc241c96b8c5a3bf4a8217b6c0 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio <pedro@algarvio.me> Date: Sat, 28 Jan 2012 19:40:17 +0000 Subject: Update FileJungle for non existing files. --- module/plugins/hoster/FilejungleCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/FilejungleCom.py b/module/plugins/hoster/FilejungleCom.py index b880086a6..652d9547b 100644 --- a/module/plugins/hoster/FilejungleCom.py +++ b/module/plugins/hoster/FilejungleCom.py @@ -31,7 +31,7 @@ class FilejungleCom(SimpleHoster): __author_mail__ = ("zoidberg@mujmail.cz") FILE_INFO_PATTERN = r'<div id="file_name">(?P<N>[^<]+) <span class="filename_normal">\((?P<S>[0-9.]+) (?P<U>[kKMG])i?B\)</span></div>' - FILE_OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>' + FILE_OFFLINE_PATTERN = r'(This file is no longer available.</h1>|class="error_msg_title"> Invalid or Deleted File. </div>)' RECAPTCHA_KEY_PATTERN = r"var reCAPTCHA_publickey='([^']+)'" WAIT_TIME_PATTERN = r'<h1>Please wait for (\d+) seconds to download the next file\.</h1>' @@ -82,4 +82,4 @@ class FilejungleCom(SimpleHoster): response = self.load(url, post = {"downloadLink" : "show"}) self.download(url, post = {"download" : "normal"}) -getInfo = create_getInfo(FilejungleCom) \ No newline at end of file +getInfo = create_getInfo(FilejungleCom) -- cgit v1.2.3 From 7712c2cae2268d104fccd4eeb12e009d2931a3c4 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio <pedro@algarvio.me> Date: Sat, 28 Jan 2012 19:41:45 +0000 Subject: Update version. --- module/plugins/hoster/FilejungleCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/FilejungleCom.py b/module/plugins/hoster/FilejungleCom.py index 652d9547b..70b3ea4b5 100644 --- a/module/plugins/hoster/FilejungleCom.py +++ b/module/plugins/hoster/FilejungleCom.py @@ -25,7 +25,7 @@ class FilejungleCom(SimpleHoster): __name__ = "FilejungleCom" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?filejungle\.com/f/([^/]+).*" - __version__ = "0.23" + __version__ = "0.24" __description__ = """Filejungle.com plugin - free only""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") -- cgit v1.2.3 From 73f1afdd8fd48de36ed4881adaa5960f32749f57 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio <pedro@algarvio.me> Date: Sat, 4 Feb 2012 03:03:31 +0000 Subject: Correct import. --- module/plugins/hoster/HotfileCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py index 1447e7c9e..e618d0f4f 100644 --- a/module/plugins/hoster/HotfileCom.py +++ b/module/plugins/hoster/HotfileCom.py @@ -6,7 +6,7 @@ from module.plugins.Hoster import Hoster from module.plugins.ReCaptcha import ReCaptcha from module.network.RequestFactory import getURL -from module.plugins.Plugin import chunks +from module.utils import chunks def getInfo(urls): api_url_base = "http://api.hotfile.com/" -- cgit v1.2.3 From a0ebf8d7a70fde61c754af2f146abc3d9b3511f9 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio <pedro@algarvio.me> Date: Sat, 4 Feb 2012 03:06:15 +0000 Subject: Add helper method `formatTrafficleft()` to `module.plugins.Account`. Regarding Oron account and hoster plugins, make use of `formatSize`, `parseFileSize` and the `Account`'s `formatTrafficleft()` helper method. --- module/plugins/hoster/OronCom.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/OronCom.py b/module/plugins/hoster/OronCom.py index 120aa8ff4..e0be91486 100755 --- a/module/plugins/hoster/OronCom.py +++ b/module/plugins/hoster/OronCom.py @@ -4,6 +4,7 @@ import re from module.plugins.Hoster import Hoster from module.network.RequestFactory import getURL from module.plugins.ReCaptcha import ReCaptcha +from module.utils import parseFileSize def getInfo(urls): result = [] @@ -18,9 +19,7 @@ def getInfo(urls): m = re.search(OronCom.FILE_INFO_PATTERN, html) if m: name = m.group(1) - hSize = float(m.group(2).replace(",", ".")) - pow = {'Kb': 1, 'Mb': 2, 'Gb': 3}[m.group(3)] - size = int(hSize * 1024 ** pow) + size = parseFileSize(m.group(2), m.group(3)) else: name = url size = 0 @@ -57,10 +56,8 @@ class OronCom(Hoster): m = re.search(self.FILE_INFO_PATTERN, self.html) if m: pyfile.name = m.group(1) - hSize = float(m.group(2)) - pow = {'Kb': 1, 'Mb': 2, 'Gb': 3}[m.group(3)] - pyfile.size = int(hSize * 1024 ** pow) - self.logDebug("File Size: %d" % pyfile.size) + pyfile.size = parseFileSize(m.group(2), m.group(3)) + self.logDebug("File Size: %s" % pyfile.formatSize()) else: self.logDebug("Name and/or size not found.") @@ -130,8 +127,8 @@ class OronCom(Hoster): def handlePremium(self): self.account.getAccountInfo(True) - self.logDebug("Traffic left: %s" % self.account.trafficleft) - self.logDebug("File Size: %d" % int(self.pyfile.size / 1024)) + self.logDebug("Traffic left: %s" % self.account.formatTrafficleft()) + self.logDebug("File Size: %s" % self.pyfile.formatSize()) if int(self.pyfile.size / 1024) > self.account.trafficleft: self.logInfo(_("Not enough traffic left")) -- cgit v1.2.3 From 69230e264359f5a53faec5ddb2f768255cab0c77 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio <pedro@algarvio.me> Date: Sun, 5 Feb 2012 05:16:58 +0000 Subject: Make sure that the Oron hoster plugins does not match Oron folders. --- module/plugins/hoster/OronCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/OronCom.py b/module/plugins/hoster/OronCom.py index e0be91486..e659beee5 100755 --- a/module/plugins/hoster/OronCom.py +++ b/module/plugins/hoster/OronCom.py @@ -31,8 +31,8 @@ def getInfo(urls): class OronCom(Hoster): __name__ = "OronCom" __type__ = "hoster" - __pattern__ = r"http://(?:www.)?oron.com/" - __version__ = "0.13" + __pattern__ = r"http://(?:www\.)?oron.com/(?!folder/)" + __version__ = "0.14" __description__ = "File Hoster: Oron.com" __author_name__ = ("chrox", "DHMH") __author_mail__ = ("chrox@pyload.org", "DHMH@pyload.org") -- cgit v1.2.3 From f04e77d96c7483cae90f19eb8468557a44fa49e5 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio <pedro@algarvio.me> Date: Sun, 5 Feb 2012 06:41:43 +0000 Subject: Stop Real-Debrid from returning streaming responses instead of file downloads. --- module/plugins/hoster/RealdebridCom.py | 35 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 3a3ac99b0..5759838e2 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -2,14 +2,16 @@ # -*- coding: utf-8 -*- import re +from time import time from urllib import quote, unquote from random import randrange -from module.utils import encode +from module.utils import encode, parseFileSize +from module.common.json_layer import json_loads from module.plugins.Hoster import Hoster class RealdebridCom(Hoster): - __version__ = "0.41" + __version__ = "0.42" __pattern__ = r"https?://.*real-debrid\..*" __description__ = """Real-Debrid.com hoster plugin""" __config__ = [("https", "bool", _("Enable HTTPS"), False)] @@ -45,28 +47,24 @@ class RealdebridCom(Hoster): if not password: password = "" else: password = password[0] - url = "http://real-debrid.com/ajax/deb.php?lang=en&sl=1&link=%s&passwort=%s" % (quote(encode(pyfile.url), ""), password) + url = "http://real-debrid.com/ajax/unrestrict.php?lang=en&link=%s&password=%s&time=%s" % (quote(encode(pyfile.url), ""), password, int(time()*1000)) page = self.load(url) + data = json_loads(page) - error = re.search(r'<span id="generation-error">(.*)</span>', page) - generation_ok = re.search(r'<span id="generation-ok"><a href="(.*)">(.*)</a></span>', page) - if generation_ok: - page = generation_ok.group(1).strip() + self.logDebug("Returned Data: %s" % data) - if error: - msg = error.group(1).strip() - self.logDebug(page) - if msg == "Your file is unavailable on the hoster.": + if data["error"] != 0: + if data["message"] == "Your file is unavailable on the hoster.": self.offline() + elif data["message"] == "File's hoster is in maintenance. Try again later.": + self.logWarning(data["message"]) + self.tempOffline() else: - self.fail(msg) - elif url == 'error': - self.fail("Your IP is most likely blocked. Please contact RealDebrid support") - elif page == "File's hoster is in maintenance. Try again later.": - self.logWarning(page) - self.tempOffline() + self.logError(page) else: - new_url = page + self.pyfile.name = data["file_name"] + self.pyfile.size = parseFileSize(data["file_size"]) + new_url = data['generated_links'].split('|')[-1] if self.getConfig("https"): new_url = new_url.replace("http://", "https://") @@ -75,7 +73,6 @@ class RealdebridCom(Hoster): self.log.debug("Real-Debrid: New URL: %s" % new_url) - if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown"): #only use when name wasnt already set pyfile.name = self.getFilename(new_url) -- cgit v1.2.3 From e8a0cc2daf8cf5b0ad6d1faee53cd5551fa6dfaa Mon Sep 17 00:00:00 2001 From: Pedro Algarvio <pedro@algarvio.me> Date: Sun, 5 Feb 2012 11:00:31 +0000 Subject: Fix missing error message. --- module/plugins/hoster/RealdebridCom.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 5759838e2..d1f87f3dd 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -11,7 +11,7 @@ from module.common.json_layer import json_loads from module.plugins.Hoster import Hoster class RealdebridCom(Hoster): - __version__ = "0.42" + __version__ = "0.43" __pattern__ = r"https?://.*real-debrid\..*" __description__ = """Real-Debrid.com hoster plugin""" __config__ = [("https", "bool", _("Enable HTTPS"), False)] @@ -59,6 +59,9 @@ class RealdebridCom(Hoster): elif data["message"] == "File's hoster is in maintenance. Try again later.": self.logWarning(data["message"]) self.tempOffline() + elif data["message"] == "No server is available for this hoster.": + self.logWarning(data["message"]) + self.tempOffline() else: self.logError(page) else: -- cgit v1.2.3 From c318d10d2b85160f892eb0ddfdbe295fa0d46aa4 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio <pedro@algarvio.me> Date: Sun, 5 Feb 2012 11:04:14 +0000 Subject: Treat most errors as tempfailures, this will solve the missing errors. --- module/plugins/hoster/RealdebridCom.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index d1f87f3dd..46ac51c82 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -56,14 +56,9 @@ class RealdebridCom(Hoster): if data["error"] != 0: if data["message"] == "Your file is unavailable on the hoster.": self.offline() - elif data["message"] == "File's hoster is in maintenance. Try again later.": - self.logWarning(data["message"]) - self.tempOffline() - elif data["message"] == "No server is available for this hoster.": + else: self.logWarning(data["message"]) self.tempOffline() - else: - self.logError(page) else: self.pyfile.name = data["file_name"] self.pyfile.size = parseFileSize(data["file_size"]) -- cgit v1.2.3 From 7bd2ffe0e50efea468efaec28abace2055dab42d Mon Sep 17 00:00:00 2001 From: Jeix <devnull@localhost> Date: Sun, 5 Feb 2012 14:31:50 +0100 Subject: closed #261 --- module/plugins/hoster/Xdcc.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py index 7d83b050c..6f0a1b176 100644 --- a/module/plugins/hoster/Xdcc.py +++ b/module/plugins/hoster/Xdcc.py @@ -215,7 +215,7 @@ class Xdcc(Hoster): self.log.info("XDCC: Downloading %s from %s:%d" % (packname, ip, port)) self.pyfile.setStatus("downloading") - newname = self.req.download(ip, port, filename, self.pyfile.setProgress) + newname = self.req.download(ip, port, filename, sock, self.pyfile.setProgress) if newname and newname != filename: self.log.info("%(name)s saved as %(newname)s" % {"name": self.pyfile.name, "newname": newname}) filename = newname @@ -227,4 +227,3 @@ class Xdcc(Hoster): self.lastDownload = filename return self.lastDownload - -- cgit v1.2.3 From b40b32ee05f611323a7827fad2a25fa0a28dcb24 Mon Sep 17 00:00:00 2001 From: X3n0m0rph59 <X3n0m0rph59@googlemail.com> Date: Sun, 22 Apr 2012 19:56:17 +0200 Subject: a huge pile of spelling fixes --- module/plugins/hoster/NetloadIn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 382328496..d768090e8 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -10,7 +10,7 @@ from module.plugins.Hoster import Hoster from module.network.RequestFactory import getURL def getInfo(urls): - ## returns list of tupels (name, size (in bytes), status (see FileDatabase), url) + ## returns list of tuples (name, size (in bytes), status (see FileDatabase), url) apiurl = "http://api.netload.in/info.php?auth=Zf9SnQh9WiReEsb18akjvQGqT0I830e8&bz=1&md5=1&file_id=" @@ -196,7 +196,7 @@ class NetloadIn(Hoster): file_id = re.search('<input name="file_id" type="hidden" value="(.*)" />', page).group(1) if not captchawaited: wait = self.get_wait_time(page) - if i == 0: self.pyfile.waitUntil = time() # dont wait contrary to time on website + if i == 0: self.pyfile.waitUntil = time() # don't wait contrary to time on web site else: self.pyfile.waitUntil = t self.log.info(_("Netload: waiting for captcha %d s.") % (self.pyfile.waitUntil - time())) #self.setWait(wait) -- cgit v1.2.3 From 0d2d6daef850ac6bcc7fafccd230e52d2a862c2c Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sun, 3 Jun 2012 17:45:10 +0200 Subject: updates for database + api --- module/plugins/hoster/MegauploadCom.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py index 336cbfb58..8693e4303 100644 --- a/module/plugins/hoster/MegauploadCom.py +++ b/module/plugins/hoster/MegauploadCom.py @@ -2,17 +2,13 @@ # -*- coding: utf-8 -*- import re -from time import sleep from module.plugins.Hoster import Hoster from module.network.RequestFactory import getURL -from module.network.HTTPRequest import BadHeader from module.utils import html_unescape -from module.PyFile import statusMap - -from pycurl import error +from datatypes.PyFile import statusMap def getInfo(urls): yield [(url, 0, 1, url) for url in urls] -- cgit v1.2.3