Skip to content

Commit

Permalink
Fixed tvsubtitles provider #1354
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed Mar 31, 2021
1 parent cc80bd4 commit 1a025b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libs/subliminal/providers/tvsubtitles.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ def download_subtitle(self, subtitle):
r = self.session.get(self.server_url + 'download-%d.html' % subtitle.subtitle_id, timeout=10)
r.raise_for_status()

# generate the download link from the sliced strings in the page source (js)
download_link_part = re.findall(r'(?<=s\d\=\ \')(.*?)(?=\'\;)', r.text)
r = self.session.get(self.server_url + ''.join(download_link_part), timeout=10)
r.raise_for_status()

# open the zip
with ZipFile(io.BytesIO(r.content)) as zf:
if len(zf.namelist()) > 1:
Expand Down

0 comments on commit 1a025b6

Please sign in to comment.