diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-07-18 20:04:36 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-07-18 20:04:36 +0200 |
commit | 9e5d813d7721e351ac02ba72bdc473a7d77ba6b7 (patch) | |
tree | 1a5167cea6492283bfb679c4efdb4c13534d844f /module/plugins/hoster | |
parent | Reorder some functions (diff) | |
download | pyload-9e5d813d7721e351ac02ba72bdc473a7d77ba6b7.tar.xz |
Code cosmetics
Diffstat (limited to 'module/plugins/hoster')
29 files changed, 62 insertions, 79 deletions
diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py index 46379bdc9..73df734dd 100644 --- a/module/plugins/hoster/AlldebridCom.py +++ b/module/plugins/hoster/AlldebridCom.py @@ -5,7 +5,7 @@ import urllib from module.common.json_layer import json_loads from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo -from module.utils import parseFileSize +from module.utils import parseFileSize as parse_size class AlldebridCom(MultiHoster): @@ -43,7 +43,7 @@ class AlldebridCom(MultiHoster): else: if pyfile.name and not pyfile.name.endswith('.tmp'): pyfile.name = data['filename'] - pyfile.size = parseFileSize(data['filesize']) + pyfile.size = parse_size(data['filesize']) self.link = data['link'] diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 909b350c9..ed8c8b32c 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -97,7 +97,7 @@ class BasePlugin(Hoster): except Exception: pass - self.log_warning("Check result: " + errmsg, "Waiting 1 minute and retry") + self.log_warning(_("Check result: ") + errmsg, _("Waiting 1 minute and retry")) self.retry(3, 60, errmsg) diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 0e28f31dd..d44b4046f 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -6,7 +6,7 @@ import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.utils import parseFileSize +from module.utils import parseFileSize as parse_size class CzshareCom(SimpleHoster): @@ -51,7 +51,7 @@ class CzshareCom(SimpleHoster): #: check user credit try: - credit = parseFileSize(m.group(1).replace(' ', ''), m.group(2)) + credit = parse_size(m.group(1).replace(' ', ''), m.group(2)) self.log_info(_("Premium download for %i KiB of Credit") % (self.pyfile.size / 1024)) self.log_info(_("User %s has %i KiB left") % (self.user, credit / 1024)) if credit < self.pyfile.size: diff --git a/module/plugins/hoster/DailymotionCom.py b/module/plugins/hoster/DailymotionCom.py index 18f84ff56..f549bbd79 100644 --- a/module/plugins/hoster/DailymotionCom.py +++ b/module/plugins/hoster/DailymotionCom.py @@ -4,7 +4,7 @@ import re from module.PyFile import statusMap from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL +from module.network.RequestFactory import getURL as get_url from module.plugins.internal.Hoster import Hoster @@ -16,7 +16,7 @@ def get_info(urls): for url in urls: id = regex.match(url).group('ID') - html = getURL(apiurl % id, get=request) + html = get_url(apiurl % id, get=request) info = json_loads(html) name = info['title'] + ".mp4" if "title" in info else url diff --git a/module/plugins/hoster/DlFreeFr.py b/module/plugins/hoster/DlFreeFr.py index f8c684ed4..dd3325f0f 100644 --- a/module/plugins/hoster/DlFreeFr.py +++ b/module/plugins/hoster/DlFreeFr.py @@ -35,7 +35,7 @@ class CustomBrowser(Browser): class DlFreeFr(SimpleHoster): __name__ = "DlFreeFr" __type__ = "hoster" - __version__ = "0.31" + __version__ = "0.32" __pattern__ = r'http://(?:www\.)?dl\.free\.fr/(\w+|getfile\.pl\?file=/\w+)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -98,7 +98,7 @@ class DlFreeFr(SimpleHoster): headers = self.get_last_headers() if headers.get("code") == 302 and "set-cookie" in headers and "location" in headers: m = re.search("(.*?)=(.*?); path=(.*?); domain=(.*)", headers.get("set-cookie")) - cj = CookieJar(__name__) + cj = CookieJar(self.__name__) if m: cj.setCookie(m.group(4), m.group(1), m.group(2), m.group(3)) else: diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 8d7409824..70f1e3bab 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -3,18 +3,18 @@ import re import urlparse -from module.network.RequestFactory import getURL -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo +from module.network.RequestFactory import getURL as get_url +from module.plugins.internal.SimpleHoster import SimpleHoster, parse_fileInfo def get_info(urls): for url in urls: - h = getURL(url, just_header=True) + h = get_url(url, just_header=True) m = re.search(r'Location: (.+)\r\n', h) if m and not re.match(m.group(1), FilefactoryCom.__pattern__): #: It's a direct link! Skipping yield (url, 0, 3, url) else: #: It's a standard html page - yield parseFileInfo(FilefactoryCom, url, getURL(url)) + yield parse_fileInfo(FilefactoryCom, url, get_url(url)) class FilefactoryCom(SimpleHoster): diff --git a/module/plugins/hoster/FilesMailRu.py b/module/plugins/hoster/FilesMailRu.py index 71ef231b1..df6b8a2ad 100644 --- a/module/plugins/hoster/FilesMailRu.py +++ b/module/plugins/hoster/FilesMailRu.py @@ -2,7 +2,7 @@ import re -from module.network.RequestFactory import getURL +from module.network.RequestFactory import getURL as get_url from module.plugins.internal.Hoster import Hoster from module.plugins.internal.Plugin import chunks @@ -11,7 +11,7 @@ def get_info(urls): result = [] for chunk in chunks(urls, 10): for url in chunk: - html = getURL(url) + html = get_url(url) if r'<div class="errorMessage mb10">' in html: result.append((url, 0, 1, url)) elif r'Page cannot be displayed' in html: @@ -73,8 +73,7 @@ class FilesMailRu(Hoster): """ You have to wait some seconds. Otherwise you will get a 40Byte HTML Page instead of the file you expected """ - self.set_wait(10) - self.wait() + self.wait(10) return True diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 5a792a425..f38de699e 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -3,16 +3,16 @@ import re from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL +from module.network.RequestFactory import getURL as get_url from module.plugins.internal.Hoster import Hoster from module.plugins.internal.Plugin import chunks from module.plugins.internal.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import seconds_to_midnight -from module.utils import parseFileSize +from module.utils import parseFileSize as parse_size def check_file(plugin, urls): - html = getURL(plugin.URLS[1], post={"urls": "\n".join(urls)}) + html = get_url(plugin.URLS[1], post={"urls": "\n".join(urls)}) file_info = [] for li in re.finditer(plugin.LINKCHECK_TR, html, re.S): @@ -21,7 +21,7 @@ def check_file(plugin, urls): if cols: file_info.append(( cols[1] if cols[1] != '--' else cols[0], - parseFileSize(cols[2]) if cols[2] != '--' else 0, + parse_size(cols[2]) if cols[2] != '--' else 0, 2 if cols[3].startswith('Available') else 1, cols[0])) except Exception, e: @@ -131,8 +131,7 @@ class FileserveCom(Hoster): elif check == "limit": self.log_warning(_("Download limited reached for today")) - self.set_wait(seconds_to_midnight(gmt=2), True) - self.wait() + self.wait(seconds_to_midnight(gmt=2), True) self.retry() self.thread.m.reconnecting.wait(3) #: Ease issue with later downloads appearing to be in parallel @@ -153,8 +152,7 @@ class FileserveCom(Hoster): else: wait_time = int(res) + 3 - self.set_wait(wait_time) - self.wait() + self.wait(wait_time) def do_captcha(self): @@ -178,8 +176,7 @@ class FileserveCom(Hoster): def do_long_wait(self, m): wait_time = (int(m.group(1)) * {'seconds': 1, 'minutes': 60, 'hours': 3600}[m.group(2)]) if m else 12 * 60 - self.set_wait(wait_time, True) - self.wait() + self.wait(wait_time, True) self.retry() diff --git a/module/plugins/hoster/FlyFilesNet.py b/module/plugins/hoster/FlyFilesNet.py index 63cabda66..28c4ce813 100644 --- a/module/plugins/hoster/FlyFilesNet.py +++ b/module/plugins/hoster/FlyFilesNet.py @@ -3,7 +3,6 @@ import re import urllib -from module.network.RequestFactory import getURL from module.plugins.internal.SimpleHoster import SimpleHoster @@ -32,7 +31,7 @@ class FlyFilesNet(SimpleHoster): url = "http://flyfiles.net" #: get download URL - parsed_url = getURL(url, post={"getDownLink": session}) + parsed_url = self.load(url, post={"getDownLink": session}) self.log_debug("Parsed URL: %s" % parsed_url) if parsed_url == '#downlink|' or parsed_url == "#downlink|#": diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 86dc45585..135315197 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -53,8 +53,7 @@ class FreakshareCom(Hoster): self.fail(_("Bad Try")) elif check == "paralell": - self.set_wait(300, True) - self.wait() + self.wait(300, True) self.retry() elif check == "empty": diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 7e1d573d8..3ece85c96 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -4,16 +4,16 @@ import re import time import urlparse -from module.network.RequestFactory import getURL -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo +from module.network.RequestFactory import getURL as get_url +from module.plugins.internal.SimpleHoster import SimpleHoster, parse_fileInfo def get_info(urls): for url in urls: - html = getURL("http://www.fshare.vn/check_link.php", + html = get_url("http://www.fshare.vn/check_link.php", post={'action': "check_link", 'arrlinks': url}) - yield parseFileInfo(FshareVn, url, html) + yield parse_fileInfo(FshareVn, url, html) def double_decode(m): diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py index 15a46066a..061311bab 100644 --- a/module/plugins/hoster/LetitbitNet.py +++ b/module/plugins/hoster/LetitbitNet.py @@ -10,14 +10,14 @@ import re import urlparse from module.common.json_layer import json_loads, json_dumps -from module.network.RequestFactory import getURL +from module.network.RequestFactory import getURL as get_url from module.plugins.internal.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, seconds_to_midnight def api_response(url): json_data = ["yw7XQy2v9", ["download/info", {"link": url}]] - api_rep = getURL("http://api.letitbit.net/json", + api_rep = get_url("http://api.letitbit.net/json", post={'r': json_dumps(json_data)}) return json_loads(api_rep) diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py index ec5e87f12..4f10b8eed 100644 --- a/module/plugins/hoster/LuckyShareNet.py +++ b/module/plugins/hoster/LuckyShareNet.py @@ -2,8 +2,7 @@ import re -from bottle import json_loads - +from module.common.json_layer import json_loads from module.plugins.internal.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo diff --git a/module/plugins/hoster/MegaRapidCz.py b/module/plugins/hoster/MegaRapidCz.py index e00efc1a9..a5feb5668 100644 --- a/module/plugins/hoster/MegaRapidCz.py +++ b/module/plugins/hoster/MegaRapidCz.py @@ -4,19 +4,19 @@ import pycurl import re from module.network.HTTPRequest import BadHeader -from module.network.RequestFactory import getRequest -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo +from module.network.RequestFactory import getRequest as get_request +from module.plugins.internal.SimpleHoster import SimpleHoster, parse_fileInfo def get_info(urls): - h = getRequest() + h = get_request() h.c.setopt(pycurl.HTTPHEADER, ["Accept: text/html", "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) - yield parseFileInfo(MegaRapidCz, url, html) + yield parse_fileInfo(MegaRapidCz, url, html) class MegaRapidCz(SimpleHoster): diff --git a/module/plugins/hoster/OboomCom.py b/module/plugins/hoster/OboomCom.py index 190b04814..37dce3750 100644 --- a/module/plugins/hoster/OboomCom.py +++ b/module/plugins/hoster/OboomCom.py @@ -87,8 +87,7 @@ class OboomCom(Hoster): self.download_token = result[1] self.download_auth = result[2] self.correct_captcha() - self.set_wait(30) - self.wait() + self.wait(30) break elif result[0] == 400: diff --git a/module/plugins/hoster/OverLoadMe.py b/module/plugins/hoster/OverLoadMe.py index 1d2650887..cb10e9500 100644 --- a/module/plugins/hoster/OverLoadMe.py +++ b/module/plugins/hoster/OverLoadMe.py @@ -5,7 +5,7 @@ import urllib from module.common.json_layer import json_loads from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo -from module.utils import parseFileSize +from module.utils import parseFileSize as parse_size class OverLoadMe(MultiHoster): @@ -43,7 +43,7 @@ class OverLoadMe(MultiHoster): self.link = data['downloadlink'] if pyfile.name and pyfile.name.endswith('.tmp') and data['filename']: pyfile.name = data['filename'] - pyfile.size = parseFileSize(data['filesize']) + pyfile.size = parse_size(data['filesize']) getInfo = create_getInfo(OverLoadMe) diff --git a/module/plugins/hoster/RPNetBiz.py b/module/plugins/hoster/RPNetBiz.py index d151ce5e7..a449ed276 100644 --- a/module/plugins/hoster/RPNetBiz.py +++ b/module/plugins/hoster/RPNetBiz.py @@ -40,8 +40,7 @@ class RPNetBiz(MultiHoster): #: Check if we only have an id as a HDD link if 'id' in link_status: self.log_debug("Need to wait at least 30 seconds before requery") - self.set_wait(30) #: wait for 30 seconds - self.wait() + self.wait(30) #: wait for 30 seconds #: Lets query the server again asking for the status on the link, #: we need to keep doing this until we reach 100 max_tries = 30 @@ -63,8 +62,7 @@ class RPNetBiz(MultiHoster): else: self.log_debug("At %s%% for the file download" % download_status['status']) - self.set_wait(30) - self.wait() + self.wait(30) my_try += 1 if my_try > max_tries: #: We went over the limit! diff --git a/module/plugins/hoster/RapiduNet.py b/module/plugins/hoster/RapiduNet.py index 30e453b93..1489b49f0 100644 --- a/module/plugins/hoster/RapiduNet.py +++ b/module/plugins/hoster/RapiduNet.py @@ -48,7 +48,7 @@ class RapiduNet(SimpleHoster): if str(jsvars['timeToDownload']) is "stop": t = (24 * 60 * 60) - (int(time.time()) % (24 * 60 * 60)) + time.altzone - self.log_info("You've reach your daily download transfer") + self.log_info(_("You've reach your daily download transfer")) self.retry(10, 10 if t < 1 else None, _("Try tomorrow again")) #@NOTE: check t in case of not synchronised clock diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 812598f77..22eabae95 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -6,7 +6,7 @@ import urllib from module.common.json_layer import json_loads from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo -from module.utils import parseFileSize +from module.utils import parseFileSize as parse_size class RealdebridCom(MultiHoster): @@ -45,7 +45,7 @@ class RealdebridCom(MultiHoster): else: if pyfile.name and pyfile.name.endswith('.tmp') and data['file_name']: pyfile.name = data['file_name'] - pyfile.size = parseFileSize(data['file_size']) + pyfile.size = parse_size(data['file_size']) self.link = data['generated_links'][0][-1] diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 413c796bb..53b3d4ae8 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -5,7 +5,7 @@ import time import urllib import urlparse -from module.network.RequestFactory import getURL +from module.network.RequestFactory import getURL as get_url from module.plugins.internal.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -39,7 +39,7 @@ class ShareonlineBiz(SimpleHoster): def api_info(cls, url): info = super(ShareonlineBiz, cls).api_info(url) - field = getURL("http://api.share-online.biz/linkcheck.php", + field = get_url("http://api.share-online.biz/linkcheck.php", get={'md5' : "1", 'links': re.match(cls.__pattern__, url).group("ID")}).split(";") @@ -160,7 +160,7 @@ class ShareonlineBiz(SimpleHoster): try: self.log_error(errmsg, re.search(self.ERROR_PATTERN, self.html).group(1)) except Exception: - self.log_error("Unknown error occurred", errmsg) + self.log_error(_("Unknown error occurred"), errmsg) if errmsg is "invalid": self.fail(_("File not available")) diff --git a/module/plugins/hoster/ShareplaceCom.py b/module/plugins/hoster/ShareplaceCom.py index d917e3f35..caafe7952 100644 --- a/module/plugins/hoster/ShareplaceCom.py +++ b/module/plugins/hoster/ShareplaceCom.py @@ -30,9 +30,7 @@ class ShareplaceCom(Hoster): self.pyfile.name = self.get_file_name() - wait_time = self.get_waiting_time() - self.set_wait(wait_time) - self.wait() + self.wait(self.get_waiting_time()) def get_waiting_time(self): diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index e2ae0ab83..cd62cbcf9 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -2,7 +2,7 @@ import re -from module.network.RequestFactory import getURL +from module.network.RequestFactory import getURL as get_url from module.plugins.internal.Hoster import Hoster @@ -11,7 +11,7 @@ def get_info(urls): for url in urls: - html = getURL(url) + html = get_url(url) if re.search(StreamCz.OFFLINE_PATTERN, html): #: File offline result.append((url, 0, 1, url)) diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index e4ff000b2..46b15169b 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -9,7 +9,6 @@ import urllib from Crypto.Cipher import ARC4 -from module.network.RequestFactory import getURL from module.plugins.internal.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp @@ -101,7 +100,7 @@ class TurbobitNet(SimpleHoster): if self.retrieve("version") != self.__version__ \ or int(self.retrieve("timestamp", 0)) + 86400000 < timestamp(): #: that's right, we are even using jdownloader updates - rtUpdate = getURL("http://update0.jdownloader.org/pluginstuff/tbupdate.js") + rtUpdate = self.load("http://update0.jdownloader.org/pluginstuff/tbupdate.js") rtUpdate = self.decrypt(rtUpdate.splitlines()[1]) #: but we still need to fix the syntax to work with other engines than rhino rtUpdate = re.sub(r'for each\(var (\w+) in(\[[^\]]+\])\)\{', diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py index 21d9f298e..6f589efa3 100644 --- a/module/plugins/hoster/UploadableCh.py +++ b/module/plugins/hoster/UploadableCh.py @@ -66,7 +66,7 @@ class UploadableCh(SimpleHoster): def check_file(self): if self.check_download({'wait': re.compile("Please wait for")}): - self.log_info("Downloadlimit reached, please wait or reconnect") + self.log_info(_("Downloadlimit reached, please wait or reconnect")) self.wait(60 * 60, True) self.retry() diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 32b54d1ae..e8c317296 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -4,7 +4,7 @@ import re import time import urlparse -from module.network.RequestFactory import getURL +from module.network.RequestFactory import getURL as get_url from module.plugins.internal.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -44,7 +44,7 @@ class UploadedTo(SimpleHoster): info = super(UploadedTo, cls).api_info(url) for _i in xrange(5): - html = getURL("http://uploaded.net/api/filemultiple", + html = get_url("http://uploaded.net/api/filemultiple", get={"apikey": cls.API_KEY, 'id_0': re.match(cls.__pattern__, url).group('ID')}) if html != "can't find request": diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index b650e9219..feea234f3 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -2,7 +2,7 @@ import re -from module.network.RequestFactory import getURL +from module.network.RequestFactory import getURL as get_url from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -26,7 +26,7 @@ class WebshareCz(SimpleHoster): info['pattern'] = re.match(cls.__pattern__, url).groupdict() - api_data = getURL("https://webshare.cz/api/file_info/", + api_data = get_url("https://webshare.cz/api/file_info/", post={'ident': info['pattern']['ID'], 'wst': ""}) if not re.search(r'<status>OK', api_data): @@ -42,7 +42,7 @@ class WebshareCz(SimpleHoster): def handle_free(self, pyfile): wst = self.account.get_account_data(self.user).get('wst', None) if self.account else None - api_data = getURL("https://webshare.cz/api/file_link/", + api_data = get_url("https://webshare.cz/api/file_link/", post={'ident': self.info['pattern']['ID'], 'wst': wst}) self.log_debug("API data: " + api_data) diff --git a/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py index d78794f99..0e200307e 100644 --- a/module/plugins/hoster/Xdcc.py +++ b/module/plugins/hoster/Xdcc.py @@ -50,8 +50,7 @@ class Xdcc(Hoster): if errno == 10054: self.log_debug("Server blocked our ip, retry in 5 min") - self.set_wait(300) - self.wait() + self.wait(300) continue self.fail(_("Failed due to socket errors. Code: %d") % errno) @@ -91,8 +90,7 @@ class Xdcc(Hoster): sock.send("NICK %s\r\n" % nick) sock.send("USER %s %s bla :%s\r\n" % (ident, host, real)) - self.set_wait(3) - self.wait() + self.wait(3) sock.send("JOIN #%s\r\n" % chan) sock.send("PRIVMSG %s :xdcc send #%s\r\n" % (bot, pack)) diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index c6e106027..0b631fb23 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -31,9 +31,7 @@ class YourfilesTo(Hoster): self.pyfile.name = self.get_file_name() - wait_time = self.get_waiting_time() - self.set_wait(wait_time) - self.wait() + self.wait(self.get_waiting_time()) def get_waiting_time(self): diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index 80d495f78..48c17ea5f 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -3,7 +3,7 @@ import re import urllib -from BeautifulSoup import BeautifulSoup +import BeautifulSoup from module.plugins.internal.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -59,7 +59,7 @@ class ZippyshareCom(SimpleHoster): def get_link(self): #: get all the scripts inside the html body - soup = BeautifulSoup(self.html) + soup = BeautifulSoup.BeautifulSoup(self.html) scripts = (s.getText().strip() for s in soup.body.findAll('script', type='text/javascript')) #: meant to be populated with the initialization of all the DOM elements found in the scripts |