Video Ids with dashes "-" fail using the CLI
eduardofcgo opened this issue · comments
I have noticed that the command line arguments are not being parsed correctly when the youtube video id contains the character -
.
For example for the following video: https://www.youtube.com/watch?v=-FF_L54rvkk
To Reproduce
Steps to reproduce the behavior:
What code / cli command are you executing?
For example for the following video:
youtube_transcript_api "-FF_L54rvkk" --format srt
Which Python version are you using?
Python 3.8.10
Which version of youtube-transcript-api are you using?
youtube-transcript-api 0.6.2
Expected behavior
I expected to receive the transcript in SRT format, or at least recognize this valid command.
Actual behaviour
I received the following error message:
usage: youtube_transcript_api [-h] [--list-transcripts] [--languages [LANGUAGES [LANGUAGES ...]]] [--exclude-generated] [--exclude-manually-created]
[--format {json,pretty,text,webvtt,srt}] [--translate TRANSLATE] [--http-proxy URL] [--https-proxy URL] [--cookies COOKIES]
video_ids [video_ids ...]
youtube_transcript_api: error: the following arguments are required: video_ids
Hi @eduardofcgo, you'll have to escape the dash using \
like:
youtube_transcript_api "\-FF_L54rvkk" --format srt