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

Ads are not always registered properly #37

Closed
jcass77 opened this issue Dec 10, 2015 · 2 comments
Closed

Ads are not always registered properly #37

jcass77 opened this issue Dec 10, 2015 · 2 comments
Milestone

Comments

@jcass77
Copy link
Member

jcass77 commented Dec 10, 2015

Pydora sometimes fails to register ads. Stack trace in the log:

DEBUG 2015-12-10 08:37:34,256 [30759:PandoraBackend-14] requests.packages.urllib3.connectionpool
"POST /services/json/?partner_id=42&auth_token=VIOOYNDHJ2MOZSW2QBeDbkfJwMfpazG7ab9kx4AktYYccgZMSdSPJWrQ%3D%3D&user_id=175482532&method=ad.registerAd HTTP/1.1" 200 65
DEBUG 2015-12-10 08:37:34,260 [30759:PandoraBackend-14] pykka
Exception returned from PandoraBackend (urn:uuid:3c22bf76-4511-4004-ade2-9614a100a033) to caller:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pykka/actor.py", line 201, in _actor_loop
response = self._handle_receive(message)
File "/usr/local/lib/python2.7/site-packages/pykka/actor.py", line 295, in _handle_receive
return callee(_message['args'], *_message['kwargs'])
File "/Users/jcass/PycharmProjects/Mopidy/mopidy-pandora/mopidy_pandora/playback.py", line 39, in prepare_change
self.backend.prepare_next_track(False)
File "/Users/jcass/PycharmProjects/Mopidy/mopidy-pandora/mopidy_pandora/backend.py", line 60, in prepare_next_track
next_track = self.library.get_next_pandora_track()
File "/Users/jcass/PycharmProjects/Mopidy/mopidy-pandora/mopidy_pandora/library.py", line 138, in get_next_pandora_track
pandora_track = self._station_iter.next()
File "/usr/local/lib/python2.7/site-packages/pydora/utils.py", line 121, in iterate_forever
yield next(output).prepare_playback()
File "/usr/local/lib/python2.7/site-packages/pandora/models/pandora.py", line 227, in prepare_playback
self.register_ad(self.station_id)
File "/usr/local/lib/python2.7/site-packages/pandora/models/pandora.py", line 224, in register_ad
self._api_client.register_ad(station_id, self.tracking_tokens)
File "/usr/local/lib/python2.7/site-packages/pandora/client.py", line 280, in register_ad
adTrackingTokens=tokens)
File "/usr/local/lib/python2.7/site-packages/pandora/client.py", line 104, in call
return self.transport(method, *_kwargs)
File "/usr/local/lib/python2.7/site-packages/pandora/transport.py", line 47, in function
return func(_args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pandora/transport.py", line 234, in call
return self._parse_response(result)
File "/usr/local/lib/python2.7/site-packages/pandora/transport.py", line 220, in _parse_response
raise PandoraException.from_code(result["code"], result["message"])
ParameterMissing: Parameter Missing
INFO 2015-12-10 08:37:34,270 [30759:PandoraBackend-14] requests.packages.urllib3.connectionpool
Resetting dropped connection: audio-sv3-t1-2-v4v6.pandora.com

This should have been fixed by mcrute/pydora#34.

This error occurred while playing a station that was recently added from the Genres list, so it is possible that Mopidy-Pandora is not supplying the correct station_id.

@jcass77
Copy link
Member Author

jcass77 commented Dec 26, 2015

A fix for this has been proposed to the pydora project. It basically comes down to handling the ParameterMissing exception when ads are attempted to be registered without the adTrackingTokens being available (see: APIClient.register_ad(station_id, tokens)).

We should be able to close this when the next release of pydora is available.

@jcass77
Copy link
Member Author

jcass77 commented Jan 2, 2016

This has been fixed in pydora 1.6.4 - closing.

@jcass77 jcass77 closed this as completed Jan 2, 2016
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

No branches or pull requests

1 participant