mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Fix video containing hardsub if not requested (#415)
This commit is contained in:
parent
48bb7a5ef6
commit
817963af4f
2 changed files with 18 additions and 26 deletions
|
|
@ -384,12 +384,20 @@ async fn get_format(
|
|||
let subtitle = if contains_hardsub {
|
||||
None
|
||||
} else if let Some(subtitle_locale) = &download.subtitle {
|
||||
stream
|
||||
.subtitles
|
||||
.get(subtitle_locale)
|
||||
.cloned()
|
||||
// use closed captions as fallback if no actual subtitles are found
|
||||
.or_else(|| stream.captions.get(subtitle_locale).cloned())
|
||||
if download.audio == Locale::ja_JP {
|
||||
stream
|
||||
.subtitles
|
||||
.get(subtitle_locale)
|
||||
// use closed captions as fallback if no actual subtitles are found
|
||||
.or_else(|| stream.captions.get(subtitle_locale))
|
||||
.cloned()
|
||||
} else {
|
||||
stream
|
||||
.captions
|
||||
.get(subtitle_locale)
|
||||
.or_else(|| stream.subtitles.get(subtitle_locale))
|
||||
.cloned()
|
||||
}
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue