|
|
@ -13,7 +13,6 @@ from guessit import guessit
|
|
|
|
from subliminal_patch.providers import Provider
|
|
|
|
from subliminal_patch.providers import Provider
|
|
|
|
from subliminal_patch.subtitle import Subtitle
|
|
|
|
from subliminal_patch.subtitle import Subtitle
|
|
|
|
from subliminal_patch.utils import sanitize, fix_inconsistent_naming
|
|
|
|
from subliminal_patch.utils import sanitize, fix_inconsistent_naming
|
|
|
|
from subliminal.exceptions import ProviderError
|
|
|
|
|
|
|
|
from subliminal.utils import sanitize_release_group
|
|
|
|
from subliminal.utils import sanitize_release_group
|
|
|
|
from subliminal.subtitle import guess_matches
|
|
|
|
from subliminal.subtitle import guess_matches
|
|
|
|
from subliminal.video import Episode, Movie
|
|
|
|
from subliminal.video import Episode, Movie
|
|
|
@ -88,14 +87,14 @@ class SubsSabBzSubtitle(Subtitle):
|
|
|
|
if video.imdb_id and self.imdb_id == video.imdb_id:
|
|
|
|
if video.imdb_id and self.imdb_id == video.imdb_id:
|
|
|
|
matches.add('imdb_id')
|
|
|
|
matches.add('imdb_id')
|
|
|
|
|
|
|
|
|
|
|
|
matches |= guess_matches(video, guessit(self.title, {'type': self.type}))
|
|
|
|
matches |= guess_matches(video, guessit(self.title, {'type': self.type, 'allowed_countries': [None]}))
|
|
|
|
matches |= guess_matches(video, guessit(self.filename, {'type': self.type}))
|
|
|
|
matches |= guess_matches(video, guessit(self.filename, {'type': self.type, 'allowed_countries': [None]}))
|
|
|
|
return matches
|
|
|
|
return matches
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SubsSabBzProvider(Provider):
|
|
|
|
class SubsSabBzProvider(Provider):
|
|
|
|
"""SubsSabBz Provider."""
|
|
|
|
"""SubsSabBz Provider."""
|
|
|
|
languages = {Language('por', 'BR')} | {Language(l) for l in [
|
|
|
|
languages = {Language(l) for l in [
|
|
|
|
'bul', 'eng'
|
|
|
|
'bul', 'eng'
|
|
|
|
]}
|
|
|
|
]}
|
|
|
|
|
|
|
|
|
|
|
@ -214,11 +213,11 @@ class SubsSabBzProvider(Provider):
|
|
|
|
def process_archive_subtitle_files(self, archiveStream, language, video, link, fps, num_cds):
|
|
|
|
def process_archive_subtitle_files(self, archiveStream, language, video, link, fps, num_cds):
|
|
|
|
subtitles = []
|
|
|
|
subtitles = []
|
|
|
|
type = 'episode' if isinstance(video, Episode) else 'movie'
|
|
|
|
type = 'episode' if isinstance(video, Episode) else 'movie'
|
|
|
|
for file_name in archiveStream.namelist():
|
|
|
|
for file_name in sorted(archiveStream.namelist()):
|
|
|
|
if file_name.lower().endswith(('.srt', '.sub')):
|
|
|
|
if file_name.lower().endswith(('.srt', '.sub')):
|
|
|
|
logger.info('Found subtitle file %r', file_name)
|
|
|
|
logger.info('Found subtitle file %r', file_name)
|
|
|
|
subtitle = SubsSabBzSubtitle(language, file_name, type, video, link, fps, num_cds)
|
|
|
|
subtitle = SubsSabBzSubtitle(language, file_name, type, video, link, fps, num_cds)
|
|
|
|
subtitle.content = archiveStream.read(file_name)
|
|
|
|
subtitle.content = fix_line_ending(archiveStream.read(file_name))
|
|
|
|
subtitles.append(subtitle)
|
|
|
|
subtitles.append(subtitle)
|
|
|
|
return subtitles
|
|
|
|
return subtitles
|
|
|
|
|
|
|
|
|
|
|
|