mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-24 16:52:06 +00:00
Fix for non UTF8 file system encoding.
This commit is contained in:
parent
8a21265fe6
commit
9064583853
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@ import enzyme
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import locale
|
||||||
|
|
||||||
from utils import get_binary
|
from utils import get_binary
|
||||||
|
|
||||||
|
@ -18,7 +19,7 @@ class EmbeddedSubsReader:
|
||||||
def list_languages(self, file):
|
def list_languages(self, file):
|
||||||
if self.ffprobe:
|
if self.ffprobe:
|
||||||
try:
|
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:
|
except subprocess.CalledProcessError as e:
|
||||||
raise FFprobeError(e.output)
|
raise FFprobeError(e.output)
|
||||||
if os.path.splitext(file)[1] != '.mkv':
|
if os.path.splitext(file)[1] != '.mkv':
|
||||||
|
|
Loading…
Reference in a new issue