mopidy-tunein
mopidy-tunein copied to clipboard
Retry on aborted connections
The radio stream stops playing when the connection is reset, and the log contains:
2015-12-08 05:29:42,998 - INFO 304 GET /musicbox_webclient/index.html (192.168.0.213) 13.42ms 2015-12-08 05:29:43,164 - INFO 304 GET /mopidy/mopidy.min.js (192.168.0.213) 11.70ms 2015-12-08 05:29:53,476 - INFO Starting new HTTP connection (1): opml.radiotime.com 2015-12-08 05:30:29,771 - INFO TuneIn API request for Tune.ashx failed: ('Connection aborted.', error(104, 'Connection reset by peer')) 2015-12-08 05:30:29,775 - ERROR Failed to tune station id s225233 2015-12-08 05:30:29,779 - WARNING Track is not playable: tunein:station:s225233 2015-12-08 05:30:39,838 - INFO Starting new HTTP connection (2): opml.radiotime.com 2015-12-08 05:30:42,126 - INFO 200 GET / (127.0.0.1) 42.55ms 2015-12-08 05:30:43,962 - WARNING Element doesn't implement handling of this stream. Please file a bug.
It might be possible to have Mopidy-TuneIn retry a couple of times before giving up, which should make it much more robust.
pydora follows a two-pronged strategy of retrying connections at least once, and also handling specific HTTP-related exceptions with the time between retries increasing exponentially.
It seems to be working well for the Mopidy-Pandora backend and I haven't had any connection issues since - not sure if it can be ported.
Would like to see this. I get disconnected after a while but I can play again manually. Retry will be good option.
Any chance this gets fixed? I basically have the similar problem that the plug-in collapses if the opposing streaming server doesn't reply in time:
Mai 26 00:29:38 mopidy[1601]: ERROR [MainThread] mopidy.audio.gst GStreamer error: Could not resolve server name.
Mai 26 00:29:48 mopidy[1601]: INFO [TuneInBackend-3] mopidy_tunein.tunein TuneIn API request for Tune.ashx failed: HTTPSConnectionPool(host='opml.radiotime.com', port=443): Max retries exceeded with url: /Tune.ashx?render=json&id=s57109 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xffffa1758358>: Failed to establish a new connection: [Errno -2] Name or service not known'))
Mai 26 00:29:48 mopidy[1601]: ERROR [TuneInBackend-3] mopidy_tunein.tunein Failed to tune station id s57109
Mai 26 00:29:48 mopidy[1601]: WARNING [Core-6] mopidy.core.tracklist Track is not playable: tunein:station:s57109
Mai 26 00:29:58 mopidy[1601]: INFO [TuneInBackend-3] mopidy_tunein.tunein TuneIn API request for Tune.ashx failed: HTTPSConnectionPool(host='opml.radiotime.com', port=443): Max retries exceeded with url: /Tune.ashx?render=json&id=s7866 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xffff5e4ffe48>: Failed to establish a new connection: [Errno -2] Name or service not known'))
Mai 26 00:29:58 mopidy[1601]: ERROR [TuneInBackend-3] mopidy_tunein.tunein Failed to tune station id s7866
Mai 26 00:29:58 mopidy[1601]: WARNING [Core-6] mopidy.core.tracklist Track is not playable: tunein:station:s7866
Playback stops and can not be turned back on. One is forced to restart the mopidy (systemctl restart mopidy
).
Isn't that an actual connection error? What is this extension supposed to do here? I'm not interesting in supporting this but will merge a decent PR