mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-02-22 13:53:11 +08:00
subsunacs - allow txt subtitles to be downloaded
This commit is contained in:
parent
41e84b7e3d
commit
6d6d69d89d
1 changed files with 7 additions and 2 deletions
|
@ -171,11 +171,16 @@ class SubsUnacsProvider(Provider):
|
|||
subtitles = []
|
||||
type = 'episode' if isinstance(video, Episode) else 'movie'
|
||||
for file_name in archiveStream.namelist():
|
||||
if file_name.lower().endswith(('.srt', '.sub')):
|
||||
if file_name.lower().endswith(('.srt', '.sub', '.txt')):
|
||||
file_is_txt = True if file_name.lower().endswith('.txt') else False
|
||||
if file_is_txt and re.search(r'subsunacs\.net|танете част|прочети|^read ?me|procheti', file_name, re.I):
|
||||
logger.info('Ignore readme txt file %r', file_name)
|
||||
continue
|
||||
logger.info('Found subtitle file %r', file_name)
|
||||
subtitle = SubsUnacsSubtitle(language, file_name, type, video, link)
|
||||
subtitle.content = archiveStream.read(file_name)
|
||||
subtitles.append(subtitle)
|
||||
if file_is_txt == False or subtitle.is_valid():
|
||||
subtitles.append(subtitle)
|
||||
return subtitles
|
||||
|
||||
def download_archive_and_add_subtitle_files(self, link, language, video ):
|
||||
|
|
Loading…
Reference in a new issue