Just added this and it worked first time. It seems to keep skipping the track though after about the first 10 seconds, and the only way to stop it doing so is to turn off the slider on the frontend, therefore turning off the music.
Tried to use Kodi for the media player.
17-02-14 23:47:24 INFO (Thread-1) [gmusicapi.protocol.shared] could not locate client caller in stack:
File "/usr/lib/python3.4/threading.py", line 888, in _bootstrap
self._bootstrap_inner()
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 65, in _worker
work_item.run()
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 120, in turn_on
self._play()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 206, in _play
self._next_track()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 187, in _next_track
self._next_track()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 171, in _next_track
url = self._api.get_stream_url(track['trackId'])
File "<decorator-gen-102>", line 2, in get_stream_url
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/utils/utils.py", line 293, in wrapper
return function(*args, **kw)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/clients/mobileclient.py", line 371, in get_stream_url
return self._make_call(mobileclient.GetStreamUrl, song_id, device_id, quality)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/clients/shared.py", line 84, in _make_call
return protocol.perform(self.session, self.validate, *args, **kwargs)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/protocol/shared.py", line 199, in perform
log.debug("%s(args=%s, kwargs=%s)",
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/utils/utils.py", line 107, in __getattr__
stack = traceback.extract_stack()
17-02-14 23:47:25 INFO (Thread-1) [gmusicapi.protocol.shared] could not locate client caller in stack:
File "/usr/lib/python3.4/threading.py", line 888, in _bootstrap
self._bootstrap_inner()
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 65, in _worker
work_item.run()
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 120, in turn_on
self._play()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 206, in _play
self._next_track()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 187, in _next_track
self._next_track()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 171, in _next_track
url = self._api.get_stream_url(track['trackId'])
File "<decorator-gen-102>", line 2, in get_stream_url
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/utils/utils.py", line 293, in wrapper
return function(*args, **kw)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/clients/mobileclient.py", line 371, in get_stream_url
return self._make_call(mobileclient.GetStreamUrl, song_id, device_id, quality)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/clients/shared.py", line 84, in _make_call
return protocol.perform(self.session, self.validate, *args, **kwargs)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/protocol/shared.py", line 243, in perform
log.debug(cls.filter_response(parsed_response))
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/utils/utils.py", line 107, in __getattr__
stack = traceback.extract_stack()
17-02-14 23:47:25 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=play_media, service_call_id=3052433168-19, service_dataskyjam&begin=0&upn=RRje980bWwE&o=00658768575318539133&ratebypass=yes&ip=<IP-REMOVED>&ipbits=0&expire=1487116134&sparams=expire,id,ip,ipbits,itag,mm,mn,ms,mv,87115983&mv=m&pl=24, entity_id=media_player.kodi_laptop, domain=media_player>
17-02-14 23:47:27 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state media_player.kodi_laptop=playing; friendly_na17-02-14T23:47:23.835552+00:00>, old_state=<state media_player.kodi_laptop=playing; friendly_name=Kodi Laptop, media_content_type=audio, media_duration=215,
17-02-14 23:47:27 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=3052433168-19>
17-02-14 23:47:28 INFO (Thread-1) [gmusicapi.protocol.shared] could not locate client caller in stack:
File "/usr/lib/python3.4/threading.py", line 888, in _bootstrap
self._bootstrap_inner()
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 65, in _worker
work_item.run()
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 120, in turn_on
self._play()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 206, in _play
self._next_track()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 187, in _next_track
self._next_track()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 187, in _next_track
self._next_track()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 171, in _next_track
url = self._api.get_stream_url(track['trackId'])
File "<decorator-gen-102>", line 2, in get_stream_url
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/utils/utils.py", line 293, in wrapper
return function(*args, **kw)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/clients/mobileclient.py", line 371, in get_stream_url
return self._make_call(mobileclient.GetStreamUrl, song_id, device_id, quality)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/clients/shared.py", line 84, in _make_call
return protocol.perform(self.session, self.validate, *args, **kwargs)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/protocol/shared.py", line 199, in perform
log.debug("%s(args=%s, kwargs=%s)",
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/utils/utils.py", line 107, in __getattr__
stack = traceback.extract_stack()
17-02-14 23:47:28 INFO (Thread-1) [gmusicapi.protocol.shared] could not locate client caller in stack:
File "/usr/lib/python3.4/threading.py", line 888, in _bootstrap
self._bootstrap_inner()
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 65, in _worker
work_item.run()
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 120, in turn_on
self._play()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 206, in _play
self._next_track()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 187, in _next_track
self._next_track()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 187, in _next_track
self._next_track()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 171, in _next_track
url = self._api.get_stream_url(track['trackId'])
File "<decorator-gen-102>", line 2, in get_stream_url
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/utils/utils.py", line 293, in wrapper
return function(*args, **kw)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/clients/mobileclient.py", line 371, in get_stream_url
return self._make_call(mobileclient.GetStreamUrl, song_id, device_id, quality)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/clients/shared.py", line 84, in _make_call
return protocol.perform(self.session, self.validate, *args, **kwargs)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/protocol/shared.py", line 243, in perform
log.debug(cls.filter_response(parsed_response))
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/gmusicapi/utils/utils.py", line 107, in __getattr__
stack = traceback.extract_stack()
17-02-14 23:47:28 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=play_media, service_call_id=3052433168-20, service_data&source=skyjam&begin=0&upn=7EjTEuB5U2c&o=00658768575318539133&ratebypass=yes&ip=<IP-REMOVED>&ipbits=0&expire=1487116138&sparams=expire,id,ip,ipbits,itag,mm,mcims&ms=au&mt=1487115983&mv=m&pl=24, entity_id=media_player.kodi_laptop, domain=media_player>
17-02-14 23:47:31 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state media_player.kodi_laptop=playing; friendly_na17-02-14T23:47:23.835552+00:00>, old_state=<state media_player.kodi_laptop=playing; friendly_name=Kodi Laptop, media_content_type=audio, media_duration=326, aptop>
17-02-14 23:47:31 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=3052433168-20>
17-02-14 23:47:32 INFO (Thread-1) [gmusicapi.protocol.shared] could not locate client caller in stack:
File "/usr/lib/python3.4/threading.py", line 888, in _bootstrap
self._bootstrap_inner()
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 65, i