abdeladim-s / subsai

🎞️ Subtitles generation tool (Web-UI + CLI + Python package) powered by OpenAI's Whisper and its variants 🎞️
https://abdeladim-s.github.io/subsai/
GNU General Public License v3.0
1.16k stars 96 forks source link

don't specify dot character in available subtitle formats in the CLI #26

Closed redcathode closed 1 year ago

redcathode commented 1 year ago

Running subsai --help seems to specify to the user that they should include a dot in the subtitle format:

asolidtime ~> subsai --help
[lines excluded]
  -f FORMAT, --format FORMAT, --subtitles-format FORMAT
                        Output subtitles format, available formats ['.srt', '.ass', '.ssa', '.sub', '.json',
                        '.txt', '.vtt']

But following this advice will spit out a file extension with two dots, since the program already adds a dot character to the end of the base name.

asolidtime ~> subsai -m 'guillaumekln/faster-whisper' -f '.vtt' sample\ vid.webm 
[lines excluded]
[+] Processing file: /home/maxwell/sample vid.webm
[+] Subtitles file saved to: /home/maxwell/sample vid..vtt
DONE!

I figured this might still be useful if you want to prepend something to the subtitle format, e.g. -f 'autogenerated.vtt', so I just changed the help page of the CLI to exclude the dot:

asolidtime ~> subsai --help
[lines excluded]
  -f FORMAT, --format FORMAT, --subtitles-format FORMAT
                        Output subtitles format, available formats ['srt', 'ass', 'ssa', 'sub', 'json',
                        'txt', 'vtt']
abdeladim-s commented 1 year ago

Yeah you are right. The changes you made are really good.

Thanks @asolidtime very much for the contribution.