ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
130.83k stars 9.89k forks source link

Youtube-dl Produces |Error on use of well-formed youtube URLs starting with simple hyphen #29865

Closed Ramana3031 closed 2 years ago

Ramana3031 commented 2 years ago

Using latest YouTube-dl 2021.06.06 (and also earlier versions, before this occasion), with well-formed YouTube URLs such as this one = -YjDc8aY9MA, which starts with the simple (short) hyphen, (not the long dash), produces = youtube-dl.exe: error: no such option: -Y, obviously interpreting the hyphen as the special character introducing an option "option".

The full URL is rejected in the command line as = ERROR: Unsupported URL, but accepted if is it is part of a list given at the command line with -a list.txt. I have tried all the escape characters I know and googled, including ", ', ^, \, ,, ~, !, #, $, ... but none of these worked.

I have met this error before, and couldn't be brave enough to report it. Even this time I am not sure I am following exact protocol. If so, sorry!!! If you can help with a fix, thanx a million, is that correct English ? Also, Sorry, I couldn't place this in any of the categories listed. Also, an issue was raised about a title containing an underscore, but this is an URL and the hyphen is at the beginning

ghost commented 2 years ago

https://github.com/ytdl-org/youtube-dl#how-do-i-download-a-video-starting-with-a--

Ramana3031 commented 2 years ago

Dear Kikuyan, Today, I have been working on Advaita meditations, "I am not the Doer", "I know Nothing", "I am Nothing". The feeling of Nothingness immediately gives way to the feeling of Fullness and outpouring of immense love. As I read your solution and the full file with the other details on installation, download variations, ffmpeg, etc., besides feeling that I have added to your busy schedule with resolving new and real issues, and made your life more complicated by posting an issue for which I could have discovered the solution myself, if I had worked a bit harder, since it already existed, but my ego perhaps wanted to score within me an easy, illusory, and fictitious point by saying it found an error in YouTube-dl on the scoresheet of such hard working people as yourself who are offering, as open source, such a great and small program that is vastly superior to paying and pricy applications with flashy user interfaces and sparkly whistles and bells, which nevertheless fail repeatedly with long playlists and channels and no-where near enough to YouTube-dl in offering its amount of invaluable and endless options, such as annotations, descriptions, subtitles, video and audio qualities, ... As I read your solution, I felt how much of your time and effort and dedication you give to this seemingly small project, but which in reality is such a large and vast application, also leveraging all the power of win cmd line, py and ffmpeg, and so many and much more that I do not know about, perhaps involving the use of Unix, Linux, etc. I felt that besides adding to the ease of my life by offering a straightforward way of downloading files that can be easily automated by batch files and text lists, besides configuration files, you also added to my knowledge of YouTube-dl and more info and solutions about installation and paths ... You really do render an invaluable service to the internet community and especially to members of this community in third-world countries, such as closed-currency countries, that cannot export international currencies and so cannot pay for so many things that are offered in US Dollars or Euros and such, even using PayPal or Click Bank. I felt such an outpouring of love for you and I remembered my lab days as I tried to fathom the depths of Cambridge Lisp, to write a program on computational linguistics, as a student coming from humanities, not science ! I envy your big heart and your great talent. I wish you the best and hope that, despite the stories I read in the solution file of people not following instructions and multiplying your burden while you could be working on further expansions or more improvements, my few words here make a difference and bring you more encouragement and that you continue with even grater enthusiasm. I hope in a future life, I can be you, serving the great good of the greatest number of people while enjoying creativity, and having the talent, insight, and focus to resolve great computer technology issues in the face of the challenges raised by the dominion of big business over such issues, while keeping in mind where everything is and the current state of each program component. Today, you made it easier so much for me to feel "I am not the Doer", "I know Nothing, "I am Nothing" and that when I reach out for the Infinite, it is real and possible and it is in all who are in essence you, at least in the open-source community and such groups imbued with civil and human universal values. So here goes: "Greatest, unconditional love and best wishes for continued success, with sincere, warm-hearted and biggest thanks" :) :) :) 👍 👍 👍 💯 💯 💯 🥇

ghost commented 2 years ago

If you are saying that the problem has been resolved, please close this.

Ramana3031 commented 2 years ago

Hi. I am sorry. I have just seen your comment and emails, as I had not logged in since my last comment above. Also, I was not aware I had to close the issue. But first, I can say that I have just checked again the solution offered and it works when I use youtube-dl ---xyzabwvncd; but when I use this = ytb1v -- -xyzabwvncd , where ytb1v runs a dos batch (ytb1v.bat) script as follows = `@echo off `@echo on youtube-dl.exe ^ -i ^ -c ^ -o "%%(title)s.%%(ext)s" ^ -f "best" ^ `%1 `@echo off `:: pause `goto :EOF , the command fails, producing the same error as before, (without --).

I do not know if this is within the scope of youtube-dl issues or my own issue. If it is not within your mission to resolve it, then please consider this issue closed. And I will close it after your reply or comment. Otherwise, I would be curious to know how the '-' can be escaped by the DOS batch command, while keeping the inside of the batch file applicable to both the URLs starting with a '-' or without.

Once again, sorry for the delay, Sometimes, my already slow connection is also limited by a metered data-enabled scheme, and/or cellular providers (I live in a remote rural area of the island of Djerba, Tunisia, an area severely constrained in places by an aging 3G network, just now being very slowly revamped with fiber optics, etc.. Thank you for your kindness and patience.

rautamiekka commented 2 years ago

Use the code tags around code cuz the @ turns into an at-mention, among other things becoming something unwanted, which is basically spam to the victim.

Ramana3031 commented 2 years ago

Thank you. Could you please briefly explain by example what you mean by "code tags", "around code" "the @ turns into", "at-mention" ... Where to use these tags? where does "@ turn into an at-mention". (Notes: 1. I am a beginner in this. 2. I just copied the above Windows DOS batch script to my pc , as I did not know, despite several attempts, to include it in a configuration, and this started my system hanging?). If you mean in these comment boxes, I assumed they are simple text boxes, and will not execute inside the issues forum. So I have googled my questions in this box, then looked at edit tools, so I got a little what you meant. So I've edited my msg above, but may be the tags are not in the right places. Sorry about all this...