Skip to content

unable to open playlist containing quoted URIs #1770

@endemics

Description

@endemics

Hi there,

When trying to open http://bassdrive.com/v2/streams/BassDrive.pls, mopidy fails with:

 GStreamer-CRITICAL **: 05:00:20.205: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
WARNING  Download of '"http://bassdrive.radioca.st:80"' failed due to unsupported schema
INFO     Unwrapping stream from URI (http://bassdrive.com/v2/streams/BassDrive.pls) failed: error downloading URI "http://bassdrive.radioca.st:80"
WARNING  Track is not playable: http://bassdrive.com/v2/streams/BassDrive.pls

Looking at the content of http://bassdrive.com/v2/streams/BassDrive.pls I can see that the FileX entries (the URIs) are quoted:

[playlist]
numberofentries=10
File1="http://bassdrive.radioca.st:80"
Title1="(#1) Bassdrive - Worldwide Drum and Bass Radio"
Length1=-1
...

I have tried the following hack and it seems to work for me, confirming that the issue is in the decoding:

diff --git a/mopidy/stream/actor.py b/mopidy/stream/actor.py
index 1bdd05ca..a4ab36b1 100644
--- a/mopidy/stream/actor.py
+++ b/mopidy/stream/actor.py
@@ -160,4 +160,4 @@ def _unwrap_stream(uri, timeout, scanner, requests_session):
         # TODO Test streams and return first that seems to be playable
         logger.debug(
             'Parsed playlist (%s) and found new URI: %s', uri, uris[0])
-        uri = uris[0]
+        uri = uris[0].strip('\"')

Let me know if you want me to create a PR with this fix if it is deemed appropriate enough, and I'll try to add a test case.

Cheers,
Gildas

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-streamArea: Stream backend

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions