diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 34723aed..6f3a2a7c 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -165,10 +165,10 @@ def sanitizeFileName(name): return name -def getURL(url, post_data=None, headers=None, params=None, json=False): +def getURL(url, post_data=None, headers=None, params=None, timeout=30, json=False): + """ + Returns a byte-string retrieved from the url provider. """ -Returns a byte-string retrieved from the url provider. -""" global session if not session: @@ -191,11 +191,11 @@ Returns a byte-string retrieved from the url provider. proxies = { "http": sickbeard.PROXY_SETTING, "https": sickbeard.PROXY_SETTING, - } + } - r = session.get(url, params=params, data=post_data, headers=dict(zip(it, it)), proxies=proxies, verify=False) + r = session.get(url, params=params, data=post_data, headers=dict(zip(it, it)), proxies=proxies, timeout=timeout, verify=False) else: - r = session.get(url, params=params, data=post_data, headers=dict(zip(it, it)), verify=False) + r = session.get(url, params=params, data=post_data, headers=dict(zip(it, it)), timeout=timeout, verify=False) except requests.HTTPError, e: logger.log(u"HTTP error " + str(e.errno) + " while loading URL " + url, logger.WARNING) return None diff --git a/sickbeard/nzbget.py b/sickbeard/nzbget.py index e53d0a89..019465b3 100644 --- a/sickbeard/nzbget.py +++ b/sickbeard/nzbget.py @@ -51,8 +51,7 @@ def sendNZB(nzb, proper=False): if nzbGetRPC.writelog("INFO", "Sickbeard connected to drop of %s any moment now." % (nzb.name + ".nzb")): logger.log(u"Successful connected to NZBget", logger.DEBUG) else: - logger.log(u"Successful connected to NZBget, but unable to send a message" % (nzb.name + ".nzb"), - logger.ERROR) + logger.log(u"Successful connected to NZBget, but unable to send a message", logger.ERROR) except httplib.socket.error: logger.log(