diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-06-16 17:31:38 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-06-24 22:40:32 +0200 |
commit | c1764e2fea0bb05164c83a876e8cd58b97f58f25 (patch) | |
tree | be1af8dbf5542d93f1cb97f07dd1793fc7acc2df /module/plugins/hoster | |
parent | [SimpleHoster] fixurl (diff) | |
download | pyload-c1764e2fea0bb05164c83a876e8cd58b97f58f25.tar.xz |
Update all
Diffstat (limited to 'module/plugins/hoster')
45 files changed, 79 insertions, 100 deletions
diff --git a/module/plugins/hoster/AndroidfilehostCom.py b/module/plugins/hoster/AndroidfilehostCom.py index 08005de0f..e5f2c7f88 100644 --- a/module/plugins/hoster/AndroidfilehostCom.py +++ b/module/plugins/hoster/AndroidfilehostCom.py @@ -46,8 +46,7 @@ class AndroidfilehostCom(SimpleHoster): html = self.load("https://www.androidfilehost.com/libs/otf/mirrors.otf.php", post={'submit': 'submit', 'action': 'getdownloadmirrors', - 'fid' : fid}, - decode=True) + 'fid' : fid}) self.link = re.findall('"url":"(.*?)"', html)[0].replace("\\", "") mirror_host = self.link.split("/")[2] @@ -57,8 +56,7 @@ class AndroidfilehostCom(SimpleHoster): html = self.load("https://www.androidfilehost.com/libs/otf/stats.otf.php", get={'fid' : fid, 'w' : 'download', - 'mirror': mirror_host}, - decode=True) + 'mirror': mirror_host}) getInfo = create_getInfo(AndroidfilehostCom) diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index e081c4fa9..de5bca207 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -5,7 +5,7 @@ import urllib import urlparse from module.network.HTTPRequest import BadHeader -from module.plugins.internal.SimpleHoster import create_getInfo, getFileURL +from module.plugins.internal.SimpleHoster import create_getInfo from module.plugins.internal.Hoster import Hoster @@ -50,7 +50,7 @@ class BasePlugin(Hoster): for _i in xrange(5): try: - link = getFileURL(self, urllib.unquote(pyfile.url)) + link = self.directLink(self, urllib.unquote(pyfile.url)) if link: self.download(link, ref=False, disposition=True) diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py index b47c2902d..d3f25d52f 100644 --- a/module/plugins/hoster/BezvadataCz.py +++ b/module/plugins/hoster/BezvadataCz.py @@ -81,7 +81,7 @@ class BezvadataCz(SimpleHoster): def checkErrors(self): if 'images/button-download-disable.png' in self.html: - self.longWait(5 * 60, 24) #: parallel dl limit + self.wait(5 * 60, 24, _("Download limit reached")) #: parallel dl limit elif '<div class="infobox' in self.html: self.tempOffline() else: diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index 5c709e4f7..f3d513adf 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -46,7 +46,7 @@ class BitshareCom(SimpleHoster): self.logDebug("File id is [%s]" % self.file_id) # Load main page - self.html = self.load(pyfile.url, ref=False, decode=True) + self.html = self.load(pyfile.url, ref=False) # Check offline if re.search(self.OFFLINE_PATTERN, self.html): diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index c966dbe1a..795da6229 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -21,8 +21,6 @@ class CatShareNet(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] - TEXT_ENCODING = True - INFO_PATTERN = r'<title>(?P<N>.+) \((?P<S>[\d.,]+) (?P<U>[\w^_]+)\)<' OFFLINE_PATTERN = r'<div class="alert alert-error"' diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index befd964bf..e3d89a2a5 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -44,7 +44,7 @@ class CzshareCom(SimpleHoster): m = re.search(self.USER_CREDIT_PATTERN, self.html) if m is None: self.account.relogin(self.user) - self.html = self.load(self.pyfile.url, decode=True) + self.html = self.load(self.pyfile.url) m = re.search(self.USER_CREDIT_PATTERN, self.html) if m is None: return False @@ -88,9 +88,9 @@ class CzshareCom(SimpleHoster): self.logDebug("PARSED_URL:" + parsed_url) # get download ticket and parse html - self.html = self.load(parsed_url, decode=True) + self.html = self.load(parsed_url) if re.search(self.MULTIDL_PATTERN, self.html): - self.longWait(5 * 60, 12) + self.wait(5 * 60, 12, _("Download limit reached")) try: form = re.search(self.FREE_FORM_PATTERN, self.html, re.S).group(1) @@ -105,13 +105,13 @@ class CzshareCom(SimpleHoster): captcha_url = 'http://sdilej.cz/captcha.php' for _i in xrange(5): inputs['captchastring2'] = self.decryptCaptcha(captcha_url) - self.html = self.load(parsed_url, post=inputs, decode=True) + self.html = self.load(parsed_url, post=inputs) if u"<li>Zadaný ověřovací kód nesouhlasí!</li>" in self.html: self.invalidCaptcha() elif re.search(self.MULTIDL_PATTERN, self.html): - self.longWait(5 * 60, 12) + self.wait(5 * 60, 12, _("Download limit reached")) else: self.correctCaptcha() @@ -150,7 +150,7 @@ class CzshareCom(SimpleHoster): self.resetAccount() elif check == "multi-dl": - self.longWait(5 * 60, 12) + self.wait(5 * 60, 12, _("Download limit reached")) elif check == "captcha": self.invalidCaptcha() diff --git a/module/plugins/hoster/DailymotionCom.py b/module/plugins/hoster/DailymotionCom.py index d70b29803..f9cc0d28e 100644 --- a/module/plugins/hoster/DailymotionCom.py +++ b/module/plugins/hoster/DailymotionCom.py @@ -117,7 +117,7 @@ class DailymotionCom(Hoster): self.checkInfo(pyfile) id = re.match(self.__pattern__, pyfile.url).group('ID') - self.html = self.load("http://www.dailymotion.com/embed/video/" + id, decode=True) + self.html = self.load("http://www.dailymotion.com/embed/video/" + id) streams = self.getStreams() quality = self.getQuality() diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py index ad514f5eb..1b4041c69 100644 --- a/module/plugins/hoster/DataportCz.py +++ b/module/plugins/hoster/DataportCz.py @@ -48,7 +48,7 @@ class DataportCz(SimpleHoster): elif check == "slot": self.logDebug("No free slots - wait 60s and retry") self.wait(60, False) - self.html = self.load(pyfile.url, decode=True) + self.html = self.load(pyfile.url) continue else: diff --git a/module/plugins/hoster/EdiskCz.py b/module/plugins/hoster/EdiskCz.py index b8485001e..96be21860 100644 --- a/module/plugins/hoster/EdiskCz.py +++ b/module/plugins/hoster/EdiskCz.py @@ -39,7 +39,7 @@ class EdiskCz(SimpleHoster): self.error(_("ACTION_PATTERN not found")) action = m.group(1) - self.html = self.load(url, decode=True) + self.html = self.load(url) self.getFileInfo() self.html = self.load(re.sub("/en/download/", "/en/download-slow/", url)) diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py index 857faebc5..c4bd54667 100644 --- a/module/plugins/hoster/EuroshareEu.py +++ b/module/plugins/hoster/EuroshareEu.py @@ -49,7 +49,7 @@ class EuroshareEu(SimpleHoster): def handleFree(self, pyfile): if re.search(self.ERR_PARDL_PATTERN, self.html): - self.longWait(5 * 60, 12) + self.wait(5 * 60, 12, _("Download limit reached")) m = re.search(self.LINK_FREE_PATTERN, self.html) if m is None: @@ -60,7 +60,7 @@ class EuroshareEu(SimpleHoster): def checkFile(self): if self.checkDownload({"multi-dl": re.compile(self.ERR_PARDL_PATTERN)}) - self.longWait(5 * 60, 12) + self.wait(5 * 60, 12, _("Download limit reached")) return super(EuroshareEu, self).checkFile() diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 3b876ed48..ecf656926 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -39,7 +39,7 @@ class FilerNet(SimpleHoster): if 'token' not in inputs: self.error(_("Unable to detect token")) - self.html = self.load(pyfile.url, post={'token': inputs['token']}, decode=True) + self.html = self.load(pyfile.url, post={'token': inputs['token']}) inputs = self.parseHtmlForm(input_names={'hash': re.compile(r'.+')})[1] if 'hash' not in inputs: diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 6ea1d6541..3f4c7d6ed 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -12,7 +12,7 @@ from module.utils import parseFileSize def checkFile(plugin, urls): - html = getURL(plugin.URLS[1], post={"urls": "\n".join(urls)}, decode=True) + html = getURL(plugin.URLS[1], post={"urls": "\n".join(urls)}) file_info = [] for li in re.finditer(plugin.LINKCHECK_TR, html, re.S): @@ -81,14 +81,13 @@ class FileserveCom(Hoster): def handleFree(self): self.html = self.load(self.url) - action = self.load(self.url, post={"checkDownload": "check"}, decode=True) + action = self.load(self.url, post={"checkDownload": "check"}) action = json_loads(action) self.logDebug(action) if "fail" in action: if action['fail'] == "timeLimit": - self.html = self.load(self.url, post={"checkDownload": "showError", "errorType": "timeLimit"}, - decode=True) + self.html = self.load(self.url, post={"checkDownload": "showError", "errorType": "timeLimit"}) self.doLongWait(re.search(self.LONG_WAIT_PATTERN, self.html)) @@ -110,7 +109,7 @@ class FileserveCom(Hoster): self.error(_("Unknown server response")) # show download link - res = self.load(self.url, post={"downloadLink": "show"}, decode=True) + res = self.load(self.url, post={"downloadLink": "show"}) self.logDebug("Show downloadLink response: %s" % res) if "fail" in res: self.error(_("Couldn't retrieve download url")) @@ -140,7 +139,7 @@ class FileserveCom(Hoster): def doTimmer(self): - res = self.load(self.url, post={"downloadLink": "wait"}, decode=True) + res = self.load(self.url, post={"downloadLink": "wait"}) self.logDebug("Wait response: %s" % res[:80]) if "fail" in res: @@ -191,8 +190,7 @@ class FileserveCom(Hoster): res = self.load("http://app.fileserve.com/api/download/premium/", post={"username": self.user, "password": self.account.getAccountData(self.user)['password'], - "shorten": self.file_id}, - decode=True) + "shorten": self.file_id}) if res: res = json_loads(res) if res['error_code'] == "302": diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 50128db10..717265014 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -11,8 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo def getInfo(urls): for url in urls: html = getURL("http://www.fshare.vn/check_link.php", - post={'action': "check_link", 'arrlinks': url}, - decode=True) + post={'action': "check_link", 'arrlinks': url}) yield parseFileInfo(FshareVn, url, html) @@ -45,15 +44,11 @@ class FshareVn(SimpleHoster): def preload(self): self.html = self.load("http://www.fshare.vn/check_link.php", - post={'action': "check_link", 'arrlinks': pyfile.url}, - decode=True) - - if isinstance(self.TEXT_ENCODING, basestring): - self.html = unicode(self.html, self.TEXT_ENCODING) + post={'action': "check_link", 'arrlinks': pyfile.url}) def handleFree(self, pyfile): - self.html = self.load(pyfile.url, decode=True) + self.html = self.load(pyfile.url) self.checkErrors() @@ -69,7 +64,7 @@ class FshareVn(SimpleHoster): if password: self.logInfo(_("Password protected link, trying ") + password) inputs['link_file_pwd_dl'] = password - self.html = self.load(url, post=inputs, decode=True) + self.html = self.load(url, post=inputs) if 'name="link_file_pwd_dl"' in self.html: self.fail(_("Incorrect password")) @@ -77,7 +72,7 @@ class FshareVn(SimpleHoster): self.fail(_("No password found")) else: - self.html = self.load(url, post=inputs, decode=True) + self.html = self.load(url, post=inputs) self.checkErrors() diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index adfb279e4..2e10de971 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -70,7 +70,7 @@ class Ftp(Hoster): pyfile.url += '/' self.req.http.c.setopt(48, 1) # CURLOPT_DIRLISTONLY res = self.load(pyfile.url, decode=False) - links = [pyfile.url + urllib.quote(x) for x in res.splitlines()] + links = [pyfile.url + x for x in res.splitlines()] self.logDebug("LINKS", links) self.core.api.addPackage(pkgname, links) else: diff --git a/module/plugins/hoster/GoogledriveCom.py b/module/plugins/hoster/GoogledriveCom.py index 1c33a1e4e..d658a8ba1 100644 --- a/module/plugins/hoster/GoogledriveCom.py +++ b/module/plugins/hoster/GoogledriveCom.py @@ -51,7 +51,7 @@ class GoogledriveCom(SimpleHoster): direct_link = self.directLink(link, False) if not direct_link: - self.html = self.load(link, decode=True) + self.html = self.load(link) else: self.link = direct_link break diff --git a/module/plugins/hoster/IfolderRu.py b/module/plugins/hoster/IfolderRu.py index 0f09731e4..5f3b4bb51 100644 --- a/module/plugins/hoster/IfolderRu.py +++ b/module/plugins/hoster/IfolderRu.py @@ -40,7 +40,7 @@ class IfolderRu(SimpleHoster): def handleFree(self, pyfile): url = "http://rusfolder.com/%s" % self.info['pattern']['ID'] - self.html = self.load("http://rusfolder.com/%s" % self.info['pattern']['ID'], decode=True) + self.html = self.load("http://rusfolder.com/%s" % self.info['pattern']['ID']) self.getFileInfo() session_id = re.search(self.SESSION_ID_PATTERN, self.html).groups() @@ -52,7 +52,7 @@ class IfolderRu(SimpleHoster): inputs['action'] = '1' self.logDebug(inputs) - self.html = self.load(url, decode=True, post=inputs) + self.html = self.load(url, post=inputs) if self.WRONG_CAPTCHA_PATTERN in self.html: self.invalidCaptcha() else: diff --git a/module/plugins/hoster/JumbofilesCom.py b/module/plugins/hoster/JumbofilesCom.py index a9bf14c6d..4812f0224 100644 --- a/module/plugins/hoster/JumbofilesCom.py +++ b/module/plugins/hoster/JumbofilesCom.py @@ -30,7 +30,7 @@ class JumbofilesCom(SimpleHoster): def handleFree(self, pyfile): post_data = {"id": self.info['pattern']['ID'], "op": "download3", "rand": ""} - html = self.load(self.pyfile.url, post=post_data, decode=True) + html = self.load(self.pyfile.url, post=post_data) self.link = re.search(self.LINK_FREE_PATTERN, html).group(1) diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 42547d658..a25c39b21 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -44,7 +44,7 @@ class KingfilesNet(SimpleHoster): 'referer' : "", 'method_free': "+"} - self.html = self.load(pyfile.url, post=post_data, decode=True) + self.html = self.load(pyfile.url, post=post_data) solvemedia = SolveMedia(self) response, challenge = solvemedia.challenge() @@ -67,7 +67,7 @@ class KingfilesNet(SimpleHoster): 'adcopy_challenge': challenge, 'down_direct' : "1"} - self.html = self.load(pyfile.url, post=post_data, decode=True) + self.html = self.load(pyfile.url, post=post_data) m = re.search(self.LINK_FREE_PATTERN, self.html) if m is None: diff --git a/module/plugins/hoster/LolabitsEs.py b/module/plugins/hoster/LolabitsEs.py index 61df5f0bb..8ad811248 100644 --- a/module/plugins/hoster/LolabitsEs.py +++ b/module/plugins/hoster/LolabitsEs.py @@ -40,7 +40,8 @@ class LolabitsEs(SimpleHoster): self.html = self.load("http://lolabits.es/action/License/Download", post={'fileId' : fileid, - '__RequestVerificationToken' : token}).decode('unicode-escape') + '__RequestVerificationToken' : token}, + decode="unicode-escape") self.link = HTMLParser.HTMLParser().unescape(re.search(self.LINK_PATTERN, self.html).group(1)) diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py index f4932d93d..293dab8f9 100644 --- a/module/plugins/hoster/LuckyShareNet.py +++ b/module/plugins/hoster/LuckyShareNet.py @@ -27,7 +27,7 @@ class LuckyShareNet(SimpleHoster): def parseJson(self, rep): if 'AJAX Error' in rep: - html = self.load(self.pyfile.url, decode=True) + html = self.load(self.pyfile.url) m = re.search(r"waitingtime = (\d+);", html) if m: seconds = int(m.group(1)) @@ -43,7 +43,7 @@ class LuckyShareNet(SimpleHoster): # TODO: There should be a filesize limit for free downloads # TODO: Some files could not be downloaded in free mode def handleFree(self, pyfile): - rep = self.load(r"http://luckyshare.net/download/request/type/time/file/" + self.info['pattern']['ID'], decode=True) + rep = self.load(r"http://luckyshare.net/download/request/type/time/file/" + self.info['pattern']['ID']) self.logDebug("JSON: " + rep) @@ -55,7 +55,7 @@ class LuckyShareNet(SimpleHoster): for _i in xrange(5): response, challenge = recaptcha.challenge() rep = self.load(r"http://luckyshare.net/download/verify/challenge/%s/response/%s/hash/%s" % - (challenge, response, json['hash']), decode=True) + (challenge, response, json['hash'])) self.logDebug("JSON: " + rep) if 'link' in rep: json.update(self.parseJson(rep)) diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index 09eb4705d..56f13362a 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -43,8 +43,7 @@ class MediafireCom(SimpleHoster): response, challenge = solvemedia.challenge(captcha_key) self.html = self.load("http://www.mediafire.com/?" + self.info['pattern']['ID'], post={'adcopy_challenge': challenge, - 'adcopy_response' : response}, - decode=True) + 'adcopy_response' : response}) return recaptcha = ReCaptcha(self) @@ -53,8 +52,7 @@ class MediafireCom(SimpleHoster): if captcha_key: response, challenge = recaptcha.challenge(captcha_key) self.html = self.load(self.pyfile.url, - post={'g-recaptcha-response': response}, - decode=True) + post={'g-recaptcha-response': response}) def handleFree(self, pyfile): diff --git a/module/plugins/hoster/MegaRapidCz.py b/module/plugins/hoster/MegaRapidCz.py index e17dd4730..ed6e0a3ad 100644 --- a/module/plugins/hoster/MegaRapidCz.py +++ b/module/plugins/hoster/MegaRapidCz.py @@ -15,7 +15,7 @@ def getInfo(urls): "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"]) for url in urls: - html = h.load(url, decode=True) + html = h.load(url) yield parseFileInfo(MegaRapidCz, url, html) diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index bbb77f525..2a5031f08 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -37,7 +37,7 @@ class MultishareCz(SimpleHoster): def handleMulti(self, pyfile): - self.html = self.load('http://www.multishare.cz/html/mms_ajax.php', post={"link": pyfile.url}, decode=True) + self.html = self.load('http://www.multishare.cz/html/mms_ajax.php', post={"link": pyfile.url}) self.checkInfo() diff --git a/module/plugins/hoster/NarodRu.py b/module/plugins/hoster/NarodRu.py index c201ac250..0a44cd6eb 100644 --- a/module/plugins/hoster/NarodRu.py +++ b/module/plugins/hoster/NarodRu.py @@ -44,7 +44,7 @@ class NarodRu(SimpleHoster): captcha_url, post_data['key'] = m.groups() post_data['rep'] = self.decryptCaptcha(captcha_url) - self.html = self.load(pyfile.url, post=post_data, decode=True) + self.html = self.load(pyfile.url, post=post_data) m = re.search(self.LINK_FREE_PATTERN, self.html) if m: diff --git a/module/plugins/hoster/NosuploadCom.py b/module/plugins/hoster/NosuploadCom.py index 241ee3a29..0b4af511c 100644 --- a/module/plugins/hoster/NosuploadCom.py +++ b/module/plugins/hoster/NosuploadCom.py @@ -26,14 +26,14 @@ class NosuploadCom(XFSHoster): def getDownloadLink(self): # stage1: press the "Free Download" button data = self.getPostParameters() - self.html = self.load(self.pyfile.url, post=data, decode=True) + self.html = self.load(self.pyfile.url, post=data) # stage2: wait some time and press the "Download File" button data = self.getPostParameters() wait_time = re.search(self.WAIT_PATTERN, self.html, re.M | re.S).group(1) self.logDebug("Hoster told us to wait %s seconds" % wait_time) self.wait(wait_time) - self.html = self.load(self.pyfile.url, post=data, decode=True) + self.html = self.load(self.pyfile.url, post=data) # stage3: get the download link return re.search(self.LINK_PATTERN, self.html, re.S).group(1) diff --git a/module/plugins/hoster/OboomCom.py b/module/plugins/hoster/OboomCom.py index 6c5d969f3..ae51d4b5a 100644 --- a/module/plugins/hoster/OboomCom.py +++ b/module/plugins/hoster/OboomCom.py @@ -48,7 +48,7 @@ class OboomCom(Hoster): def loadUrl(self, url, get=None): if get is None: get = dict() - return json_loads(self.load(url, get, decode=True)) + return json_loads(self.load(url, get)) def getFileId(self, url): diff --git a/module/plugins/hoster/PromptfileCom.py b/module/plugins/hoster/PromptfileCom.py index 3578ff7fb..4a1b07f05 100644 --- a/module/plugins/hoster/PromptfileCom.py +++ b/module/plugins/hoster/PromptfileCom.py @@ -35,7 +35,7 @@ class PromptfileCom(SimpleHoster): self.logDebug("Read chash %s" % chash) # continue to stage2 - self.html = self.load(pyfile.url, decode=True, post={'chash': chash}) + self.html = self.load(pyfile.url, post={'chash': chash}) # STAGE 2: get the direct link return super(PromptfileCom, self).handleFree(pyfile) diff --git a/module/plugins/hoster/QuickshareCz.py b/module/plugins/hoster/QuickshareCz.py index 1e0750b88..8cfb72c9a 100644 --- a/module/plugins/hoster/QuickshareCz.py +++ b/module/plugins/hoster/QuickshareCz.py @@ -25,7 +25,7 @@ class QuickshareCz(SimpleHoster): def process(self, pyfile): - self.html = self.load(pyfile.url, decode=True) + self.html = self.load(pyfile.url) self.getFileInfo() # parse js variables diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index bd6bb8582..e5298726c 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -65,7 +65,7 @@ class RapidgatorNet(SimpleHoster): try: json = self.load('%s/%s' % (self.API_URL, cmd), get={'sid': self.sid, - 'url': self.pyfile.url}, decode=True) + 'url': self.pyfile.url}) self.logDebug("API:%s" % cmd, json, "SID: %s" % self.sid) json = json_loads(json) status = json['response_status'] @@ -154,7 +154,7 @@ class RapidgatorNet(SimpleHoster): def getJsonResponse(self, url): - res = self.load(url, decode=True) + res = self.load(url) if not res.startswith('{'): self.retry() self.logDebug(url, res) diff --git a/module/plugins/hoster/RapiduNet.py b/module/plugins/hoster/RapiduNet.py index da353ec70..f2f1abfb7 100644 --- a/module/plugins/hoster/RapiduNet.py +++ b/module/plugins/hoster/RapiduNet.py @@ -43,8 +43,7 @@ class RapiduNet(SimpleHoster): jsvars = self.getJsonResponse("https://rapidu.net/ajax.php", get={'a': "getLoadTimeToDownload"}, - post={'_go': ""}, - decode=True) + post={'_go': ""}) if str(jsvars['timeToDownload']) is "stop": t = (24 * 60 * 60) - (int(time.time()) % (24 * 60 * 60)) + time.altzone @@ -64,8 +63,7 @@ class RapiduNet(SimpleHoster): post={'_go' : "", 'captcha1': challenge, 'captcha2': response, - 'fileId' : self.info['pattern']['ID']}, - decode=True) + 'fileId' : self.info['pattern']['ID']}) if jsvars['message'] == 'success': self.link = jsvars['url'] diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 4a7c022ed..47b6ba7da 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -41,8 +41,7 @@ class ShareonlineBiz(SimpleHoster): field = getURL("http://api.share-online.biz/linkcheck.php", get={'md5' : "1", - 'links': re.match(cls.__pattern__, url).group("ID")}, - decode=True).split(";") + 'links': re.match(cls.__pattern__, url).group("ID")}).split(";") try: if field[1] == "OK": @@ -93,8 +92,7 @@ class ShareonlineBiz(SimpleHoster): self.wait(3) self.html = self.load("%s/free/" % pyfile.url, - post={'dl_free': "1", 'choice': "free"}, - decode=True) + post={'dl_free': "1", 'choice': "free"}) self.checkErrors() diff --git a/module/plugins/hoster/ShareplaceCom.py b/module/plugins/hoster/ShareplaceCom.py index 906a8aa36..9e27aea1e 100644 --- a/module/plugins/hoster/ShareplaceCom.py +++ b/module/plugins/hoster/ShareplaceCom.py @@ -51,7 +51,7 @@ class ShareplaceCom(Hoster): def download_html(self): url = re.sub("shareplace.com\/\?", "shareplace.com//index1.php/?a=", self.pyfile.url) - self.html = self.load(url, decode=True) + self.html = self.load(url) def get_file_url(self): diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index dc32f22a1..a2fe32c5c 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -44,7 +44,7 @@ class StreamCz(Hoster): def process(self, pyfile): - self.html = self.load(pyfile.url, decode=True) + self.html = self.load(pyfile.url) if re.search(self.OFFLINE_PATTERN, self.html): self.offline() diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index a4c36bc2a..b70f9e72b 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -43,8 +43,7 @@ class TurbobitNet(SimpleHoster): def handleFree(self, pyfile): - self.html = self.load("http://turbobit.net/download/free/%s" % self.info['pattern']['ID'], - decode=True) + self.html = self.load("http://turbobit.net/download/free/%s" % self.info['pattern']['ID']) rtUpdate = self.getRtUpdate() diff --git a/module/plugins/hoster/TusfilesNet.py b/module/plugins/hoster/TusfilesNet.py index 87cf1e0fb..3afd1da97 100644 --- a/module/plugins/hoster/TusfilesNet.py +++ b/module/plugins/hoster/TusfilesNet.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from module.network.HTTPRequest import BadHeader +from module.plugins.internal.Plugin import Retry from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo diff --git a/module/plugins/hoster/UloziskoSk.py b/module/plugins/hoster/UloziskoSk.py index ad809b47c..81fdd21ed 100644 --- a/module/plugins/hoster/UloziskoSk.py +++ b/module/plugins/hoster/UloziskoSk.py @@ -30,7 +30,7 @@ class UloziskoSk(SimpleHoster): def process(self, pyfile): - self.html = self.load(pyfile.url, decode=True) + self.html = self.load(pyfile.url) self.getFileInfo() m = re.search(self.IMG_PATTERN, self.html) diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py index 283359927..b33c81ae7 100644 --- a/module/plugins/hoster/UploadableCh.py +++ b/module/plugins/hoster/UploadableCh.py @@ -34,13 +34,13 @@ class UploadableCh(SimpleHoster): def handleFree(self, pyfile): # Click the "free user" button and wait - a = self.load(pyfile.url, post={'downloadLink': "wait"}, decode=True) + a = self.load(pyfile.url, post={'downloadLink': "wait"}) self.logDebug(a) self.wait(30) # Make the recaptcha appear and show it the pyload interface - b = self.load(pyfile.url, post={'checkDownload': "check"}, decode=True) + b = self.load(pyfile.url, post={'checkDownload': "check"}) self.logDebug(b) #: Expected output: {"success":"showCaptcha"} recaptcha = ReCaptcha(self) @@ -51,13 +51,12 @@ class UploadableCh(SimpleHoster): self.load("http://www.uploadable.ch/checkReCaptcha.php", post={'recaptcha_challenge_field' : challenge, 'recaptcha_response_field' : response, - 'recaptcha_shortencode_field': self.info['pattern']['ID']}, - decode=True) + 'recaptcha_shortencode_field': self.info['pattern']['ID']}) self.wait(3) # Get ready for downloading - self.load(pyfile.url, post={'downloadLink': "show"}, decode=True) + self.load(pyfile.url, post={'downloadLink': "show"}) self.wait(3) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index cb8440687..46ed863d9 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -45,8 +45,7 @@ class UploadedTo(SimpleHoster): for _i in xrange(5): html = getURL("http://uploaded.net/api/filemultiple", - get={"apikey": cls.API_KEY, 'id_0': re.match(cls.__pattern__, url).group('ID')}, - decode=True) + get={"apikey": cls.API_KEY, 'id_0': re.match(cls.__pattern__, url).group('ID')}) if html != "can't find request": api = html.split(",", 4) @@ -69,7 +68,7 @@ class UploadedTo(SimpleHoster): def handleFree(self, pyfile): self.load("http://uploaded.net/language/en", just_header=True) - self.html = self.load("http://uploaded.net/js/download.js", decode=True) + self.html = self.load("http://uploaded.net/js/download.js") recaptcha = ReCaptcha(self) response, challenge = recaptcha.challenge() diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index d1cafcff4..efdcd81fe 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -35,7 +35,7 @@ class UploadingCom(SimpleHoster): if not "/get/" in pyfile.url: pyfile.url = pyfile.url.replace("/files", "/files/get") - self.html = self.load(pyfile.url, decode=True) + self.html = self.load(pyfile.url) self.getFileInfo() if self.premium: diff --git a/module/plugins/hoster/UpstoreNet.py b/module/plugins/hoster/UpstoreNet.py index 6410a2dce..e7b6d044f 100644 --- a/module/plugins/hoster/UpstoreNet.py +++ b/module/plugins/hoster/UpstoreNet.py @@ -36,7 +36,7 @@ class UpstoreNet(SimpleHoster): self.logDebug("Read hash " + chash) # continue to stage2 post_data = {'hash': chash, 'free': 'Slow download'} - self.html = self.load(pyfile.url, post=post_data, decode=True) + self.html = self.load(pyfile.url, post=post_data) # STAGE 2: solv captcha and wait # first get the infos we need: recaptcha key and wait time @@ -57,7 +57,7 @@ class UpstoreNet(SimpleHoster): post_data.update({'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response}) - self.html = self.load(pyfile.url, post=post_data, decode=True) + self.html = self.load(pyfile.url, post=post_data) # STAGE 3: get direct link m = re.search(self.LINK_FREE_PATTERN, self.html, re.S) diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index b263c445f..dc774ecf6 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -39,7 +39,7 @@ class VimeoCom(SimpleHoster): password = self.getPassword() if self.js and 'class="btn iconify_down_b"' in self.html: - html = self.js.eval(self.load(pyfile.url, get={'action': "download", 'password': password}, decode=True)) + html = self.js.eval(self.load(pyfile.url, get={'action': "download", 'password': password})) pattern = r'href="(?P<URL>http://vimeo\.com.+?)".*?\>(?P<QL>.+?) ' else: html = self.load("https://player.vimeo.com/video/" + self.info['pattern']['ID'], get={'password': password}) diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index c898d23ab..6aac44df6 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -27,8 +27,7 @@ class WebshareCz(SimpleHoster): info['pattern'] = re.match(cls.__pattern__, url).groupdict() api_data = getURL("https://webshare.cz/api/file_info/", - post={'ident': info['pattern']['ID'], 'wst': ""}, - decode=True) + post={'ident': info['pattern']['ID'], 'wst': ""}) if not re.search(r'<status>OK', api_data): info['status'] = 1 @@ -44,8 +43,7 @@ class WebshareCz(SimpleHoster): wst = self.account.getAccountData(self.user).get('wst', None) if self.account else None api_data = getURL("https://webshare.cz/api/file_link/", - post={'ident': self.info['pattern']['ID'], 'wst': wst}, - decode=True) + post={'ident': self.info['pattern']['ID'], 'wst': wst}) self.logDebug("API data: " + api_data) diff --git a/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py index b6f7466b5..efe3b6d6b 100644 --- a/module/plugins/hoster/Xdcc.py +++ b/module/plugins/hoster/Xdcc.py @@ -34,7 +34,7 @@ class Xdcc(Hoster): def process(self, pyfile): # change request type - self.req = pyfile.m.core.requestFactory.getRequest(self.__name__, type="XDCC") + self.req = self.core.requestFactory.getRequest(self.__name__, type="XDCC") self.pyfile = pyfile for _i in xrange(0, 3): diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 451a4f6c8..e53a66d00 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -6,7 +6,7 @@ import subprocess import urllib from module.plugins.internal.Hoster import Hoster -from module.plugins.internal.SimpleHoster import replace_patterns +from module.plugins.internal.Plugin import replace_patterns from module.utils import html_unescape @@ -85,7 +85,7 @@ class YoutubeCom(Hoster): def process(self, pyfile): pyfile.url = replace_patterns(pyfile.url, self.URL_REPLACEMENTS) - html = self.load(pyfile.url, decode=True) + html = self.load(pyfile.url) if re.search(r'<div id="player-unavailable" class="\s*player-width player-height\s*">', html): self.offline() diff --git a/module/plugins/hoster/ZDF.py b/module/plugins/hoster/ZDF.py index 76cf9ec56..2a4708a0d 100644 --- a/module/plugins/hoster/ZDF.py +++ b/module/plugins/hoster/ZDF.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from xml.etree.ElementTree import fromstring +import xml.etree.ElementTree as etree from module.plugins.internal.Hoster import Hoster @@ -42,7 +41,7 @@ class ZDF(Hoster): def process(self, pyfile): - xml = fromstring(self.load(self.XML_API % self.get_id(pyfile.url))) + xml = etree.fromstring(self.load(self.XML_API % self.get_id(pyfile.url))) status = xml.findtext("./status/statuscode") if status != "ok": |