diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2012-11-03 18:06:19 +0100 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2012-11-03 18:06:19 +0100 |
commit | 472870794ba8a9706f82cd79a22c2d959e5c2626 (patch) | |
tree | 875020032a09c1618674958fae46f6780541e1c2 /module/plugins/hoster | |
parent | sharelinks.biz - closed #697 (but see #704), remove dead hosters (diff) | |
download | pyload-472870794ba8a9706f82cd79a22c2d959e5c2626.tar.xz |
update plugins - easybytez,filefactory,rusfolder,euroshare
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/BezvadataCz.py | 69 | ||||
-rw-r--r-- | module/plugins/hoster/DataportCz.py | 4 | ||||
-rw-r--r-- | module/plugins/hoster/EasybytezCom.py | 3 | ||||
-rw-r--r-- | module/plugins/hoster/EuroshareEu.py | 22 | ||||
-rw-r--r-- | module/plugins/hoster/FilefactoryCom.py | 8 | ||||
-rw-r--r-- | module/plugins/hoster/HotfileCom.py | 4 | ||||
-rw-r--r-- | module/plugins/hoster/IfolderRu.py | 10 |
7 files changed, 77 insertions, 43 deletions
diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py index 37ef145b2..cb9bae07c 100644 --- a/module/plugins/hoster/BezvadataCz.py +++ b/module/plugins/hoster/BezvadataCz.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- """ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ class BezvadataCz(SimpleHoster): __name__ = "BezvadataCz" __type__ = "hoster" __pattern__ = r"http://(\w*\.)*bezvadata.cz/stahnout/.*" - __version__ = "0.23" + __version__ = "0.24" __description__ = """BezvaData.cz""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -31,51 +31,64 @@ class BezvadataCz(SimpleHoster): FILE_NAME_PATTERN = r'<p><b>Soubor: (?P<N>[^<]+)</b></p>' FILE_SIZE_PATTERN = r'<li><strong>Velikost:</strong> (?P<S>[^<]+)</li>' FILE_OFFLINE_PATTERN = r'<title>BezvaData \| Soubor nenalezen</title>' - + def setup(self): self.multiDL = self.resumeDownload = True def handleFree(self): - #download button + #download button found = re.search(r'<a class="stahnoutSoubor".*?href="(.*?)"', self.html) if not found: self.parseError("page1 URL") - url = "http://bezvadata.cz%s" % found.group(1) - + url = "http://bezvadata.cz%s" % found.group(1) + #captcha form self.html = self.load(url) - if 'images/button-download-disable.png' in self.html: - self.longWait(300, 24) #parallel dl limit - action, inputs = self.parseHtmlForm('frm-stahnoutFreeForm') - if not inputs: self.parseError("FreeForm") - found = re.search(r'<img src="data:image/png;base64,(.*?)"', self.html) - if not found: self.parseError("captcha img") - - #captcha image is contained in html page as base64encoded data, not url - self.load, proper_load = self.loadcaptcha, self.load - try: - inputs['captcha'] = self.decryptCaptcha(found.group(1), imgtype='png') - finally: - self.load = proper_load + self.checkErrors() + for i in range(5): + action, inputs = self.parseHtmlForm('frm-stahnoutFreeForm') + if not inputs: self.parseError("FreeForm") + + found = re.search(r'<img src="data:image/png;base64,(.*?)"', self.html) + if not found: self.parseError("captcha img") + + #captcha image is contained in html page as base64encoded data but decryptCaptcha() expects image url + self.load, proper_load = self.loadcaptcha, self.load + try: + inputs['captcha'] = self.decryptCaptcha(found.group(1), imgtype='png') + finally: + self.load = proper_load + + if '<img src="data:image/png;base64' in self.html: + self.invalidCaptcha() + else: + self.correctCaptcha() + break + else: + self.fail("No valid captcha code entered") #download url - self.html = self.load("http://bezvadata.cz%s" % action, post=inputs) - if '<div class="infobox error"' in self.html: - self.tempOffline() + self.html = self.load("http://bezvadata.cz%s" % action, post=inputs) + self.checkErrors() found = re.search(r'<a class="stahnoutSoubor2" href="(.*?)">', self.html) if not found: self.parseError("page2 URL") url = "http://bezvadata.cz%s" % found.group(1) self.logDebug("DL URL %s" % url) - + #countdown found = re.search(r'id="countdown">(\d\d):(\d\d)<', self.html) - wait_time = (int(found.group(1)) * 60 + int(found.group(2)) + 1) if found else 120 + wait_time = (int(found.group(1)) * 60 + int(found.group(2)) + 1) if found else 120 self.setWait(wait_time, False) self.wait() - - self.download(url) - + + self.download(url) + + def checkErrors(self): + if 'images/button-download-disable.png' in self.html: + self.longWait(300, 24) #parallel dl limit + elif '<div class="infobox' in self.html: + self.tempOffline() + def loadcaptcha(self, data, *args, **kwargs): return data.decode("base64") getInfo = create_getInfo(BezvadataCz) -
\ No newline at end of file diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py index 952824ec9..3dc581bf1 100644 --- a/module/plugins/hoster/DataportCz.py +++ b/module/plugins/hoster/DataportCz.py @@ -23,8 +23,8 @@ from pycurl import FOLLOWLOCATION class DataportCz(SimpleHoster): __name__ = "DataportCz" __type__ = "hoster" - __pattern__ = r"http://.*dataport.cz/file/(\d+).*" - __version__ = "0.36" + __pattern__ = r"http://(?:.*?\.)?dataport.cz/file/(.*)" + __version__ = "0.37" __description__ = """Dataport.cz plugin - free only""" __author_name__ = ("zoidberg") diff --git a/module/plugins/hoster/EasybytezCom.py b/module/plugins/hoster/EasybytezCom.py index 5f3159b20..0deaa782e 100644 --- a/module/plugins/hoster/EasybytezCom.py +++ b/module/plugins/hoster/EasybytezCom.py @@ -25,7 +25,7 @@ class EasybytezCom(XFileSharingPro): __name__ = "EasybytezCom" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)?easybytez.com/(\w+).*" - __version__ = "0.11" + __version__ = "0.12" __description__ = """easybytez.com""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -38,6 +38,7 @@ class EasybytezCom(XFileSharingPro): DIRECT_LINK_PATTERN = r'(http://(\w+\.easybytez\.com|\d+\.\d+\.\d+\.\d+)/files/\d+/\w+/[^"<]+)' OVR_DOWNLOAD_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)' OVR_KILL_LINK_PATTERN = r'<h2>Delete Link</h2>\s*<textarea[^>]*>([^<]+)' + ERROR_PATTERN = r'(?:class=["\']err["\'][^>]*>|<Center><b>)(.*?)</' HOSTER_NAME = "easybytez.com" diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py index 448862f5b..97e6a989a 100644 --- a/module/plugins/hoster/EuroshareEu.py +++ b/module/plugins/hoster/EuroshareEu.py @@ -23,7 +23,7 @@ class EuroshareEu(SimpleHoster): __name__ = "EuroshareEu" __type__ = "hoster" __pattern__ = r"http://(\w*\.)?euroshare.(eu|sk|cz|hu|pl)/file/.*" - __version__ = "0.23" + __version__ = "0.24" __description__ = """Euroshare.eu""" __author_name__ = ("zoidberg") @@ -32,11 +32,29 @@ class EuroshareEu(SimpleHoster): FREE_URL_PATTERN = r'<a href="(/file/\d+/[^/]*/download/)"><div class="downloadButton"' ERR_PARDL_PATTERN = r'<h2>Prebieha s.ahovanie</h2>|<p>Naraz je z jednej IP adresy mo.n. s.ahova. iba jeden s.bor' + ERR_NOT_LOGGED_IN_PATTERN = r'href="/customer-zone/login/"' FILE_URL_REPLACEMENTS = [(r"(http://[^/]*\.)(sk|cz|hu|pl)/", r"\1eu/")] + def setup(self): + self.multiDL = self.resumeDownload = self.premium + self.req.setOption("timeout", 120) + def handlePremium(self): - self.download(self.pyfile.url.rstrip('/') + "/download/") + if self.ERR_NOT_LOGGED_IN_PATTERN in self.html: + self.account.relogin(user) + self.retry() + + self.download(self.pyfile.url.rstrip('/') + "/download/") + + check = self.checkDownload({"login": re.compile(self.ERR_NOT_LOGGED_IN_PATTERN), + "json": re.compile(r'\{"status":"error".*?"message":"(.*?)"') + }) + if check == "login" or (check == "json" and self.lastCheck.group(1) == "Access token expired"): + self.account.relogin(user) + self.retry() + elif check == "json": + self.fail(self.lastCheck.group(1)) def handleFree(self): if re.search(self.ERR_PARDL_PATTERN, self.html) is not None: diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 135dd90a1..0cd60ce85 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -35,7 +35,7 @@ class FilefactoryCom(Hoster): __name__ = "FilefactoryCom" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?filefactory\.com/file/(?P<id>[a-zA-Z0-9]+).*" # URLs given out are often longer but this is the requirement - __version__ = "0.34" + __version__ = "0.35" __description__ = """Filefactory.Com File Download Hoster""" __author_name__ = ("paulking", "zoidberg") @@ -112,13 +112,15 @@ class FilefactoryCom(Hoster): self.invalidCaptcha() else: self.fail("No valid captcha after 5 attempts") - + # This will take us to a wait screen waiturl = "http://www.filefactory.com" + response['path'] self.logDebug("Fetching wait with url [%s]" % waiturl) waithtml = self.load(waiturl, decode=True) + found = re.search(r'<a href="(http://www.filefactory.com/dlf/.*?)"', waithtml) + waithtml = self.load(found.group(1), decode=True) - # Find the wait value and wait + # Find the wait value and wait wait = int(re.search(self.WAIT_PATTERN, waithtml).group('wait')) self.logDebug("Waiting %d seconds." % wait) self.setWait(wait, True) diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py index d0268b3ab..902a5601b 100644 --- a/module/plugins/hoster/HotfileCom.py +++ b/module/plugins/hoster/HotfileCom.py @@ -31,8 +31,8 @@ def getInfo(urls): class HotfileCom(Hoster): __name__ = "HotfileCom" __type__ = "hoster" - __pattern__ = r"http://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+/" - __version__ = "0.35" + __pattern__ = r"https?://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+/" + __version__ = "0.36" __description__ = """Hotfile.com Download Hoster""" __author_name__ = ("sitacuisses","spoob","mkaay","JoKoT3") __author_mail__ = ("sitacuisses@yhoo.de","spoob@pyload.org","mkaay@mkaay.de","jokot3@gmail.com") diff --git a/module/plugins/hoster/IfolderRu.py b/module/plugins/hoster/IfolderRu.py index a21cc748b..6accbc524 100644 --- a/module/plugins/hoster/IfolderRu.py +++ b/module/plugins/hoster/IfolderRu.py @@ -24,8 +24,8 @@ from module.network.RequestFactory import getURL class IfolderRu(SimpleHoster): __name__ = "IfolderRu" __type__ = "hoster" - __pattern__ = r"http://(?:[^.]*\.)?(?:ifolder.ru|rusfolder.com)/(?P<ID>\d+).*" - __version__ = "0.36" + __pattern__ = r"http://(?:[^.]*\.)?(?:ifolder\.ru|rusfolder\.(?:com|net|ru))/(?:files/)?(?P<ID>\d+).*" + __version__ = "0.37" __description__ = """rusfolder.com / ifolder.ru""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -50,7 +50,7 @@ class IfolderRu(SimpleHoster): self.html = self.load("http://rusfolder.com/%s" % file_id, cookies=True, decode=True) self.getFileInfo() - url = "http://ints.rusfolder.com/ints/?rusfolder.com/%s?ints_code=" % file_id + url = re.search('<a href="(http://ints\..*?=)"', self.html).group(1) self.html = self.load(url, cookies=True, decode=True) url, session_id = re.search(self.SESSION_ID_PATTERN, self.html).groups() @@ -64,7 +64,7 @@ class IfolderRu(SimpleHoster): captcha_url = "http://ints.rusfolder.com/random/images/?session=%s" % session_id for i in range(5): - self.html = self.load(url, cookies=True) + self.html = self.load(url, cookies=True) action, inputs = self.parseHtmlForm('ID="Form1"') inputs['ints_session'] = re.search(self.INTS_SESSION_PATTERN, self.html).group(1) inputs[re.search(self.HIDDEN_INPUT_PATTERN, self.html).group(1)] = '1' @@ -80,7 +80,7 @@ class IfolderRu(SimpleHoster): else: self.fail("Invalid captcha") - self.html = self.load("http://rusfolder.com/%s?ints_code=%s" % (file_id, session_id), decode=True, cookies = True) + #self.html = self.load("http://rusfolder.com/%s?ints_code=%s" % (file_id, session_id), decode=True, cookies = True) download_url = re.search(self.DOWNLOAD_LINK_PATTERN, self.html).group(1) self.correctCaptcha() |