-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #44 and minor changes #46
Conversation
download_directory = args.output + '/' + playlist | ||
# Check whether directory has a trailing slash or not | ||
if len(download_directory) >= 0 and download_directory[-1] != '/': | ||
download_directory += '/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SathyaBhat why were you checking if the path had a trailing slash? it's not really needed. Needed on windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iambibhas i'm not sure. that came as a contrib, didn't pay much attention
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iambibhas well now I know why that piece of code is required :)
@@ -29,22 +30,24 @@ def spotify_dl(): | |||
parser.add_argument('-v', '--version', action='store_true', | |||
help='Shows current version of the program') | |||
parser.add_argument('-o', '--output', type=str, action='store', | |||
nargs='*', help='Specify download directory.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nargs='*'
sends that arguments as a list. I'm assuming that there can only be one output directory at a time for a playlist. so we just need one value. returning list just makes thing complicated. This fixes #44.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, one at a time. thanks
parser.add_argument('-u', '--user_id', action='store', | ||
help='Specify the playlist owner\'s userid when it' | ||
' is different than your spotify userid') | ||
parser.add_argument('-i', '--uri', type=str, action='store', | ||
nargs='*', help='Given a URI, download it.') | ||
parser.add_argument('-f', '--format_str', type=str, action='store', | ||
nargs='*', help='Specify youtube-dl format string.', | ||
default=['bestaudio/best']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Only one audio quality at a time, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
uri = ":".join(url) | ||
uri = "spotify:" + uri | ||
args.uri = [] | ||
args.uri.append(uri) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need it to be a list?
@@ -16,6 +16,7 @@ | |||
setup( | |||
name='spotify_dl', | |||
version=version, | |||
python_requires='>=3', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only tells pip>=9.0 that the package is for python3 only. For older pip versions, it'll still get installed and fail. Do you want the package to support python2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the package still works on py2 I believe, but yeah better to make it py3+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can make it support both. there are still too many people using python2 as default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iambibhas sorry for the late reply. I do mention Py3 is required, so feel better to enforce that
No description provided.