SoCo: The readme example is not working for me
I’m following the example but after I follow the steps, my speaker doesn’t play anything
Python 3.5.2+ (default, Sep 22 2016, 12:18:14)
[GCC 6.2.0 20160927] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import soco
>>> speakers = soco.discover()
>>> speaker = speakers.pop()
>>> speaker
SoCo("10.10.11.104")
>>> speaker.play_uri('http://archive.org/download/TenD2005-07-16.flac16/TenD2005-07-16t10Wonderboy_64kb.mp3')
>>> track = speaker.get_current_track_info()
>>> track['duration']
'0:00:00'
>>> track
{'duration': '0:00:00', 'uri': 'http://archive.org/download/TenD2005-07-16.flac16/TenD2005-07-16t10Wonderboy_64kb.mp3', 'album': '', 'artist': '', 'position': '0:00:00', 'metadata': '<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="-1" parentID="-1" restricted="true"><res protocolInfo="http-get:*:application/octet-stream:*">http://archive.org/download/TenD2005-07-16.flac16/TenD2005-07-16t10Wonderboy_64kb.mp3</res><r:streamContent></r:streamContent><dc:title>TenD2005-07-16t10Wonderboy_64kb.mp3</dc:title><upnp:class>object.item</upnp:class></item></DIDL-Lite>', 'title': 'TenD2005-07-16t10Wonderboy_64kb.mp3', 'album_art': '', 'playlist_position': '1'}
>>>
It says “duration: 0”. And when I try to play on the mobile app it says “Unable to play ‘TenD2005-07-16.flac16/TenD2005-07-16t10Wonderboy_64kb.mp3’, the file can not be found”.
The file is available, I can play it on my browser… Am I doing something wrong?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 26 (22 by maintainers)
The problem seems to be that
http://archive.org/download/TenD2005-07-16.flac16/TenD2005-07-16t10Wonderboy_64kb.mp3
redirects tohttp://ia801402.us.archive.org/20/items/TenD2005-07-16.flac16/TenD2005-07-16t10Wonderboy.mp3
. If you do it with this URL, playing the mp3 works as it should. The readme example might have to be updated.