From 1a025b693b0ec150a5a71d533451d529062d00ad Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Tue, 30 Mar 2021 22:54:02 -0400 Subject: [PATCH] Fixed tvsubtitles provider #1354 --- libs/subliminal/providers/tvsubtitles.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/subliminal/providers/tvsubtitles.py b/libs/subliminal/providers/tvsubtitles.py index 188d4448c..f11e2a476 100644 --- a/libs/subliminal/providers/tvsubtitles.py +++ b/libs/subliminal/providers/tvsubtitles.py @@ -219,6 +219,11 @@ class TVsubtitlesProvider(Provider): 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: