mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Add video, audio and subtitle as locale (#26)
This commit is contained in:
parent
68aa7e903f
commit
06a5414210
1 changed files with 7 additions and 3 deletions
|
|
@ -530,21 +530,25 @@ func archiveFFmpeg(ctx context.Context, dst io.Writer, videoFiles, audioFiles, s
|
|||
input = append(input, "-i", video)
|
||||
maps = append(maps, "-map", strconv.Itoa(i))
|
||||
locale := crunchyroll.LOCALE(re.FindStringSubmatch(video)[1])
|
||||
metadata = append(metadata, fmt.Sprintf("-metadata:s:v:%d", i), fmt.Sprintf("language=%s", utils.LocaleLanguage(locale)))
|
||||
metadata = append(metadata, fmt.Sprintf("-metadata:s:a:%d", i), fmt.Sprintf("language=%s", utils.LocaleLanguage(locale)))
|
||||
metadata = append(metadata, fmt.Sprintf("-metadata:s:v:%d", i), fmt.Sprintf("language=%s", locale))
|
||||
metadata = append(metadata, fmt.Sprintf("-metadata:s:v:%d", i), fmt.Sprintf("title=%s", utils.LocaleLanguage(locale)))
|
||||
metadata = append(metadata, fmt.Sprintf("-metadata:s:a:%d", i), fmt.Sprintf("language=%s", locale))
|
||||
metadata = append(metadata, fmt.Sprintf("-metadata:s:a:%d", i), fmt.Sprintf("title=%s", utils.LocaleLanguage(locale)))
|
||||
}
|
||||
|
||||
for i, audio := range audioFiles {
|
||||
input = append(input, "-i", audio)
|
||||
maps = append(maps, "-map", strconv.Itoa(i+len(videoFiles)))
|
||||
locale := crunchyroll.LOCALE(re.FindStringSubmatch(audio)[1])
|
||||
metadata = append(metadata, fmt.Sprintf("-metadata:s:a:%d", i), fmt.Sprintf("language=%s", utils.LocaleLanguage(locale)))
|
||||
metadata = append(metadata, fmt.Sprintf("-metadata:s:a:%d", i), fmt.Sprintf("language=%s", locale))
|
||||
metadata = append(metadata, fmt.Sprintf("-metadata:s:a:%d", i), fmt.Sprintf("title=%s", utils.LocaleLanguage(locale)))
|
||||
}
|
||||
|
||||
for i, subtitle := range subtitleFiles {
|
||||
input = append(input, "-i", subtitle)
|
||||
maps = append(maps, "-map", strconv.Itoa(i+len(videoFiles)+len(audioFiles)))
|
||||
locale := crunchyroll.LOCALE(re.FindStringSubmatch(subtitle)[1])
|
||||
metadata = append(metadata, fmt.Sprintf("-metadata:s:s:%d", i), fmt.Sprintf("language=%s", locale))
|
||||
metadata = append(metadata, fmt.Sprintf("-metadata:s:s:%d", i), fmt.Sprintf("title=%s", utils.LocaleLanguage(locale)))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue