dszopa / youtube-song-downloader

A Python program used to search and download songs from Youtube
MIT License
2 stars 1 forks source link

Cannot change save directory #1

Open jackbanditdude opened 8 years ago

jackbanditdude commented 8 years ago

Issuing to the command line youtube-song-downloader --changeSaveDir C:\Usersname\Music (or any variation thereof) returns the error about the "The specified save directory /Users/danny/Music/test/ does not exist!"

jackbanditdude commented 8 years ago

It appears installing with PIP does not install the most recent version on GitHub, which appears to handle this problem. Manually modifying the settings.json file allows a user to set the download directory.

gopalvq commented 8 years ago

Same issue for me. May I know how you changed settings.json file? I have installed youtube-song-downloader through pycharm and unable to access settings.json file? Help would be appreciated.

dszopa commented 8 years ago

Hmm, I seem to be unable to recreate the issue. I tried uninstalling and reinstalling with PIP and had no issues on Mac, I'll try on linux and windows as soon as possible.

So you type in youtube-song-downloader --changeSaveDir (Directory path) and get an error? or are you then getting an error in the fact that the path is not actually changed for the application when trying to download? Like then executing youtube-song-downloader "song name" causes the error?

gopalvq commented 8 years ago

May be you have that directory in your computer. That's why it's not throwing an error. Is it possible to put directory as variable and let user enter the directory path themselves?

gopalvq commented 8 years ago

I was able to fix it by changing settings.json file as jackbanditdude suggested but wasted some time to figure it out. It would be beneficial to others if you can fix the directory issue. thanks for your efforts.

dszopa commented 8 years ago

Yeah what it does right now is it reads the directory from the settings.json file. I tried changing it and downloading a song to a different directory on my computer and was able to do it with no issues. I was also able to get it to throw the "Directory does not exist" error as expected

dszopa commented 8 years ago

Alright i just managed to break it. I'll try to resolve it

dszopa commented 8 years ago

Okay it seems to be the issue is that on windows if you don't wrap paths in quotations python registers (character here) as another unicode character. I'll change it so that all \'s read for the path input are changed to \ so that it takes the correct input

dszopa commented 8 years ago

Upon thinking about this some more the issue is not really one with the program but it was one with how it was being used. The program works fine if you wrap C:\Usersname\Music in quotes like "C:\Usersname\Music" this way the string is properly initialized and just like when specifying a song name you also need to wrap Artist Name - Song Name in quotes like "Artist Name - Song Name" otherwise the spaces count the strings to be different things. I will try and make this clearer in the documentation.

developez commented 5 years ago

For anyone with the same problem in windows:

Go to:

C:\Python27\Lib\site-packages\ytsdl

Edit: settings.json

Replace the windows route:

Example:

{
    "previousDirectory": "J:\\Music\\Youtube", 
    "saveDirectory": "J:\\Music\\Youtube"
}