|
|
@ -171,10 +171,15 @@ class SubsUnacsProvider(Provider):
|
|
|
|
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 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)
|
|
|
|
logger.info('Found subtitle file %r', file_name)
|
|
|
|
subtitle = SubsUnacsSubtitle(language, file_name, type, video, link)
|
|
|
|
subtitle = SubsUnacsSubtitle(language, file_name, type, video, link)
|
|
|
|
subtitle.content = archiveStream.read(file_name)
|
|
|
|
subtitle.content = archiveStream.read(file_name)
|
|
|
|
|
|
|
|
if file_is_txt == False or subtitle.is_valid():
|
|
|
|
subtitles.append(subtitle)
|
|
|
|
subtitles.append(subtitle)
|
|
|
|
return subtitles
|
|
|
|
return subtitles
|
|
|
|
|
|
|
|
|
|
|
|