Merge branch 'master' into develop

This commit is contained in:
JackDandy 2018-07-28 14:17:26 +01:00
commit f94dd18404
5 changed files with 30 additions and 25 deletions

View file

@ -29,6 +29,12 @@
### 0.16.21 (2018-07-28 14:15:00 UTC)
* Change TorrentDay
* Change TVDB API 2 to version 2.2.0
### 0.16.20 (2018-07-17 14:30:00 UTC)
* Change TorrentDay

View file

@ -63,7 +63,7 @@
# Send PostProcessing requests to SickGear
#
# PostProcessing-Script version: 1.6.
# PostProcessing-Script version: 1.7.
# <!--
# For more info and updates please visit forum topic at
# -->
@ -157,7 +157,7 @@ import re
import sys
import warnings
__version__ = '1.6'
__version__ = '1.7'
verbose = 0 or 'yes' == os.environ.get('NZBPO_SG_VERBOSE', 'no')
@ -281,11 +281,17 @@ class Ek:
return x
return None
@staticmethod
def fix_out_encoding(x):
if isinstance(x, basestring):
return Ek.fix_string_encoding(x)
return x
@staticmethod
def fix_list_encoding(x):
if type(x) not in (list, tuple):
return x
return filter(lambda i: None is not i, map(Ek.fix_string_encoding, i))
return filter(lambda i: None is not i, map(Ek.fix_out_encoding, x))
@staticmethod
def encode_item(x):

View file

@ -9,7 +9,7 @@ from functools import wraps
__author__ = 'dbr/Ben'
__version__ = '2.0'
__api_version__ = '2.1.2'
__api_version__ = '2.2.0'
import os
import time
@ -581,19 +581,19 @@ class Tvdb:
log().debug('Using proxy for URL: %s' % url)
session.proxies = {'http': self.config['proxy'], 'https': self.config['proxy']}
session.headers.update({'Accept-Encoding': 'gzip,deflate', 'Authorization': 'Bearer %s' % self.get_token(),
'Accept': 'application/vnd.thetvdb.v%s' % __api_version__})
headers = {'Accept-Encoding': 'gzip,deflate', 'Authorization': 'Bearer %s' % self.get_token(),
'Accept': 'application/vnd.thetvdb.v%s' % __api_version__}
if None is not language and language in self.config['valid_languages']:
session.headers.update({'Accept-Language': language})
headers.update({'Accept-Language': language})
resp = None
if self._match_url_pattern('url_seriesInfo', url):
self.show_not_found = False
self.not_found = False
try:
resp = getURL(url.strip(), params=params, session=session, json=True, raise_status_code=True,
raise_exceptions=True)
resp = getURL(url.strip(), params=params, session=session, headers=headers, json=True,
raise_status_code=True, raise_exceptions=True)
except requests.exceptions.HTTPError as e:
if 401 == e.response.status_code:
# token expired, get new token, raise error to retry

View file

@ -42,11 +42,16 @@ def fixStupidEncodings(x, silent=False):
return None
def fixOutEncoding(x):
if isinstance(x, basestring):
return fixStupidEncodings(x)
return x
def fixListEncodings(x):
if type(x) != list and type(x) != tuple:
if type(x) not in (list, tuple):
return x
else:
return filter(lambda x: x != None, map(fixStupidEncodings, x))
return filter(lambda i: None is not i, map(fixOutEncoding, x))
def callPeopleStupid(x):

View file

@ -30,19 +30,7 @@ class TorrentDayProvider(generic.TorrentProvider):
generic.TorrentProvider.__init__(self, 'TorrentDay')
self.url_home = ['https://%s/' % u for u in 'torrentday.eu', 'secure.torrentday.com', 'tdonline.org',
'torrentday.it', 'www.td.af', 'www.torrentday.com'] + \
['http://td.%s/' % base64.b64decode(x) for x in [''.join(x) for x in [
[re.sub('(?i)[I\s1]+', '', x[::-1]) for x in [
'y92d', 'zl12a', 'y9mY', 'n5 Wa', 'vNmIL', '=i1=Qb']],
[re.sub('(?i)[T\sq]+', '', x[::-1]) for x in [
'15TWd', 'hV 3c', 'lBHb', 'vNncq', 'j5ib', '=qQ02b']],
[re.sub('(?i)[0\so]+', '', x[::-1]) for x in [
'Vmco', 'CZh', 'boi10', 'r92', '5yc', 'mcv', '=oc']],
[re.sub('(?i)[1\slq]+', '', x[::-1]) for x in [
'2cql', 'yV1', 'mdlq', 'wQV', 'n11M', 'uA', '12Y', 't9']],
[re.sub('(?i)[\s1q]+', '', x[::-1]) for x in [
'Vmbq', 'WL10', 'ZyZ', 'rFW', '5yc', '12bj', 'q=0']]
]]]
'torrentday.it', 'www.td.af', 'www.torrentday.com']
self.url_vars = {'login': 'rss.php', 'search': 't?%s%s&qf=&q=%s'}
self.url_tmpl = {'config_provider_home_uri': '%(home)s', 'login': '%(home)s%(vars)s',