-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add Google Music plugin #2586
Add Google Music plugin #2586
Conversation
It seems like Travis has a problem running test for docs: |
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.
Cool! This seems neat. Thanks for opening the pull request to revive the plugin! This seems like it should be useful for people in the Google ecosystem. Here are a few suggestions and an explanation for the Travis complaint.
beetsplug/gmusic.py
Outdated
try: | ||
mobile.login(email, password, Mobileclient.FROM_MAC_ADDRESS) | ||
files = mobile.get_all_songs() | ||
except: |
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.
Travis is complaining about this bare except:
. In general, it's nicer to identify exactly which exceptions can be raised. Are there exception classes in gmusicapi
that we should be paying attention to?
Gmusic Plugin | ||
============= | ||
|
||
This plugin allows you to manage your Google Play Music library with beets. |
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 docs should probably explain that you need to install the gmusicapi
module from pip to use this plugin, right? (See other plugin documentation for examples—e.g., lyrics
or lastgenre
.)
beetsplug/gmusic.py
Outdated
if os.path.isfile(gmusicapi.clients.OAUTH_FILEPATH): | ||
m.login() | ||
else: | ||
m.perform_oauth() |
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.
Instead of using a global variable for the Musicmanager
, is it possible to use a field on the Gmusic
class? That can make debugging much easier.
beetsplug/gmusic.py
Outdated
|
||
def search(self, lib, opts, args): | ||
email = config['gmusic']['email'].as_str() | ||
password = config['gmusic']['password'].as_str() |
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.
It would be a good idea to mark the password field (and possibly the email field) as redacted. See other plugins that use passwords in the config file for how to do this.
docs/plugins/gmusic.rst
Outdated
email: email | ||
password: password | ||
|
||
It's not necessary if you only upload files. |
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.
Maybe move this disclaimer to before the configuration listing?
Remove Musicmanager global variable. Update gmusic.rst
@sampsyo fixed it. |
Cool; thanks! The only other thing Travis is complaining about is that we need to list the new document in the main |
Is there any Google Music API to use for login credentials instead of storing it locally? |
@sampsyo should I put it under 'Miscellaneous' section? |
@owcz unfortunately no. |
Yes, sounds good! |
Thank you again for your quick work on this, @tigranl! This looks awesome again. I've merged, refined the docs a bit, and added a changelog. |
Here is @owcz requested implementation of Google Music plugin (#2553). Plugin is able to search and upload tracks to GM library. Options and arguments are specified in the doc file.