Scrips does not accept video ID starting with a hyphen
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
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: -FIHqoTcZog
, 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?
bash youtube
add a comment |Â
up vote
0
down vote
favorite
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: -FIHqoTcZog
, 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?
bash youtube
Does--id=-SoMeID
work?
â Kusalananda
Mar 5 at 14:34
@Kusalananda, that one is only a work around for Youtube-dl , and it is then for a hyphen starting ID:--id -- -xxxxxxxx
, the two other scripts do not accept that form at all.
â pigeon
Mar 5 at 14:44
Since this is getting sent to an HTTP server, what about replacing the hyphen with "%2D"?
â ErikF
Mar 5 at 16:11
The--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 5 at 20:21
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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: -FIHqoTcZog
, 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?
bash youtube
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: -FIHqoTcZog
, 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?
bash youtube
asked Mar 5 at 14:29
pigeon
5217
5217
Does--id=-SoMeID
work?
â Kusalananda
Mar 5 at 14:34
@Kusalananda, that one is only a work around for Youtube-dl , and it is then for a hyphen starting ID:--id -- -xxxxxxxx
, the two other scripts do not accept that form at all.
â pigeon
Mar 5 at 14:44
Since this is getting sent to an HTTP server, what about replacing the hyphen with "%2D"?
â ErikF
Mar 5 at 16:11
The--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 5 at 20:21
add a comment |Â
Does--id=-SoMeID
work?
â Kusalananda
Mar 5 at 14:34
@Kusalananda, that one is only a work around for Youtube-dl , and it is then for a hyphen starting ID:--id -- -xxxxxxxx
, the two other scripts do not accept that form at all.
â pigeon
Mar 5 at 14:44
Since this is getting sent to an HTTP server, what about replacing the hyphen with "%2D"?
â ErikF
Mar 5 at 16:11
The--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 5 at 20:21
Does
--id=-SoMeID
work?â Kusalananda
Mar 5 at 14:34
Does
--id=-SoMeID
work?â Kusalananda
Mar 5 at 14:34
@Kusalananda, that one is only a work around for Youtube-dl , and it is then for a hyphen starting ID:
--id -- -xxxxxxxx
, the two other scripts do not accept that form at all.â pigeon
Mar 5 at 14:44
@Kusalananda, that one is only a work around for Youtube-dl , and it is then for a hyphen starting ID:
--id -- -xxxxxxxx
, the two other scripts do not accept that form at all.â pigeon
Mar 5 at 14:44
Since this is getting sent to an HTTP server, what about replacing the hyphen with "%2D"?
â ErikF
Mar 5 at 16:11
Since this is getting sent to an HTTP server, what about replacing the hyphen with "%2D"?
â ErikF
Mar 5 at 16:11
The
--id
option of youtube-dl
doesn't do what you think: "Use only video ID in file name". That's why you still need to use --
.â nxnev
Mar 5 at 20:21
The
--id
option of youtube-dl
doesn't do what you think: "Use only video ID in file name". That's why you still need to use --
.â nxnev
Mar 5 at 20:21
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
Related question: What does âÂÂ--â (double-dash) mean? (also known as âÂÂbare double dashâÂÂ)
The hyphen character is not interpreted by your shell but by the program/script (its parser, more precisely) you are using. That's why escaping it (at the shell level) doesn't work.
Programs often recognize arguments with leading hyphen(s) as options, not as operands. To interpret arguments like -foo
as operands, programs usually follow one or more of these ways:
- Recognize the first
--
argument as the end of options marker:program -- -foo
- Let you pass operands as option-arguments:
program --option -foo
- Recognize operands in alternative ways:
program prefix-foo
In your specific scenario:
youtube-dl
accepts:-- -FIHqoTcZog
https://www.youtube.com/watch?v=-FIHqoTcZog
youtube-comment-downloader
seems to accept:--youtubeid -FIHqoTcZog
youtube-comment-scraper
seems to accept:-- -FIHqoTcZog
https://www.youtube.com/watch?v=-FIHqoTcZog
add a comment |Â
up vote
0
down vote
Finally, i found one solution to the script youtube-comment-scraper after installing it again, suddenly , adding --
in front of a video ID starting with -
worked.
This hint is still not available in any of their documentation.
Now this works:youtube-comment-scraper --output OtherFile -f csv -- -FIHqoTcZog
In the other script it still does not work yet.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Related question: What does âÂÂ--â (double-dash) mean? (also known as âÂÂbare double dashâÂÂ)
The hyphen character is not interpreted by your shell but by the program/script (its parser, more precisely) you are using. That's why escaping it (at the shell level) doesn't work.
Programs often recognize arguments with leading hyphen(s) as options, not as operands. To interpret arguments like -foo
as operands, programs usually follow one or more of these ways:
- Recognize the first
--
argument as the end of options marker:program -- -foo
- Let you pass operands as option-arguments:
program --option -foo
- Recognize operands in alternative ways:
program prefix-foo
In your specific scenario:
youtube-dl
accepts:-- -FIHqoTcZog
https://www.youtube.com/watch?v=-FIHqoTcZog
youtube-comment-downloader
seems to accept:--youtubeid -FIHqoTcZog
youtube-comment-scraper
seems to accept:-- -FIHqoTcZog
https://www.youtube.com/watch?v=-FIHqoTcZog
add a comment |Â
up vote
2
down vote
accepted
Related question: What does âÂÂ--â (double-dash) mean? (also known as âÂÂbare double dashâÂÂ)
The hyphen character is not interpreted by your shell but by the program/script (its parser, more precisely) you are using. That's why escaping it (at the shell level) doesn't work.
Programs often recognize arguments with leading hyphen(s) as options, not as operands. To interpret arguments like -foo
as operands, programs usually follow one or more of these ways:
- Recognize the first
--
argument as the end of options marker:program -- -foo
- Let you pass operands as option-arguments:
program --option -foo
- Recognize operands in alternative ways:
program prefix-foo
In your specific scenario:
youtube-dl
accepts:-- -FIHqoTcZog
https://www.youtube.com/watch?v=-FIHqoTcZog
youtube-comment-downloader
seems to accept:--youtubeid -FIHqoTcZog
youtube-comment-scraper
seems to accept:-- -FIHqoTcZog
https://www.youtube.com/watch?v=-FIHqoTcZog
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Related question: What does âÂÂ--â (double-dash) mean? (also known as âÂÂbare double dashâÂÂ)
The hyphen character is not interpreted by your shell but by the program/script (its parser, more precisely) you are using. That's why escaping it (at the shell level) doesn't work.
Programs often recognize arguments with leading hyphen(s) as options, not as operands. To interpret arguments like -foo
as operands, programs usually follow one or more of these ways:
- Recognize the first
--
argument as the end of options marker:program -- -foo
- Let you pass operands as option-arguments:
program --option -foo
- Recognize operands in alternative ways:
program prefix-foo
In your specific scenario:
youtube-dl
accepts:-- -FIHqoTcZog
https://www.youtube.com/watch?v=-FIHqoTcZog
youtube-comment-downloader
seems to accept:--youtubeid -FIHqoTcZog
youtube-comment-scraper
seems to accept:-- -FIHqoTcZog
https://www.youtube.com/watch?v=-FIHqoTcZog
Related question: What does âÂÂ--â (double-dash) mean? (also known as âÂÂbare double dashâÂÂ)
The hyphen character is not interpreted by your shell but by the program/script (its parser, more precisely) you are using. That's why escaping it (at the shell level) doesn't work.
Programs often recognize arguments with leading hyphen(s) as options, not as operands. To interpret arguments like -foo
as operands, programs usually follow one or more of these ways:
- Recognize the first
--
argument as the end of options marker:program -- -foo
- Let you pass operands as option-arguments:
program --option -foo
- Recognize operands in alternative ways:
program prefix-foo
In your specific scenario:
youtube-dl
accepts:-- -FIHqoTcZog
https://www.youtube.com/watch?v=-FIHqoTcZog
youtube-comment-downloader
seems to accept:--youtubeid -FIHqoTcZog
youtube-comment-scraper
seems to accept:-- -FIHqoTcZog
https://www.youtube.com/watch?v=-FIHqoTcZog
answered Mar 5 at 20:17
nxnev
2,4522423
2,4522423
add a comment |Â
add a comment |Â
up vote
0
down vote
Finally, i found one solution to the script youtube-comment-scraper after installing it again, suddenly , adding --
in front of a video ID starting with -
worked.
This hint is still not available in any of their documentation.
Now this works:youtube-comment-scraper --output OtherFile -f csv -- -FIHqoTcZog
In the other script it still does not work yet.
add a comment |Â
up vote
0
down vote
Finally, i found one solution to the script youtube-comment-scraper after installing it again, suddenly , adding --
in front of a video ID starting with -
worked.
This hint is still not available in any of their documentation.
Now this works:youtube-comment-scraper --output OtherFile -f csv -- -FIHqoTcZog
In the other script it still does not work yet.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Finally, i found one solution to the script youtube-comment-scraper after installing it again, suddenly , adding --
in front of a video ID starting with -
worked.
This hint is still not available in any of their documentation.
Now this works:youtube-comment-scraper --output OtherFile -f csv -- -FIHqoTcZog
In the other script it still does not work yet.
Finally, i found one solution to the script youtube-comment-scraper after installing it again, suddenly , adding --
in front of a video ID starting with -
worked.
This hint is still not available in any of their documentation.
Now this works:youtube-comment-scraper --output OtherFile -f csv -- -FIHqoTcZog
In the other script it still does not work yet.
answered Mar 5 at 15:40
pigeon
5217
5217
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f428279%2fscrips-does-not-accept-video-id-starting-with-a-hyphen%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Does
--id=-SoMeID
work?â Kusalananda
Mar 5 at 14:34
@Kusalananda, that one is only a work around for Youtube-dl , and it is then for a hyphen starting ID:
--id -- -xxxxxxxx
, the two other scripts do not accept that form at all.â pigeon
Mar 5 at 14:44
Since this is getting sent to an HTTP server, what about replacing the hyphen with "%2D"?
â ErikF
Mar 5 at 16:11
The
--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 5 at 20:21