-
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
gmusic: Adapt to gmusicapi change in 12.0.0 that moved OAUTH_FILEPATH #3270
Comments
Here's a Markdown tip: use "fenced code blocks" (see the docs) to preserve the formatting of pastes from the terminal. Looks like version 12.0.0 of the gmusicapi module, which was released in January, removed something this plugin was relying on. Can you try installing an older version of the module to confirm that this is the problem? |
..........and thats why I love the community; when you get little learning tips like that! Cheers @sampsyo. I'll remove gmusicapi and install an earlier version and report back. |
ok....soooo Removed gmusicapi installed specific version ran I copy and pasted the authorsation code and then this then threw and error /home/jlivin25/.local/lib/python2.7/site-packages/gmusicapi/__init__.py:4: GmusicapiWarning: gmusicapi.clients.OAUTH_FILEPATH is deprecated and will be removed; use Musicmanager.OAUTH_FILEPATH
from gmusicapi.clients import Webclient, Musicmanager, Mobileclient
Visit the following url:
https://accounts.google.com/o/oauth2/v2/auth?scope=REDACTED
Follow the prompts, then paste the auth code here and hit enter: REDACTED
Traceback (most recent call last):
File "/home/jlivin25/.local/bin/beet", line 11, in <module>
sys.exit(main())
File "/home/jlivin25/.local/lib/python2.7/site-packages/beets/ui/__init__.py", line 1266, in main
_raw_main(args)
File "/home/jlivin25/.local/lib/python2.7/site-packages/beets/ui/__init__.py", line 1253, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/home/jlivin25/.local/lib/python2.7/site-packages/beetsplug/gmusic.py", line 78, in upload
self.authenticate()
File "/home/jlivin25/.local/lib/python2.7/site-packages/beetsplug/gmusic.py", line 73, in authenticate
self.m.perform_oauth(oauth_file)
File "/home/jlivin25/.local/lib/python2.7/site-packages/gmusicapi/clients/shared.py", line 168, in perform_oauth
storage.put(credentials)
File "/home/jlivin25/.local/lib/python2.7/site-packages/oauth2client/client.py", line 421, in put
self.locked_put(credentials)
File "/home/jlivin25/.local/lib/python2.7/site-packages/oauth2client/file.py", line 83, in locked_put
self._create_file_if_needed()
File "/home/jlivin25/.local/lib/python2.7/site-packages/oauth2client/file.py", line 70, in _create_file_if_needed
open(self._filename, 'a+b').close()
IOError: [Errno 2] No such file or directory: u'~/.config/beets/oauth.cred' I'm not sure now if this is still an issue or something I'm doing wrong. |
OK! Looks like that was indeed the problem, but now there's a second problem… I've changed the title of this issue to reflect the problem with gmusicapi 12.0.0. I notice that you have a custom Line 65 in 3399154
needs to use |
Yep that sorted it! .......I wasn't necessarily going for a custom location I'm just not hugely competent so followed the example from the plugin page... Changed the oauth file path to an absolute one and that sorted it. Cheers! |
Great! I have pushed what I believe to be a fix for both of these problems (i.e., |
Ok so I've removed gmusicapi 11.1.1 and reinstalled version 12. my gmusic api section in the config reads:
if I run I get the following error Traceback (most recent call last):
File "/home/jlivin25/.local/bin/beet", line 11, in <module>
sys.exit(main())
File "/home/jlivin25/.local/lib/python2.7/site-packages/beets/ui/__init__.py", line 1266, in main
_raw_main(args)
File "/home/jlivin25/.local/lib/python2.7/site-packages/beets/ui/__init__.py", line 1249, in _raw_main
subcommands, plugins, lib = _setup(options, lib)
File "/home/jlivin25/.local/lib/python2.7/site-packages/beets/ui/__init__.py", line 1135, in _setup
plugins = _load_plugins(config)
File "/home/jlivin25/.local/lib/python2.7/site-packages/beets/ui/__init__.py", line 1121, in _load_plugins
plugins.send("pluginload")
File "/home/jlivin25/.local/lib/python2.7/site-packages/beets/plugins.py", line 488, in send
for handler in event_handlers()[event]:
File "/home/jlivin25/.local/lib/python2.7/site-packages/beets/plugins.py", line 471, in event_handlers
for plugin in find_plugins():
File "/home/jlivin25/.local/lib/python2.7/site-packages/beets/plugins.py", line 307, in find_plugins
_instances[cls] = cls()
File "/home/jlivin25/.local/lib/python2.7/site-packages/beetsplug/gmusic.py", line 39, in __init__
u'oauth_file': gmusicapi.clients.OAUTH_FILEPATH,
AttributeError: 'module' object has no attribute 'OAUTH_FILEPATH' Uninstalling gmusicapi 12, reinstalling 11.1.1, and re-running Interestingly and I don't know if this is relevant, then moving to query gmusic for an uploaded artist
results in a what appears to be an error: /home/jlivin25/.local/lib/python2.7/site-packages/gmusicapi/__init__.py:4: GmusicapiWarning: gmusicapi.clients.OAUTH_FILEPATH is deprecated and will be removed; use Musicmanager.OAUTH_FILEPATH
from gmusicapi.clients import Webclient, Musicmanager, Mobileclient
Traceback (most recent call last):
File "/home/jlivin25/.local/bin/beet", line 11, in <module>
sys.exit(main())
File "/home/jlivin25/.local/lib/python2.7/site-packages/beets/ui/__init__.py", line 1266, in main
_raw_main(args)
File "/home/jlivin25/.local/lib/python2.7/site-packages/beets/ui/__init__.py", line 1253, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/home/jlivin25/.local/lib/python2.7/site-packages/beetsplug/gmusic.py", line 108, in search
or Mobileclient.FROM_MAC_ADDRESS).upper()
AttributeError: 'newobject' object has no attribute 'upper' |
Hmm; it looks like you may not have gotten the latest changes to beets? You can try running from source (and hence picking up the change I just committed) by following the instructions in the FAQ: |
ok so I removed beets and gmusicapi using, installed beets using and gmusicapi 12 using, The command The command Traceback (most recent call last):
File "/home/jlivin25/.local/bin/beet", line 11, in <module>
load_entry_point('beets==1.4.9', 'console_scripts', 'beet')()
File "/home/jlivin25/.local/lib/python2.7/site-packages/beets/ui/__init__.py", line 1266, in main
_raw_main(args)
File "/home/jlivin25/.local/lib/python2.7/site-packages/beets/ui/__init__.py", line 1253, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/home/jlivin25/.local/lib/python2.7/site-packages/beetsplug/gmusic.py", line 115, in search
or Mobileclient.FROM_MAC_ADDRESS).upper()
AttributeError: 'newobject' object has no attribute 'upper' Thanks for all the help @sampsyo , appreciate all you do. Beets is a thing of wonder to me and I've barely scratched the surface! |
Yo, it looks like this is yet a third bug in this plugin! Would you mind opening a new issue for this one? Roughly speaking, I think this: Lines 113 to 115 in d77a13e
Needs to become this: new_device_id = ((device_id.as_str()
or uploader_id.as_str().replace(':', '')).upper()
or Mobileclient.FROM_MAC_ADDRESS) but we'll need to try it out to work out the details. |
Hi @sampsyo. Yep no problems, I'll get it posted this afternoon (UK time)... |
Problem
I installed the gmusic plugin using the documentation
pip install gmusicapi
and enabled in my configRunning this command in verbose (-vv) mode:
$ beet -vv import /home/jlivin25/Music/Uploads/
Led to this problem:
Here's a link to the music files that trigger the bug (if relevant): N/A
Setup
OS: Ubuntu 16.04.6 LTS
Python version: Python 2.7.12
beets version: 1.4.8
Turning off plugins made problem go away (no): In this instance its a plugin i'm trying to use (gmusic)
My configuration (output of beet config) is:
Error: https://pastebin.com/y20KKLxc
config.yaml https://pastebin.com/2u877j5s
The text was updated successfully, but these errors were encountered: