Another Possible fix for titulky provider

This commit is contained in:
Halali 2020-01-27 22:11:54 +01:00
parent e7d7ad408e
commit 57c24a6e56

View file

@ -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)