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

unable to open playlist containing quoted URIs #1770

Closed
endemics opened this issue Jun 6, 2019 · 1 comment
Closed

unable to open playlist containing quoted URIs #1770

endemics opened this issue Jun 6, 2019 · 1 comment

Comments

@endemics
Copy link
Contributor

@endemics endemics commented Jun 6, 2019

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

@kingosticks
Copy link
Member

@kingosticks kingosticks commented Jun 6, 2019

I think it might be better to make this change in the pls playlist parser. It's a bit odd that RawConfigParser doesn't strip the quotes for us (or provide that option), but there you go.

Loading

endemics added a commit to endemics/mopidy that referenced this issue Jun 7, 2019
since the "standard" is loosely defined. The resulting URI is then
incorrect and makes mopidy fail to load the content, so let's make
sure we strip them.
Fixes mopidy#1770
@jodal jodal added this to the v2.2.3 milestone Jun 9, 2019
@jodal jodal closed this in 5d4e8e4 Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants