mirror of https://github.com/morpheus65535/bazarr
Fix for non UTF8 file system encoding.
This commit is contained in:
parent
8a21265fe6
commit
9064583853
|
@ -2,6 +2,7 @@ import enzyme
|
|||
import logging
|
||||
import os
|
||||
import subprocess
|
||||
import locale
|
||||
|
||||
from utils import get_binary
|
||||
|
||||
|
@ -18,7 +19,7 @@ class EmbeddedSubsReader:
|
|||
def list_languages(self, file):
|
||||
if self.ffprobe:
|
||||
try:
|
||||
return subprocess.check_output([self.ffprobe, "-loglevel", "error", "-select_streams", "s", "-show_entries", "stream_tags=language", "-of", "csv=p=0", file], universal_newlines=True, stderr=subprocess.STDOUT).strip().split("\n")
|
||||
return subprocess.check_output([self.ffprobe, "-loglevel", "error", "-select_streams", "s", "-show_entries", "stream_tags=language", "-of", "csv=p=0", file.encode(locale.getpreferredencoding())], universal_newlines=True, stderr=subprocess.STDOUT).strip().split("\n")
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise FFprobeError(e.output)
|
||||
if os.path.splitext(file)[1] != '.mkv':
|
||||
|
|
Loading…
Reference in New Issue