mirror of https://github.com/devine-dl/devine.git
fix(dl): Have --sub-format default to None to keep original sub format
This commit is contained in:
parent
c516f54a07
commit
76dc54fc13
|
@ -160,7 +160,7 @@ AMZN:
|
||||||
bitrate: CVBR
|
bitrate: CVBR
|
||||||
```
|
```
|
||||||
|
|
||||||
or to change the output subtitle format from the default (SubRip SRT) to WebVTT,
|
or to change the output subtitle format from the default (original format) to WebVTT,
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sub_format: vtt
|
sub_format: vtt
|
||||||
|
|
|
@ -102,7 +102,7 @@ class dl:
|
||||||
@click.option("--tag", type=str, default=None,
|
@click.option("--tag", type=str, default=None,
|
||||||
help="Set the Group Tag to be used, overriding the one in config if any.")
|
help="Set the Group Tag to be used, overriding the one in config if any.")
|
||||||
@click.option("--sub-format", type=click.Choice(Subtitle.Codec, case_sensitive=False),
|
@click.option("--sub-format", type=click.Choice(Subtitle.Codec, case_sensitive=False),
|
||||||
default=Subtitle.Codec.SubRip,
|
default=None,
|
||||||
help="Set Output Subtitle Format, only converting if necessary.")
|
help="Set Output Subtitle Format, only converting if necessary.")
|
||||||
@click.option("-V", "--video-only", is_flag=True, default=False,
|
@click.option("-V", "--video-only", is_flag=True, default=False,
|
||||||
help="Only download video tracks.")
|
help="Only download video tracks.")
|
||||||
|
@ -262,7 +262,7 @@ class dl:
|
||||||
lang: list[str],
|
lang: list[str],
|
||||||
v_lang: list[str],
|
v_lang: list[str],
|
||||||
s_lang: list[str],
|
s_lang: list[str],
|
||||||
sub_format: Subtitle.Codec,
|
sub_format: Optional[Subtitle.Codec],
|
||||||
video_only: bool,
|
video_only: bool,
|
||||||
audio_only: bool,
|
audio_only: bool,
|
||||||
subs_only: bool,
|
subs_only: bool,
|
||||||
|
@ -572,10 +572,11 @@ class dl:
|
||||||
break
|
break
|
||||||
video_track_n += 1
|
video_track_n += 1
|
||||||
|
|
||||||
with console.status(f"Converting Subtitles to {sub_format.name}..."):
|
if sub_format:
|
||||||
for subtitle in title.tracks.subtitles:
|
with console.status(f"Converting Subtitles to {sub_format.name}..."):
|
||||||
if subtitle.codec != sub_format:
|
for subtitle in title.tracks.subtitles:
|
||||||
subtitle.convert(sub_format)
|
if subtitle.codec != sub_format:
|
||||||
|
subtitle.convert(sub_format)
|
||||||
|
|
||||||
with console.status("Repackaging tracks with FFMPEG..."):
|
with console.status("Repackaging tracks with FFMPEG..."):
|
||||||
has_repacked = False
|
has_repacked = False
|
||||||
|
|
Loading…
Reference in New Issue