murrty / youtube-dl-gui

Download/Convert videos from websites without needing to learn command line
GNU General Public License v3.0
430 stars 44 forks source link

[Bug] Copying link with newline has cryptic error message #77

Closed Trainzack closed 3 years ago

Trainzack commented 3 years ago

If you copy a link that starts with a newline (likely by accident), the program will attempt to create an output directory with a newline in the name, which of course fails. Newlines should either be stripped before starting the download process, or a better error message should be displayed.

murrty commented 3 years ago

I don't think it's my program that does that, it doesn't create new directories when downloading, it lets youtube-dl handle that (to prevent clutter when a download doesn't work). I can, however, filter out the chars that windows deems inappropriate.

Do you have an example of the cryptic error message, and an example URL? I can look into it more, but I cannot reproduce the errors with a new line in the URL, since youtube-dl throws an error before my program can.

Trainzack commented 3 years ago

Yeah, the error that youtube-dl throws is the one I was referring to. Your program didn't throw any error message (although I think many people wouldn't understand the difference). In my case, it was complaining about not being able to create a directory with a newline in the name. I think that filtering out chars that cannot be in a URL is probably the correct solution here.