Merge branch 'develop'
This commit is contained in:
commit
568e42e2f3
3 files changed
+9
-10
No files matched your search
@@ -183,7 +183,7 @@ class Base(NZBProvider, RSS):
|
|||||||
return 'try_next'
|
return 'try_next'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data = self.urlopen(url, show_error = False)
|
data = self.urlopen(url, show_error = False, headers = {'User-Agent': Env.getIdentifier()})
|
||||||
self.limits_reached[host] = False
|
self.limits_reached[host] = False
|
||||||
return data
|
return data
|
||||||
except HTTPError as e:
|
except HTTPError as e:
|
||||||
|
|||||||
@@ -149,16 +149,15 @@ class CoreNotifier(Notification):
|
|||||||
def notify(self, message = '', data = None, listener = None):
|
def notify(self, message = '', data = None, listener = None):
|
||||||
if not data: data = {}
|
if not data: data = {}
|
||||||
|
|
||||||
|
n = {
|
||||||
|
'_t': 'notification',
|
||||||
|
'time': int(time.time()),
|
||||||
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
db = get_db()
|
db = get_db()
|
||||||
|
|
||||||
data['notification_type'] = listener if listener else 'unknown'
|
n['message'] = toUnicode(message)
|
||||||
|
|
||||||
n = {
|
|
||||||
'_t': 'notification',
|
|
||||||
'time': int(time.time()),
|
|
||||||
'message': toUnicode(message)
|
|
||||||
}
|
|
||||||
|
|
||||||
if data.get('sticky'):
|
if data.get('sticky'):
|
||||||
n['sticky'] = True
|
n['sticky'] = True
|
||||||
@@ -171,7 +170,7 @@ class CoreNotifier(Notification):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
log.error('Failed notify: %s', traceback.format_exc())
|
log.error('Failed notify "%s": %s', (n, traceback.format_exc()))
|
||||||
|
|
||||||
def frontend(self, type = 'notification', data = None, message = None):
|
def frontend(self, type = 'notification', data = None, message = None):
|
||||||
if not data: data = {}
|
if not data: data = {}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class Plugin(object):
|
|||||||
|
|
||||||
_locks = {}
|
_locks = {}
|
||||||
|
|
||||||
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20130519 Firefox/24.0'
|
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0'
|
||||||
http_last_use = {}
|
http_last_use = {}
|
||||||
http_time_between_calls = 0
|
http_time_between_calls = 0
|
||||||
http_failed_request = {}
|
http_failed_request = {}
|
||||||
|
|||||||
Reference in new issue
Block a user