Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

[REL] AudioAddict (RadioTunes.com, DI.fm, etc)

phrawztyphrawzty Members, Plex Pass Posts: 34 Plex Pass
edited July 2016 in Plex Channel Plugins

Hello,

I wrote a basic channel plugin for accessing AudioAddict streaming audio services:

  • RadioTunes.com (formerly Sky.fm)
  • DI.fm (aka Digitally Imported)
  • RockRadio.com
  • JazzRadio.com
  • ClassicalRadio.com

https://github.com/phrawzty/AudioAddict.bundle

The included README.md should explain everything.  If you have specific questions or feature requests, don't hesitate to let me know.

Pull requests gladly considered. :)

AudioAddict.bundle: A Plex plugin for DI.fm, RadioTunes.com, and more!

«13

Comments

  • phrawztyphrawzty Members, Plex Pass Posts: 34 Plex Pass
    edited May 19
    Where is the Plex Forum post for this plugin?
    https://forums.plex.tv/discussion/107801/rel-audioaddict-radiotunes-com-di-fm-etc/p1

    Do I need a Premium account?
    Yes. You need a Premium account in order to get the Listen Key. Without that key, all you get are the free streams, which - while technically functional - no longer have music on them (just a message on loop).

    I can't play the stream and/or I get a codec error - what's the deal?
    As noted above, AAC support is inconsistent across devices, browsers, and clients.The only "safe" option is to use an MP3 stream (though AAC does sometimes work).

    I changed settings such as Preferred Stream in the preferences, but it didn't seem to do anything.
    As noted above, any time you change a setting in preferences, you'll need to Force Refresh the service(s) you're interested in. Don't worry if it seems like it timed out the first time, and don't forget to turn this flag back off when you're done.

    Does this work in Chromecast / iPad / HT / (insert whatever architecture you've got)?
    Probably (see AAC vs. MP3 above, however).

    AudioAddict.bundle: A Plex plugin for DI.fm, RadioTunes.com, and more!

  • tmahertmaher Members, Plex Pass Posts: 2 Plex Pass
    edited May 2014

    https://github.com/tmaher/AudioAddict.bundle/

    Needs a bit more cleanup before it's ready for a PR, but I wanted to touch base before I get distracted later this week.  I've factored out the screen-scraping that was going on to get the thumbnails (/mobile/batch_update FTW), tobiass.eu's site seems to have died so did a half-ass import of the API doc from the wayback machine into API.md, and I've moved from urllib to Plex's plugin-specific caching HTTP client.  The caching client also allows for async "PreCache" requests, so that plus batch_update is a big speed boost for the UI.

    The big TODOs are...

    1) Make AAC work

    2) Use client IP geolocation (instead of random) to pick a stream server.  Avoiding unnecessary transatlantic hops is an absolute must.

    3) Figure out cache eviction strategy

    4) Reign in some of the Dict that I spewed out.  Sorry about that.

  • tmahertmaher Members, Plex Pass Posts: 2 Plex Pass

    AAC is working per https://github.com/tmaher/AudioAddict.bundle/commit/50dfe98a2ab3338a021e64509b8f96540eaaeded

    The google doc linked to from https://forums.plex.tv/topic/87324-missing-from-the-official-plugin-documentation/ had the answer.  The container is (annoyingly) undocumented.  Next stop geolocation.

  • phrawztyphrawzty Members, Plex Pass Posts: 34 Plex Pass
    tmaher wrote on May 20 2014, 7:41 PM: »

    AAC is working per https://github.com/tmaher/AudioAddict.bundle/commit/50dfe98a2ab3338a021e64509b8f96540eaaeded

    The google doc linked to from https://forums.plex.tv/topic/87324-missing-from-the-official-plugin-documentation/ had the answer.  The container is (annoyingly) undocumented.  Next stop geolocation.

    I've not had a chance to review the diffs in detail (yet), but based on diff stats alone it's clear that you've been busy.  As for getting AAC to work, plug-in aside, that's a big win for me personally, so thanks. :)  I'm also glad to see the webpage JSON scraper gone.  It was total jank.

    I went ahead and added you as a collaborator on the original repo.  I'd be glad to reivew any PR once you're happy with it.

    Thanks again!

    AudioAddict.bundle: A Plex plugin for DI.fm, RadioTunes.com, and more!

  • phrawztyphrawzty Members, Plex Pass Posts: 34 Plex Pass

    Hey mate - just curious if there's anything I can do to help out with your (hopefully impending) PR?  Let me know!

    AudioAddict.bundle: A Plex plugin for DI.fm, RadioTunes.com, and more!

  • phrawztyphrawzty Members, Plex Pass Posts: 34 Plex Pass

    Hello,

    I've made some improvements to the plugin which should hopefully make the experience a little more smooth.  In particular, I'm now using the batch API endpoint instead of scraping the home pages of the services for extended channel info - this really improves the user experience, heh.

    https://github.com/phrawzty/AudioAddict.bundle

    @tmaher, I'm still very interested in the work that you've done, notably as regards getting AAC to work.  That said, I'm having a hard time following all the changes in your repo, which is why I didn't merge and work from there.  If there are particular elements you'd like to work on together, let me know !

    AudioAddict.bundle: A Plex plugin for DI.fm, RadioTunes.com, and more!

  • LuckyLukeNLLuckyLukeNL Members Posts: 2
    edited August 2014
    @phrawzty: tested your plugin, works ok but for some strange reason some channels do not play. For instance the di.fm progressive works fine, but the trance channel does nothing, player stays at 0 and then stops.
    Enabled debugging server side but does not show much when I start trance (2 lines only about fetching the png), when I start a channel that does work the log shows about 10 lines (also only about fetching images so far I can see).
    Any clue why this is happening? Or is there anything I can enable/check to debug the problem?

    Edit: after about an hour I tried again and now it works also on the channels that didn't work before. Maybe it was some hammer protection or so, don't know.
    Anyway: GREAT PLUGIN, thanks! :)

    Datapoint: I'm using plex server on a synology nas, and streaming to a chromecast dongle.

    Edit2: tried -aac branch now as well, streampref premium does not seem to work, tested on both chromecast and pc client. Streampref premium_high works fine.
    Can't see current or previous track either, says (null) at both on the plex iOS app.
    HT does not seem to work at all (unable to play media).
  • phrawztyphrawzty Members, Plex Pass Posts: 34 Plex Pass
    LuckyLukeNL wrote on August 9 2014, 5:49 PM: »

    Edit: after about an hour I tried again and now it works also on the channels that didn't work before. Maybe it was some hammer protection or so, don't know.
    Anyway: GREAT PLUGIN, thanks! :)

    Datapoint: I'm using plex server on a synology nas, and streaming to a chromecast dongle.

    Edit2: tried -aac branch now as well, streampref premium does not seem to work, tested on both chromecast and pc client. Streampref premium_high works fine.
    Can't see current or previous track either, says (null) at both on the plex iOS app.
    HT does not seem to work at all (unable to play media).

    Hello,

    Thanks for the feedback.  You're using different platforms than I am, so it's good to have a different perspective on what works and what doesn't, heh.

    • Concerning AAC, yeah, that's a work in progress and I haven't gotten it to work yet either; any MP3-based stream will work perfectly fine.
    • For the current/previous track, I actually have code for that on the back-end, but since Plex for Samsung doesn't support in-line hooks for this functionality, I haven't found a way to use it.  It's good to know that the iOS app has this possibility; however, since I don't own an iPhone, I'm not in a position to develop for it.
    • What do you mean by "HT" ?

    AudioAddict.bundle: A Plex plugin for DI.fm, RadioTunes.com, and more!

  • phrawztyphrawzty Members, Plex Pass Posts: 34 Plex Pass

    Hello

    LuckyLukeNL wrote on August 9 2014, 5:49 PM: »

    Edit2: tried -aac branch now as well, streampref premium does not seem to work, tested on both chromecast and pc client. Streampref premium_high works fine.
     

    I've made an (admitedly minor) change to the aac branch which should allow the AAC streams to play properly (see https://github.com/phrawzty/AudioAddict.bundle/issues/8).  I've tested it on Firefox for OSX and Plex for Samsung, and so far I've been able to play both high and low bitrate AAC streams on DI.fm and Sky.fm (or whatever they're calling it now).

    If you could try with your platform(s) and let me know how it goes, I'd appreciate it.

    AudioAddict.bundle: A Plex plugin for DI.fm, RadioTunes.com, and more!

  • LuckyLukeNLLuckyLukeNL Members Posts: 2

    AAC (streampref premium) now works in Firefox Windows, and on iPad / iOS when playing the music directly on the iPad but sadly not when streaming from iPad to Chromecast, it gives error : "A Chromecast error has occurred" on both the iOS app and the screen display. I have researched a bit and found that Chromecast should support HE-AAC and LC-AAC decoding so I'm not sure why this happens. Any way I can debug this somewhere to find the problem?

    About your previous reply:

    - Can you give some pointers or examples on how the current track could be made visible? So I can test that code here and give you feedback?

    - with HT i meant the standalone Plex version Home Theater.

  • phrawztyphrawzty Members, Plex Pass Posts: 34 Plex Pass
    LuckyLukeNL wrote on September 7 2014, 12:23 PM: »

    AAC (streampref premium) now works in Firefox Windows, and on iPad / iOS when playing the music directly on the iPad but sadly not when streaming from iPad to Chromecast, it gives error : "A Chromecast error has occurred" on both the iOS app and the screen display. I have researched a bit and found that Chromecast should support HE-AAC and LC-AAC decoding so I'm not sure why this happens. Any way I can debug this somewhere to find the problem?

    I'm not sure where to begin debugging that problem, to be honest.  I've recently acquired a Chromecast, though I haven't tried to use it in conjunction with Plex yet - I'll take a look in a couple of weeks when I have some free time to work on this plug-in again.

    LuckyLukeNL wrote on September 7 2014, 12:23 PM: »
    - Can you give some pointers or examples on how the current track could be made visible? So I can test that code here and give you feedback?

    The AudioAddict library has a method named "get_nowplaying" which returns the currently playing track.  Your guess is as good as mine on how to make that call useful in the iOS app. :)

    AudioAddict.bundle: A Plex plugin for DI.fm, RadioTunes.com, and more!

  • intel352intel352 Members, Plex Pass Posts: 153 Plex Pass
    edited September 2014

    Is this working with Chromecast from Android? looks like Chromecast is working to some extent at least?

    Also, when might this be published to the Plex Channels directory?

  • intel352intel352 Members, Plex Pass Posts: 153 Plex Pass

    So, it'd be nice to have dropdowns for the possible values (for preferred stream, preferred source). Or at least default to sensible values.

    Anywho, haven't tested on Chromecast, but this works fine on my FireTV. Only issue for me was that Preferred Stream appears to be required (as I'd only entered my listen key initially, with no results).

    As your readme notes that the preferred stream value may differ by source, it may be good to allow configuring settings per source.

  • phrawztyphrawzty Members, Plex Pass Posts: 34 Plex Pass
    intel352 wrote on September 30 2014, 2:18 AM: »

    Is this working with Chromecast from Android? looks like Chromecast is working to some extent at least?

    Also, when might this be published to the Plex Channels directory?

    As I have not personally tested it, I can neither confirm nor deny Chromecast functionality.

    I don't know how things get published in the channels directory, so as of right now, the timeline would be "never".  When the plugin is production-ready I'll look into that step.

    intel352 wrote on September 30 2014, 2:45 AM: »

    So, it'd be nice to have dropdowns for the possible values (for preferred stream, preferred source). Or at least default to sensible values.

    Anywho, haven't tested on Chromecast, but this works fine on my FireTV. Only issue for me was that Preferred Stream appears to be required (as I'd only entered my listen key initially, with no results).

    As your readme notes that the preferred stream value may differ by source, it may be good to allow configuring settings per source.

    Dropdowns in the options menu, you mean?  That seems reasonable.  I've opened an issue for it.

    AudioAddict.bundle: A Plex plugin for DI.fm, RadioTunes.com, and more!

  • phrawztyphrawzty Members, Plex Pass Posts: 34 Plex Pass
    intel352 wrote on September 30 2014, 2:18 AM: »

    Is this working with Chromecast from Android? looks like Chromecast is working to some extent at least?

    Also, when might this be published to the Plex Channels directory?

    Hello,

    I've just tried streaming both AAC and MP3 channels through Plex on my Android, and both worked without any problems.  I would be interested in hearing feedback from anyone else using this Plugin along with Chromecast on Android (positive or negative).

    My environment, for reference:

    • Plex Server v0.9.11.1.678-c48ffd2 on Ubuntu 14.04 LTS
    • Plex for Android v3.5.5.229-c8d58e9
    • Android 4.2.2 (HTC)
    • Chromecast app v1.8.22 (unsure if it's related, but perhaps worth noting)

    AudioAddict.bundle: A Plex plugin for DI.fm, RadioTunes.com, and more!

  • hyperv2014hyperv2014 Members Posts: 5 ✭✭

    Hey guys,

    Any ideea, can one enter a premium account login info somewhere in the bundle config files ? Because on premium it works only in browser plex player where it asks me in a popup for login, but on android / ios tablet it shows no login popup so the streaming does not work. Thanks a lot in advance!

  • phrawztyphrawzty Members, Plex Pass Posts: 34 Plex Pass
    hyperv2014 wrote on December 15 2014, 4:26 PM: »

    Any ideea, can one enter a premium account login info somewhere in the bundle config files ? Because on premium it works only in browser plex player where it asks me in a popup for login, but on android / ios tablet it shows no login popup so the streaming does not work. Thanks a lot in advance!

    This is another quirk that I don't have a work-around for.  Currently the only way to configure this info is through the web interface, but that's more of a problem with the clients than the plug-in, since they simply don't have this feature.  You could try editing the AudioAddict.bundle/Contents/DefaultPrefs.json and inserting your desired settings as defaults before uploading it to the server.

    AudioAddict.bundle: A Plex plugin for DI.fm, RadioTunes.com, and more!

  • hyperv2014hyperv2014 Members Posts: 5 ✭✭

    Hey,

    Good idea, but sadly I don't know what properties to set and send to the server (like User="user" and Password="pass"). I would have no problem with the notion of hard-coding my premium credential inside the plugin config files since it's a server somewhat safe in my network.

    Also thanks a lot for the answer, this plugin working with premium is the last step in my little project of mounting a tablet in my car dash, and to have all multimedia I use/need inside the plex is awesome because it has such a nice interface. Only thing that would make me exit plex is to open up the navigation software :) So thanks a lot for making this channel. 

    Best regards

  • phrawztyphrawzty Members, Plex Pass Posts: 34 Plex Pass
    edited December 2014
    hyperv2014 wrote on December 16 2014, 4:09 PM: »

    Hey,

    Good idea, but sadly I don't know what properties to set and send to the server (like User="user" and Password="pass"). I would have no problem with the notion of hard-coding my premium credential inside the plugin config files since it's a server somewhat safe in my network.

    Also thanks a lot for the answer, this plugin working with premium is the last step in my little project of mounting a tablet in my car dash, and to have all multimedia I use/need inside the plex is awesome because it has such a nice interface. Only thing that would make me exit plex is to open up the navigation software :) So thanks a lot for making this channel. 

    Best regards

    Thanks for your kind words. :)  As for the settings, the README explains each of the three pertinent options in detail.  In order to hardcode them into the bundle, just edit the DefaultPrefs.json file (noted above) and populate the default key as appropriate.  Let me know if you have any specific questions.

    AudioAddict.bundle: A Plex plugin for DI.fm, RadioTunes.com, and more!

  • phrawztyphrawzty Members, Plex Pass Posts: 34 Plex Pass
    intel352 wrote on September 30 2014, 2:45 AM: »

    So, it'd be nice to have dropdowns for the possible values (for preferred stream, preferred source). Or at least default to sensible values.

    I have added dropdowns for stream and source selections.  The defaults are set to conservative public settings so the plugin will work out of the box.  If you're upgrading your existing plugin, be sure to set "force refresh" in the preferences in order to rebuild the channel cache (and then turn it off again - no sense rebuilding every time).

    AudioAddict.bundle: A Plex plugin for DI.fm, RadioTunes.com, and more!

«13
Sign In or Register to comment.