Merge remote-tracking branch 'origin/development' into development

pull/785/head
Louis Vézina 5 years ago
commit b1f60b012e

@ -196,7 +196,12 @@ class TitrariProvider(Provider, ProviderSubtitleArchiveMixin):
def list_subtitles(self, video, languages):
title = fix_inconsistent_naming(video.title)
imdb_id = None
try:
imdb_id = video.imdb_id[2:]
except:
logger.error("[#### Provider: titrari.ro] Error parsing video.imdb_id.")
return [s for s in
self.query(languages, title, imdb_id, video)]

@ -244,7 +244,7 @@ class TitulkyProvider(Provider):
for sub in subs:
page_link = '%s%s' % (self.server_url, sub.a.get('href').encode('utf-8'))
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")
if version is None:
version = ""
@ -316,13 +316,12 @@ class TitulkyProvider(Provider):
elif 'Limit vyčerpán' in r.text:
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')
link = soup.find(id="downlink")
# TODO: add settings for choice
url = link.get('href')
url = self.dn_url + url
url = self.dn_url + link.get('href')
time.sleep(0.5)
r = self.session.get(url, headers={'Referer': subtitle.download_link},
timeout=30)

@ -84,10 +84,11 @@ def _get_localzone(_root='/'):
if not etctz:
continue
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.
# Verify that the timezone specified there is actually used:
utils.assert_tz_offset(tz)
# utils.assert_tz_offset(tz)
return tz
except IOError:

Loading…
Cancel
Save