mirror of https://github.com/morpheus65535/bazarr
Merge remote-tracking branch 'origin/development' into development
This commit is contained in:
commit
b1f60b012e
|
@ -196,7 +196,12 @@ class TitrariProvider(Provider, ProviderSubtitleArchiveMixin):
|
||||||
|
|
||||||
def list_subtitles(self, video, languages):
|
def list_subtitles(self, video, languages):
|
||||||
title = fix_inconsistent_naming(video.title)
|
title = fix_inconsistent_naming(video.title)
|
||||||
|
imdb_id = None
|
||||||
|
try:
|
||||||
imdb_id = video.imdb_id[2:]
|
imdb_id = video.imdb_id[2:]
|
||||||
|
except:
|
||||||
|
logger.error("[#### Provider: titrari.ro] Error parsing video.imdb_id.")
|
||||||
|
|
||||||
return [s for s in
|
return [s for s in
|
||||||
self.query(languages, title, imdb_id, video)]
|
self.query(languages, title, imdb_id, video)]
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,7 @@ class TitulkyProvider(Provider):
|
||||||
for sub in subs:
|
for sub in subs:
|
||||||
page_link = '%s%s' % (self.server_url, sub.a.get('href').encode('utf-8'))
|
page_link = '%s%s' % (self.server_url, sub.a.get('href').encode('utf-8'))
|
||||||
title = sub.find_all('td')[0:1]
|
title = sub.find_all('td')[0:1]
|
||||||
title = [x.text.encode('utf-8') for x in title]
|
title = [x.text for x in title]
|
||||||
version = sub.find(class_="fixedTip")
|
version = sub.find(class_="fixedTip")
|
||||||
if version is None:
|
if version is None:
|
||||||
version = ""
|
version = ""
|
||||||
|
@ -316,13 +316,12 @@ class TitulkyProvider(Provider):
|
||||||
elif 'Limit vyčerpán' in r.text:
|
elif 'Limit vyčerpán' in r.text:
|
||||||
raise DownloadLimitExceeded
|
raise DownloadLimitExceeded
|
||||||
|
|
||||||
soup = ParserBeautifulSoup(r.text.decode('utf-8', 'ignore'), ['lxml', 'html.parser'])
|
soup = ParserBeautifulSoup(r.text, ['lxml', 'html.parser'])
|
||||||
# links = soup.find("a", {"id": "downlink"}).find_all('a')
|
# links = soup.find("a", {"id": "downlink"}).find_all('a')
|
||||||
link = soup.find(id="downlink")
|
link = soup.find(id="downlink")
|
||||||
# TODO: add settings for choice
|
# TODO: add settings for choice
|
||||||
|
|
||||||
url = link.get('href')
|
url = self.dn_url + link.get('href')
|
||||||
url = self.dn_url + url
|
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
r = self.session.get(url, headers={'Referer': subtitle.download_link},
|
r = self.session.get(url, headers={'Referer': subtitle.download_link},
|
||||||
timeout=30)
|
timeout=30)
|
||||||
|
|
|
@ -84,10 +84,11 @@ def _get_localzone(_root='/'):
|
||||||
if not etctz:
|
if not etctz:
|
||||||
continue
|
continue
|
||||||
tz = pytz.timezone(etctz.replace(' ', '_'))
|
tz = pytz.timezone(etctz.replace(' ', '_'))
|
||||||
if _root == '/':
|
# Disabling this offset valdation due to issue with some timezone: https://github.com/regebro/tzlocal/issues/80
|
||||||
|
# if _root == '/':
|
||||||
# We are using a file in etc to name the timezone.
|
# We are using a file in etc to name the timezone.
|
||||||
# Verify that the timezone specified there is actually used:
|
# Verify that the timezone specified there is actually used:
|
||||||
utils.assert_tz_offset(tz)
|
# utils.assert_tz_offset(tz)
|
||||||
return tz
|
return tz
|
||||||
|
|
||||||
except IOError:
|
except IOError:
|
||||||
|
|
Loading…
Reference in New Issue