with open(path_replace(os.path.join(os.path.dirname(file),subtitle)),'r')asf:
text =list(islice(f,100))
text=''.join(text)
encoding=UnicodeDammit(text)
try:
text=text.decode(encoding.original_encoding)
exceptExceptionase:
logging.exception('Error trying to detect character encoding for this subtitles file: '+path_replace(os.path.join(os.path.dirname(file),subtitle))+' You should try to delete this subtitles file manually and ask Bazarr to download it again.')
logging.exception('Error trying to detect character encoding for this subtitles file: '+path_replace(os.path.join(os.path.dirname(file),subtitle))+' You should try to delete this subtitles file manually and ask Bazarr to download it again.')