diff --git a/README.md b/README.md index e6efaaa..07be5f8 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,10 @@ Shift+right-click on empty area and open cmd and type: `"Scripts/pip.exe" install -U -r requirements.txt` +- If you do not want to naviagte to your python folder from the command-line everytime you want to run the script, you can have your python 'PATH' environment variables set and then you can run the script from any directory. + - python install folder: like (C:\Program Files\Python36) + - python scripts folder: like (C:\Program Files\Python36\Scripts) + ## Instructions for Downloading Songs - For all available options, run `python spotdl.py --help` (or for windows run `python.exe spotdl.py --help`). diff --git a/spotdl.py b/spotdl.py index 5ac585b..a3e09c0 100644 --- a/spotdl.py +++ b/spotdl.py @@ -168,23 +168,17 @@ def downloadSong(content): def convertWithAvconv(music_file): if os.name == 'nt': - os.system( - 'Scripts\\avconv.exe -loglevel 0 -i "' + - 'Music/' + - music_file + - '.m4a" -ab 192k "' + - 'Music/' + - music_file + - '.mp3"') + avconv_path = 'Scripts\\avconv.exe' else: - os.system( - 'avconv -loglevel 0 -i "' + - 'Music/' + - music_file + - '.m4a" -ab 192k "' + - 'Music/' + - music_file + - '.mp3"') + avconv_path = 'avconv' + os.system( + avconv_path + ' -loglevel 0 -i "' + + 'Music/' + + music_file + + '.m4a" -ab 192k "' + + 'Music/' + + music_file + + '.mp3"') os.remove('Music/' + music_file + '.m4a')