Pass the output path as an argument. 

Now you can pass the Output path as an argument. If no Output path is specified, the files will be downloaded into the source directory of the script.
If an output path doesn't exist, the script will create it.