mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Fix ass filter path escape on windows (#262)
This commit is contained in:
parent
7594412f58
commit
e5d9c27af7
1 changed files with 21 additions and 2 deletions
|
|
@ -378,8 +378,27 @@ impl Downloader {
|
|||
output_presets.extend([
|
||||
"-vf".to_string(),
|
||||
format!(
|
||||
"ass={}",
|
||||
subtitles.get(position).unwrap().path.to_str().unwrap()
|
||||
"ass='{}'",
|
||||
// ffmpeg doesn't removes all ':' and '\' from the filename when using
|
||||
// the ass filter. well, on windows these characters are used in
|
||||
// absolute paths, so they have to be correctly escaped here
|
||||
if cfg!(windows) {
|
||||
subtitles
|
||||
.get(position)
|
||||
.unwrap()
|
||||
.path
|
||||
.to_str()
|
||||
.unwrap()
|
||||
.replace('\\', "\\\\")
|
||||
.replace(':', "\\:")
|
||||
} else {
|
||||
subtitles
|
||||
.get(position)
|
||||
.unwrap()
|
||||
.path
|
||||
.to_string_lossy()
|
||||
.to_string()
|
||||
}
|
||||
),
|
||||
])
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue