summaryrefslogtreecommitdiffhomepage
path: root/libs/subliminal_patch
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2021-06-07 12:41:28 -0400
committermorpheus65535 <[email protected]>2021-06-07 12:41:28 -0400
commitcb09f8d4405d4a873cd9097924fe4da932cbfed4 (patch)
tree9324797f3527aae9a22e529572b564eb7b36445f /libs/subliminal_patch
parentea63ecfc2b0d9a1c657a8ee6ed7edc6c7b04af74 (diff)
downloadbazarr-cb09f8d4405d4a873cd9097924fe4da932cbfed4.tar.gz
bazarr-cb09f8d4405d4a873cd9097924fe4da932cbfed4.zip
Fixed BetaSeries AttributeError exception #1423
Diffstat (limited to 'libs/subliminal_patch')
-rw-r--r--libs/subliminal_patch/providers/betaseries.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/subliminal_patch/providers/betaseries.py b/libs/subliminal_patch/providers/betaseries.py
index f4c769293..65530ed66 100644
--- a/libs/subliminal_patch/providers/betaseries.py
+++ b/libs/subliminal_patch/providers/betaseries.py
@@ -28,13 +28,14 @@ server_url = 'https://api.betaseries.com/'
class BetaSeriesSubtitle(Subtitle):
provider_name = 'betaseries'
- def __init__(self, subtitle_id, language, video_name, url, matches, source):
+ def __init__(self, subtitle_id, language, video_name, url, matches, source, video_release_group):
super(BetaSeriesSubtitle, self).__init__(language, page_link=url)
self.subtitle_id = subtitle_id
self.video_name = video_name
self.download_url = url
self.matches = matches
self.source = source
+ self.video_release_group = video_release_group
@property
def id(self):
@@ -67,6 +68,7 @@ class BetaSeriesProvider(Provider):
if not token:
raise ConfigurationError('Token must be specified')
self.token = token
+ self.video = None
def initialize(self):
self.session = Session()
@@ -129,7 +131,8 @@ class BetaSeriesProvider(Provider):
# Filter seriessub source because it shut down so the links are all 404
if str(sub['source']) != 'seriessub':
subtitles.append(BetaSeriesSubtitle(
- sub['id'], language, sub['file'], sub['url'], matches, str(sub['source'])))
+ sub['id'], language, sub['file'], sub['url'], matches, str(sub['source']),
+ self.video.release_group))
return subtitles
@@ -148,7 +151,7 @@ class BetaSeriesProvider(Provider):
archive = _get_archive(r.content)
if archive:
subtitle_names = _get_subtitle_names_from_archive(archive)
- subtitle_to_download = _choose_subtitle_with_release_group(subtitle_names, self.video.release_group)
+ subtitle_to_download = _choose_subtitle_with_release_group(subtitle_names, subtitle.video_release_group)
logger.debug('Subtitle to download: ' + subtitle_to_download)
subtitle_content = archive.read(subtitle_to_download)
else: