Closed orontee closed 3 years ago
Since this is similar to https://github.com/tkem/mopidy-podcast/issues/59, may I elaborate:
Mopidy-Podcast "track" URIs look like podcast+{podcast-uri}#{episode-guid}
, i.e. it expects the URI fragment to contain the episode GUID (which may be a URI by itself), for example
podcast+https://metinalista.si/category/ldgd/feed/#https://metinalista.si/?p=34343
where https://metinalista.si/?p=34343
is the fragment. AFAICS, Iris somewhere encodes the #
sign separating the fragment, so this becomes
podcast+https://metinalista.si/category/ldgd/feed/%23https://metinalista.si/?p=34343
Since this URI no longer contains a fragment, mopidy-podcast is not able to refer to a podcast episode any more.
As @orontee said, this apparently used to work with Iris. I can only confirm this works with current versions of Musicbox Webclient, Mopidy Mobile, and mpc
.
To elaborate some more:
>>> from urllib.parse import urlsplit
>>> urlsplit("podcast+https://metinalista.si/category/ldgd/feed/#https://metinalista.si/?p=34343")
SplitResult(scheme='podcast+https', netloc='metinalista.si', path='/category/ldgd/feed/', query='', fragment='https://metinalista.si/?p=34343')
>>> urlsplit("podcast+https://metinalista.si/category/ldgd/feed/%23https://metinalista.si/?p=34343")
SplitResult(scheme='podcast+https', netloc='metinalista.si', path='/category/ldgd/feed/%23https://metinalista.si/', query='p=34343', fragment='')
I do understand, that it's iris that encodes the hash sign to %23. What I don't understand is why that is wrong. Everything after the http(s) should be URL encoded, in my limited understanding, or it should not be used in an URL formatted string.
Either it is a URI, then it needs URI encoding, or it is not, then the query format string should be specified elsewhere.
https://tools.ietf.org/html/rfc3986
As I understand you are argumenting that it is merely an internal link, and therefore the need to url encoding does not apply, right?
I don't think it necessarily means that Iris is wrong, only because it works on other software. Maybe the other softwares is just ignoring the RFC, or they try to "help" the user by fixing an error. Browsers does this, a lot, to allow for a seemless user experience. The minimum they should handle is the the formatting from the RFCs though.
Everything after the http(s) should be URL encoded,
No, it definitley shouldn't be. Especially ?
and #
are used to separate query and fragment parts, and must not be encoded to act as such. RFC 3986 is pretty clear on this, also please have another look at the urlsplit
examples I gave above.
so the difference appears to be the "#" as the delimiter of the "fragment" component of the URL vs the "#" as part of, for example, a request parameter value.
if i want to send a request parameter with key = "hashtag" and value = "#foobar", then i have to escape the "#", precisely because it is a reserved character in RFC3986.
if i want to use the "fragment" as it is intended in the RFC:
The fragment identifier component of a URI allows indirect identification of a secondary resource by reference to a primary resource and additional identifying information.
then i must not escape it. in this case, when we're using the parts left of the fragment delimiter to identify a series of podcasts, and then use the fragment to identify an episode, i think it is save to assume that this is exactly the "identify a secondary resource" use case from the RFC. thus escaping the "#" is actually incorrect.
@rmalchow: Exactly. Just look at
>>> from urllib.parse import urldefrag
>>> urldefrag("podcast+https://metinalista.si/category/ldgd/feed/#https://metinalista.si/?p=34343").url
'podcast+https://metinalista.si/category/ldgd/feed/'
>>> urldefrag("podcast+https://metinalista.si/category/ldgd/feed/#https://metinalista.si/?p=34343").fragment
'https://metinalista.si/?p=34343'
>>> urldefrag("podcast+https://metinalista.si/category/ldgd/feed/%23https://metinalista.si/?p=34343").url
'podcast+https://metinalista.si/category/ldgd/feed/%23https://metinalista.si/?p=34343'
>>> urldefrag("podcast+https://metinalista.si/category/ldgd/feed/%23https://metinalista.si/?p=34343").fragment
''
hi i'm kind of a newbie here regarding parsing and rss feed/url, but having the same problem with Iris
My podcast seems to be working, i can play them through any other frontend client (mowecl and musicbox_webclient for example) or even mpd player (like cantata or malp on android). I would like to use Iris because of its UI and spotify nice integration compared to the other ones i just mentioned, but podcast is a big part of my use here
When starting a podcast and looking at sudo systemctl status mopidy.server
, i got a [PodcastBackend-9] error HTTP ERROR 404
with the podcast URL (for example http://radiofrance-podcast.net/podcast09/rss_14523.xml%239a0e8ae7-d986-40b3-84cd-bcadd939d9d8). From what i gather so far, these errors are some "known issue" aren't they ?
I also get these same errors when playing from music box webclient, but somehow, the podcast is able to start and play correctly.
Any clue about this ?
Thanks for the hard work in mopidy/iris, great piece of software !
Cheers !
[edit] iris show correct playing podcast if launched from other frontend, if queued, it also allows to launch the play from "now playing" panel
This is yet another issue due to using URIs in the browser URL (browsers do their own manipulation, creating inconsistencies). I have now enlisted encoding to base64
and preserving whatever encoding was provided by Mopidy itself. So, in theory, the issues described above should now be resolved.
@orontee and @samytichadou can you confirm whether the issue is solved by upgrading Iris to at least 3.57.3? You will need to restart Mopidy and clear your browser cache after upgrading.
Thanks a lot for the quick answer and fix, podcast are playing when launching them from browse in 3.57.3 ! Cheers !
That's awesome to hear, glad it's working now :-) thanks for your help
i am having real problems getting podcasts to work…. I have this URI: “podcast+http://rabbisilber.com/classes/feed/recent” to get the latest podcast episodes, but i cannot figure out where to put it, how to have the pi zero W with pimoroni pirate audio HAT working to just play content from that source. What am I doing wrong?
I cannot find the config files to edit to add this as a source, nor can I find in IRIS where/how to listen to latest episodes from this source.
Describe the bug
My mopidy server has the Mopidy-Podcast extension installed and configured. It used to work with Iris and musicbox webclient. It still works with musicbox webclient but not with Iris.
To Reproduce
sudo mopidyctl config
:/etc/mopidy/podcast/Podcast.opml
:Expected behavior
The choosen track is played.
Console log
Environment details: