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,6 +572,7 @@ class dl:
|
||||||
break
|
break
|
||||||
video_track_n += 1
|
video_track_n += 1
|
||||||
|
|
||||||
|
if sub_format:
|
||||||
with console.status(f"Converting Subtitles to {sub_format.name}..."):
|
with console.status(f"Converting Subtitles to {sub_format.name}..."):
|
||||||
for subtitle in title.tracks.subtitles:
|
for subtitle in title.tracks.subtitles:
|
||||||
if subtitle.codec != sub_format:
|
if subtitle.codec != sub_format:
|
||||||
|
|
Loading…
Reference in New Issue