I have tried two separate scripts for scrapping all comments of a Youtube video.
Everything works fine, but there was one problem:Youtube video ID's starting with a hiphen, like -FIHqoTcZog
does not work.
I was wondering is there a way to escape every single character of that ID from shell interpretation, for instance using as an ID: \-\F\I\H\q\o\T\c\Z\o\g
, but this did not work in my case.
The scripts i used was : youtube-comment-downloader and youtube-comment-scraper. Both require video ID. Even if that is surrounded by single or double quotes the ID works, but neither works if the video ID starts with a hyphen.
Youtube-dl had similar issue before, but now it accepts ID starting with hyphen: this is done by using the option --id
, still it does not work in our case unless the hyphen is preceded by --
, making the video name into --id -- -FIHqoTcZog
when it is ok to be --id xxxxxxxxxxx
in another case where the ID does not start with a hyphen.
Is there any way arround for my scripts to work with ID starting with a hyphen, like the way how it did in the Youtube-dl's case, or using another work arround?
--id=-SoMeID
work? – Kusalananda Mar 05 '18 at 14:34--id -- -xxxxxxxx
, the two other scripts do not accept that form at all. – pigeon Mar 05 '18 at 14:44--id
option ofyoutube-dl
doesn't do what you think: "Use only video ID in file name". That's why you still need to use--
. – nxnev Mar 05 '18 at 20:21