ap4y/OrigamiEngine

Can't play 'URLs' that redirect to a simple mp3 file

diogobalseiro opened this issue · 5 comments

Hi

I have several mp3 files that are behind a single temporary redirect, so they can't be accessed directly. Can Origami access them still, or it's limited to the direct url of the file?

Thanks

ap4y commented

I'm not sure what problem you have but most common issue maybe this: there is a limitation in the plugin system design - it uses file extension for plugin selection. Thus if your urls don't have extension, plugin manager won't be able to derive the plugin. For this reason I added custom resolvers (see #36), so you could override default behavior of the plugin manager.

Imagine this scenario.

To stream the song 'Some song' I access the audio file with this: my-service/my-api/audio_id_some_song?user_token=blabla

This will validate the user and, depending on his subscription status for example, redirect to the appropriate mp3 file such as: my-service/my-api/streaming/some-song-id?Expires=1434490702&Signature=more-bla-bla

This is done this way because the redirect is only temporary (60 secs) to prevent some abusive usage.

(This is a very basic and somewhat inaccurate example of the api, but it gets to the point)

I tried to stream some songs in the example app and it failed. Is it supposed to fail? If so, is there a way to support it?

ap4y commented

As I mentioned it's an expected behavior and yes you can support it by using custom resolver, check linked issue and this as an example.

Thanks for the quick response, will try it later. ;)

Hi, the link is no longer alive for the custom resolver. Wondering if there's another URL where I could find one? I have this same issue and having trouble grabbing an MP3 file that's at the end of a Podtrac podpress redirect process.