mopidy / mopidy-gmusic

DEPRECATED (Mopidy extension for playing music from Google Play Music)
https://mopidy.com
Apache License 2.0
214 stars 60 forks source link

Noob unable to get gmusic working extension disabled due to config errors #156

Closed djl236 closed 8 years ago

djl236 commented 8 years ago

Noob here trying to get gmusic with mopidy working on a raspberry pi 3. Mopidy and moped seem to be working as I can open moped in a web browswer. GMusic extension stays disabled due to config error. I ran sudo pip install mopidy-gmusic --upgrade today to see if that would help but it just stays disabled due to config error. I do have the correct google username, password and device id. I have a paid account as well.

Here's my config:

Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf config" as user mopidy
[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy
max_tracklist_length = 10000

[logging]
color = true
console_format = %(levelname)-8s %(message)s
debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n  %(message)s
debug_file = /var/log/mopidy/mopidy-debug.log
config_file = /etc/mopidy/logging.conf

[audio]
mixer = software
mixer_volume = 
output = autoaudiosink
buffer_time = 

[proxy]
scheme = 
hostname = 
port = 
username = 
password = 

[moped]
enabled = true

[gmusic]
enabled = false  ; Extension disabled due to config errors.
username = username
password = ********
bitrate = 320
deviceid = ****************
all_access = false
refresh_library = 1440
refresh_playlists = 60
radio_stations_in_browse = true
radio_stations_as_playlists = true
radio_stations_count = 
radio_tracks_count = 25

[mpd]
enabled = true
hostname = ::
port = 6601
password = 
max_connections = 10
connection_timeout = 60
zeroconf = Mopidy MPD server on $hostname
command_blacklist = 
  listall
  listallinfo
default_playlist_scheme = m3u

[http]
enabled = true
hostname = ::
port = 6680
static_dir =
zeroconf = Mopidy HTTP server on $hostname

[stream]
enabled = true
protocols = 
  http
  https
  mms
  rtmp
  rtmps
  rtsp
metadata_blacklist = 
timeout = 5000

[m3u]
enabled = true
base_dir =
default_encoding = latin-1
default_extension = .m3u8
playlists_dir = /var/lib/mopidy/playlists

[softwaremixer]
enabled = true

[file]
enabled = true
media_dirs = 
  $XDG_MUSIC_DIR|Music
  ~/|Home
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[local]
enabled = true
library = json
media_dir = /media/music
scan_timeout = 1000
scan_flush_threshold = 100
scan_follow_symlinks = false
excluded_file_extensions = 
  .directory
  .html
  .jpeg
  .jpg
  .log
  .nfo
  .png
  .txt
belak commented 8 years ago

Hm, I've tried with the same settings as you and it appears to work for me:

username = username
password = ************
all_access = true
bitrate = 320
deviceid = ************
all_access = false
refresh_library = 1440
refresh_playlists = 60
radio_stations_in_browse = true
radio_stations_as_playlists = true
radio_stations_count =
radio_tracks_count = 25

Do you have 2-factor login enabled? If you do, you'll need to generate an app password to use with mopidy-gmusic.

djl236 commented 8 years ago

I do use 2 factor and am also using a generated app specific password. I made sure I copied it exact too.

belak commented 8 years ago

Have you tried with your full email in the username field?

djl236 commented 8 years ago

I just added the @gmail.com and am still receiving the same message.

When I type 'mopidy' into a terminal window, among all the text that pops up is this:

WARNING Found gmusic configuration errors, the extension has been automatically disabled: WARNING gmusic/username must be set. WARNING gmusic/password must be set. WARNING Please fix the extension configuration errors or disable the extensions to silence these messages.

djl236 commented 8 years ago

I've set mopidy to run as a service too (or at least I think I have, I know I was trying too).

pi@raspberrypi:~ $ mopidy INFO Starting Mopidy 2.0.1 INFO Loading config from builtin defaults INFO Loading config from /home/pi/.config/mopidy/mopidy.conf INFO Loading config from command line options INFO Enabled extensions: mpd, http, file, stream, m3u, softwaremixer, moped, local INFO Disabled extensions: gmusic WARNING Found gmusic configuration errors, the extension has been automatically disabled: WARNING gmusic/username must be set. WARNING gmusic/password must be set. WARNING Please fix the extension configuration errors or disable the extensions to silence these messages. INFO Starting Mopidy mixer: SoftwareMixer INFO Starting Mopidy audio INFO Starting Mopidy backends: StreamBackend, M3UBackend, FileBackend, LocalBackend INFO Audio output set to "autoaudiosink" INFO Creating dir /home/pi/.local/share/mopidy/m3u INFO Creating dir /home/pi/.local/share/mopidy/local INFO No local library metadata cache found at /home/pi/.local/share/mopidy/local/library.json.gz. Please run mopidy local scan to index your local music library. If you do not have a local music collection, you can disable the local backend to hide this message. INFO Loaded 0 local tracks using json INFO Starting Mopidy core INFO Starting Mopidy frontends: MpdFrontend, HttpFrontend INFO MPD server running at [::ffff:127.0.0.1]:6600 ERROR Frontend (HttpFrontend) initialization error: HTTP server startup failed: [Errno 98] Address already in use INFO Starting GLib mainloop

kingosticks commented 8 years ago

Typing Mopidy in a terminal does not run as a service and will load the config from ~/.config/mopidy/mopidy.conf. see https://docs.mopidy.com/en/latest/service/

djl236 commented 8 years ago

Right, but I can start and stop it as a service and it still won't work.

Maybe for some reason its looking at the wrong config?

kingosticks commented 8 years ago

It should print out what config it's using in the log

belak commented 8 years ago

What file have you been using?

djl236 commented 8 years ago

What do you mean what file?

djl236 commented 8 years ago

Maybe I should just start this all over from scratch. I found the documentation to be not very beginner friendly. Is there a how-to guide anywhere?

belak commented 8 years ago

Sorry, I was wondering where you had put your config file. It looks like whichever file you've been editing hasn't been used, if the logs are any indication.

I'm not sure if you use IRC, but it would be a bit easier to try and get you up and running somewhere we can have more of a conversation without multiple-hour gaps. I'm usually in #mopidy on freenode as belak.

I don't know of any guides off the top of my head, but someone else might.

djl236 commented 8 years ago

I actually edited both config files.

I'm installing IRC now, I'll see if you're online.

Thank you to everyone so far for being patient and helpful.

belak commented 8 years ago

There's always http://webchat.freenode.net/ as well, so you wouldn't have to install anything.

djl236 commented 8 years ago

Ok so I got it working by starting from scratch with a fresh Jessie Lite install. I did not however try to run it as a service this time.

So two things I want to work on now to tweak it:

  1. Is there anyway to get my Google Music radio stations to have more than 25 tracks? I've tried leaving that parameter blank in the config and I've tried using numbers higher than 25 but its always 25 tracks per station.
  2. Is it possible to get mopidy to run on startup when the Pi is powered on without running it as a service and how would I do this?

Thank you all so much.

belak commented 8 years ago

Currently the answer to the first question is no. All devices, even official ones, only get 25 tracks at a time for radio stations via the API. I'd like to implement a method of tracking a radio station and refilling the list when it gets full, similar to the pandora plugin but that isn't a very high priority because of the complexity it adds.

I'm not familiar with running gmusic on the Pi, so I'll let someone answer that one who knows what they're talking about.

Glad you got it working!

djl236 commented 8 years ago

I'm just running it as a service

As for the tracks, I set the variable in the config to like 150 and low and behold more than 25 tracks appeared when I opened a station. A lot of tracks appeared so I dunno.

Also noticed its slow as fuck to use, not even really useable when the material web client is installed and used. Switched to the music box web client and it works so much better.

belak commented 8 years ago

I try really hard to make sure each action only takes one API call. There are still a few methods which need to be implemented for improvements on that (I believe get_distinct is missing) but most clients should also conform to that. I'm guessing that the Material web client hits some of those unimplemented functions which, fall back to slower things.

I wasn't aware there was a config option, but I'm glad you found one.

djl236 commented 8 years ago

This is the config option I used to get more than 25 tracks to appear on a station:

radio_tracks_count = 150

belak commented 8 years ago

It sounds like this has mostly been solved?

djl236 commented 8 years ago

Yeah, it seems to be finally working well. Thank you for all your help.