From 6153be90519d11aa5678f1fa461cba75deb5a124 Mon Sep 17 00:00:00 2001 From: Jeix 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 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\d*?)/(?P[^?]+)|#!download\|(?:\w+)\|(?P\d+)\|(?P[^|]+))" __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 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: (.*)
Größe: ([0-9,.]+) (Kb|Mb|Gb)' + FILE_INFO_PATTERN = r'(?:Filename|Dateiname): (.*?)\s*
\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 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 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 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 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']* name="([^"]+)" value="([^"]*)">' WAIT_PATTERN = r'[^>]*>(\d+) seconds' + DIRECT_LINK_PATTERN = r'(http://\w+\.easybytez\.com/files/\d+/\w+/[^"<]+)' + URL_FORM_PATTERN = r'
]*action="([^"]+)(.*?)
' + OVR_DOWNLOAD_LINK_PATTERN = r'

Download Link

\s*]*>([^<]+)' + OVR_KILL_LINK_PATTERN = r'

Delete Link

\s*]*>([^<]+)' + + 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'' def process(self, pyfile): -- cgit v1.2.3 From e370517032aeb5f8305d9e0fdc26f643ff30f883 Mon Sep 17 00:00:00 2001 From: zoidberg10 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'(?P.*)\s*(?P[0-9,.]+) (?P[kKMG])i?B' + FILE_NAME_PATTERN = r'Download:\s*(?P.*)' + FILE_NAME_PATTERN = r'(?P[^<]+)' FILE_OFFLINE_PATTERN = r"

Sorry,
the page you're looking for
isn't here.

" 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'[^<]+ \((?P[^<]+)\)' + FILE_INFO_PATTERN = r'Filename:(?P[^<]+)\s*.*?\((?P[^<]+)\)' FILE_OFFLINE_PATTERN = r'

File Not Found

' - FORM_INPUT_PATTERN = r']* name="([^"]+)" value="([^"]*)">' + FORM_INPUT_PATTERN = r']* name="([^"]+)"[^>]*value="([^"]*)"' WAIT_PATTERN = r'[^>]*>(\d+) seconds
' DIRECT_LINK_PATTERN = r'(http://\w+\.easybytez\.com/files/\d+/\w+/[^"<]+)' - URL_FORM_PATTERN = r'
]*action="([^"]+)(.*?)
' + FORM_PATTERN = r'
]*action=["\']?([^"\' ]+)(.*?)
' OVR_DOWNLOAD_LINK_PATTERN = r'

Download Link

\s*]*>([^<]+)' OVR_KILL_LINK_PATTERN = r'

Delete Link

\s*]*>([^<]+)' + TEXTAREA_PATTERN = r"" + + 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.*?)(?P.(filesonic|sharingmatrix)\..+?)(?P/.*)' - FILE_ID_PATTERN = r'/file/(?P([a-z][0-9]+/)?[0-9]+)(/.*)?' #change may break wupload - be careful + FILE_ID_PATTERN = r'/file/(?P([a-z][0-9]+/)?[a-zA-Z0-9\-._+]+)(/.*)?' #change may break wupload - be careful FILE_LINK_PATTERN = r'

Soubor: (?P[^<]+)

' - FILE_SIZE_PATTERN = r'
  • Velikost: (?P[0-9.]+) (?P[kKMG])i?)
  • ' + FILE_SIZE_PATTERN = r'
  • Velikost: (?P[^<]+)
  • ' FILE_OFFLINE_PATTERN = r'BezvaData \| Soubor nenalezen' DOWNLOAD_FORM_PATTERN = r'
    ' 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']* name="([^"]+)"[^>]*value="([^"]*)"' WAIT_PATTERN = r'[^>]*>(\d+) seconds' - 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']*action=["\']?([^"\' ]+)(.*?)' OVR_DOWNLOAD_LINK_PATTERN = r'

    Download Link

    \s*]*>([^<]+)' 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'

    (?P[^<]+)

    \s*
    \s*
    ' + FILE_OFFLINE_PATTERN = r'(This file is no longer available.|class="error_msg_title"> Invalid or Deleted File. )' RECAPTCHA_KEY_PATTERN = r"var reCAPTCHA_publickey='([^']+)'" WAIT_TIME_PATTERN = r'

    Please wait for (\d+) seconds to download the next file\.

    ' @@ -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 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 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 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 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 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'(.*)', page) - generation_ok = re.search(r'(.*)', 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 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 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 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 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('', 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 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

    Start download' WAIT_TIME_PATTERN = r'countDownDelay = (?P\d+)' WAIT_TM_PATTERN = r"name='tm' value='(.*?)' />" -- cgit v1.2.3 From 0047cf8d757eb9866b53164b26e89c9b102d2a60 Mon Sep 17 00:00:00 2001 From: zoidberg10 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 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 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 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=|\*=(?P.+)'')(?P.*)", 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 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 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'