Reviving development of the TuneIn.bundle channel - progress already made

Hi guys,

First off, I’ve forked the official TuneIn.bundle to my GitHub account as below. So far I’ve fixed streaming for some stations as well as the metadata grabbing for station, show title, show hosts and thumbnail URL. These don’t actually show in Plex (probably due to the age of the channel and incompatibilities with the latest versions of Plex server) but they show up correctly in the resulting XML, so it’s certainly a good start. Before they weren’t even making it into the Plex-generated XML (Info > View XML).

As I said earlier, some stations now stream perfectly after the small changes I’ve made. I’ve determined that this success is due to the Tune.aspx URL output by the channel resulting in a URL that refers directly to a stream hosted with the content provider for the station. However, sometimes the Tune.aspx URL refers to a playlist hosted with the content provider. Within these playlists tends to be one or more streams, sometimes differing in bitrate or codec.

In the current HEAD of my forked repository (using Local Radio > Manchester > All Stations > Manchester as an example), you’ll find that the likes of XFM Manchester streams perfectly. However, other stations such as the BBC radio stations, the family of Absolute radio stations etc don’t work. I’ve found that this is due to TuneIn forwarding requests through to a content provider hosted playlist, rather than directly to a stream. The channel will try and play the binary stream of the playlist rather than attempt to further parse it for streams, which is due to a lack of logic within the channel itself. This results in Plex attempting to play the next station alphabetically, continuing until the channel provides it with a binary stream that it can actually play.

My questions are these: How would you guys suggest implementing such logic in a generic, reproducible and compatible way? Realistically there is no telling how many levels of nested playlists one could encounter, though setting a sensible limit of 5-10 levels for example would probably be a good idea to prevent infinite loops, similar to how Apache implements “RewriteOptions MaxRedirects” to avoid redirect loops.

Has anyone here encountered this sort of challenge before when authoring channels, and if so, how did you opt to overcome it? I’d guess the main challenge is determining whether you’ve hit a binary audio stream or ASCII/UTF-8 formatted text file, and playing the stream if the former, or parsing it if the latter and subsequently attempting to perform the same check the result.

One way or another, I fully understand the challenge and believe that there isn’t a whole lot of work to be done in order to get the TuneIn.bundle channel working again (though I’m not entirely sure that it ever did fully work: it was authored before I began using Plex).

Finally, one of the main reasons I understand that development work halted on this plugin was due to API access being required from TuneIn, which apparently they denied/ignored. From what I can gather there will be no need what-so-ever for any TuneIn partner API access in order for this to function. By manually following the XML bread-crumb trail via my browser and playing streams via VLC there hasn’t been a single stream that I’ve tried that has failed, meaning that there’s no reason why this channel can’t be made to work. :slight_smile:

Fixing the issue I’ve focused on in this mail is pretty much the only barrier preventing all stations from working. After this is fixed, a channel logo added (we might need permission for that?) and a bit of tidying/modernisation, it should be ready for prime time.

Thanks for your time, and I hope that I can get some helpful feedback and get the channel back on it’s feet with the communities assistance. :slight_smile:

Cheers,

Chris

I’ve just stumbled across this while browsing for a few things to finalise an ‘all in one place’ solution for the wife to access our media collection and would love to see this working fully… am I really the only one though?

I love to have this functionality too!

I’m looking for radio plugin. I tried yours. In web app plays but no sound, iPhone gives me errors, OpenPHT too. Is this addon still in development?

This was working for me but after the latest plex update it appears to have been broken.

Mar 09, 2016 21:45:38 [0x7f6f04bfe700] DEBUG - MDE: analyzing media item -1
Mar 09, 2016 21:45:38 [0x7f6f04bfe700] DEBUG - MDE: KMGR Weather Summary on 95.9 Classy FM - KMGR (from TuneIn): Direct Play is disabled
Mar 09, 2016 21:45:38 [0x7f6f04bfe700] DEBUG - MDE: KMGR Weather Summary on 95.9 Classy FM - KMGR (from TuneIn): container is unavailable for analysis
Mar 09, 2016 21:45:38 [0x7f6f04bfe700] DEBUG - MDE: KMGR Weather Summary on 95.9 Classy FM - KMGR (from TuneIn): no direct play music profile exists for http//
Mar 09, 2016 21:45:38 [0x7f6f04bfe700] DEBUG - MDE: KMGR Weather Summary on 95.9 Classy FM - KMGR (from TuneIn): codec is unavailable for analysis
Mar 09, 2016 21:45:38 [0x7f6f04bfe700] DEBUG - MDE: audio.channel limitation applies for mp3 codec: 1 > 0
**Mar 09, 2016 21:45:38 [0x7f6f04bfe700] ERROR - MDE: unable to find a working transcode profile for audio stream
**Mar 09, 2016 21:45:38 [0x7f6f1a7fe700] DEBUG - Completed: [192.168.0.25:51018] GET /music/:/transcode/universal/start.mp3?path=http%3A%2F%2F127.0.0.1%3A32400%2Fsystem%2Fservices%2Furl%2Flookup%3Furl%3Dhttp%253A%252F%252Fopml.radiotime.com%252FTune.ashx%253Fid%253Ds34022%2526partnerId%253DRadioTime%2526username%253Dpmove6608&mediaIndex=0&partIndex=0&maxAudioBitrate=320&protocol=http&session=mufft1s08i&offset=0&copyts=1&Accept-Language=en (9 live) TLS GZIP 1050ms 347 bytes 400

everything is now working again after the latest update. Thanks Chris!

Have just tried Tune in radio plugin on Synology DS214Play, on latest Plex build (1.2.6-something).

I can list, select, filter and sort channels, but none that I tried - including Classic FM and several US and Canadian (Camp) Classical music stations - will play anything from Plex client on Android to Chromecast 2 on TV.

Music and video on Plex server play fine this way.

After installing Tunein Radio bundle, I restarted Plex server, and now get as far as seeing the station and track name come up on screen when I press the Play button on Android app. But then there’s an error message that says media won’t play.

What can I do to send better diagnostic information to see what the problem is?