Skip to content
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

Merged
merged 2 commits into from
Jul 21, 2017
Merged

Fixes #44 and minor changes #46

merged 2 commits into from
Jul 21, 2017

Conversation

iambibhas
Copy link
Contributor

No description provided.

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 += '/'
Copy link
Contributor Author

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?

Copy link
Owner

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

Copy link
Owner

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 :)
image

@@ -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.')
Copy link
Contributor Author

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.

Copy link
Owner

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'])
Copy link
Contributor Author

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?

Copy link
Owner

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)
Copy link
Contributor Author

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',
Copy link
Contributor Author

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?

Copy link
Owner

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+

Copy link
Contributor Author

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.

Copy link
Owner

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

@SathyaBhat SathyaBhat changed the base branch from master to dev July 1, 2017 15:34
@SathyaBhat SathyaBhat merged commit ad75a6f into SathyaBhat:dev Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants