VLC Lua Plugin for Digital Imported Radio Stations

Due to several reasons I currently need to play music using my client instead of mpd on my server. While I often listen to Digital Imported, I do not own an account there (and don't want one, escpecially not for each site), so I am stuck with their flashplayer, which let my old notebook make some noise by the fan.
First I created a parser in python, which sucks the needed information from their site(s), but then I stumbled across a(n) (old and partially broken) json-interface to their services. Since I already had VLC installed and was curious about doing something with Lua, I created a simple script for my purpose.
Disclaimer (mainly for the mods)
This is completly legal. All the script does is to grab the stream from the streamurl, using their on api/interface, which leads to bypass some dumb javascript checks, which try to force you to create an account for using an external player. You will also get their advertisements - same as using the flashplayer, so no illegal stuff in here.
Sites included
dI.fm
jazzradio.com
rockradio.com
sky.fm
Issues
Due to multihtreading in VLC, the lists must be sorted manually by clicking on the appropriate columnheader
Since the URLs point to .pls files, selecting an entry will open a new node instead to play the stream, so one needs to select twice
Because their interface is partially broken, some stations will only be reachable in .mp3 instead of .aac
The VLC service used to fetch json data (vlc.stream) will not follow HTTP headers, so the lists will be sometimes empty (sites return 206 instead of 200).
Installation
Create ~/.local/share/vlc/lua/sd and ~/.local/share/vlc/lua/sd/modules directories
Put the code below into the file ~/.local/share/vlc/lua/sd/di_vlc.lua
Link /usr/lib/vlc/lua/intf/modules/common.luac to ~/.local/share/vlc/lua/sd/modules/common.luac
Code
-- di_vlc.lua - VLC Service Discovery Plugin
-- Adds Digital Imported based Radiostations to the VLC Playlist Window
-- App (*nix): /usr/lib/vlc/
-- (win): C:\Program Files\VideoLAN\VLC\
-- Base (*nix): ~/.local/share/vlc/
-- (win): %appdata%\vlc\
-- Folder Structure:
-- $base/lua/sd/di_vlc.lua # This Script
-- $base/lua/sd/modules/common.luac # Found in $app/lua/intf/modules
lazy_loaded = false
json = nil
function lazy_load()
if lazy_loaded then return nil end
json = require "dkjson"
json["parse_url"] = function(url)
local string = ""
local line = ""
local stream = vlc.stream(url)
repeat
line = stream:readline()
string = string..line
until line ~= nil
return json.decode(string)
end
lazy_loaded = true
end
function descriptor()
return {title = "DI Radio Stations"}
end
function main()
lazy_load()
local stations = {["DI.FM"] = {"di.fm", "2"}, -- 2 = aac
["JazzRadio"] = {"jazzradio.com", "3"}, -- 3 = mp3 (aac pls = 404)
["RockRadio"] = {"rockradio.com", "2"}, -- 2 = aac
["Sky.FM"] = {"sky.fm", "3"}} -- 3 = mp3 (aac pls = 404)
for key, data in pairs(stations) do
local site = "http://www."..data[1]
local url = "http://listen."..data[1].."/public"..data[2]
local result = json.parse_url(url)
local node = vlc.sd.add_node({title = key})
if result then
for index, item in ipairs(result) do
node:add_subitem({title = item["name"],
path = item["playlist"],
description = item["description"],
genre = item["name"],
url = site,
publisher = "Digital Imported"})
end
end
end
end
Usage
Restart VLC and open the playlist. On the left side, below Internet, you should find a new entry called DI Radio Stations. Click it and have fun.
Comments are welcome.
Edit 07/28/14: Added failure condition
Edit 07/31/14: Added HTTP header issue info
Last edited by Tarqi (2014-07-31 18:29:20)

mrbeard wrote:archassault-keyring 20140202-3
archassault-mirrorlist 20140527-1
Closing: https://wiki.archlinux.org/index.php/Fo … pport_ONLY

Similar Messages

  • Import radio stations from iTunes Radio to Music app.

    Hi.
    You have the Music app and can listen to radios on iphone5s.
    While I have some favorite radio stations in the "radio" of itunes on Mac PC, those are not listed on Music app on iphone5s.
    How do you import radio stations from iTunes Radio to Music app.
    I tried searching genre after tapping on + button in My Stations, but there is no genre I want to add, which is "ambient: a-a lounge".
    I also know the way to listen to the radio station on Safari, but what I want to do is listen them on the Music app.
    Any addvice?
    Thank you.

    I found a cool radio station on itunes, can I record
    some music, save and put on my ipod? Thanks! Denise
    I should clarify that. I guess I could record the radio to a CD, put that on itunes, then ipod. But can I leave out the step of the CD? In other words, will itunes record from itself?

  • App for recording internet radio stations?

    Hi, have looked in the app store for an app that will enable me to record internet radio stations that I am listening to.
    I have seen there are plenty of recorders that will record voice etc through the iphone mic but I really want to record what I am hearing such as internet radio.
    Will any of the current apps do this? If so which ones & which are stable etc?
    Many Thanks!

    there is no way you could have an app that plays internet radio and have an app that records the internet radio...i dont know if an app exists but even if it did, you couldnt run 2 apps at the same time, so obviously you cant record

  • Suggestion: "recommended for you" itunes radio station

    It would be great to have an itunes radio station that would play music from the "recommended for you" list in the itunes store for music discovery that did not include things already in my collection. I would definitely buy more music if I had this service.

    You can use this Link to send your Feedback to Apple
    http://www.apple.com/feedback/

  • Contact for relisting web radio stations

    Greetings.
    I have been patiently awaiting some response, or action, for a few months now. I emailed my former contact within iTunes (I believe she has moved on now) to have my two web radio stations relisted, after a technical issue forced us offline for a while.
    Oddly enough two stations I no longer operate are still listed, and these stations have not operated for more than a year. I thought of simply emailing to request an update to station details, and stream URL, but same problem.
    I am unable to find the contact to get this situation rectified, please help.
    Regards

    Hello AWR,
    Did you try [email protected]? And/or have you seen http://forums.streamsolutions.co.uk/showthread.php?t=4159&highlight=Itunes ?
    All the best,
    Hilltops
    PS: I'm a Londoner, my wife a Sydney-sider.
    Message was edited by: Hilltops
    Message was edited by: Hilltops

  • Where can I download the latest VLC web plugin for Nightly?

    No further details

    ^: that is a link to the Nightly version of the VideoLAN software and that has nothing to do with the Firefox Nightly builds.
    The regular VideoLAN plugin should work without problems with the current Firefox Nightly build.
    Are there any error messages on the about:plugins page or in about:addons?
    *http://kb.mozillazine.org/Issues_related_to_plugins#Identifying_installed_plugins

  • How do I find actual radio stations on my iMac?

    I used to be able to listen to NPR shows on my iMac, but the IOS 7 took it away. How can I do it?  Now you only have the Pandora style radio, with all music.  I want my Car Talk and What Do You Know back!!

    Travis\'s Mom wrote:
    I used to be able to listen to NPR shows on my iMac, but the IOS 7 took it away.
    iOS 7 doesn't run on a Mac.
    If you're looking for the streaming radio stations that appeared in every iTunes version for about the last decade, it has been renamed "Internet" in the latest iTunes release to avoid confusion with the new Pandora-themed "iTunes Radio".
    Internet Radio is hidden by default until you enable it by opening iTunes Preferences and selecting "Internet Radio" from the General pane. Do that, select Music from the Sidebar on the left, and you will see Internet appear on the top row. Your familiar radio stream presentation will appear.

  • All my radio stations are working but one any suggestions??

    Everything about Itunes is working fine except for a single radio station called Midnight Blues which is active. Anyone know why??

    Try going to their website and getting the RSS feed directly from their website. NOT the iTunes link, but the RSS link.
    Then go to Advanced - Subscribe to Podcast, and paste the RSS link in there.
    Sometimes the iTunes links are quirky, but the normal RSS link will work.

  • Some internet radio stations with http protocol and mp3 format not working in AIR 2.0

    First, i am sorry for my bad english. When I publish swf for Flash 10 player all stations in my list works. If I publish them for AIR 2.0 stations with adress end ":XXXX", where XXXX is port number, they cannot work. What is problem? Thanks in advance.

    Perhaps,  in the previous post I wasn't clear enough, so I'll try to make it better: I am using the Adobe Flash CS5 and AS3. I wrote the script for listening internet radio stations. In the station list I named only those that use HTTP protocol and mp3 format, cause I know the limits of Flash in audio streamings. If I publish FLA file in SWF for Flash 10 player all the stations can be listened.. If swf file is made for AIR 2.0 there's a problem: the stations with adress  http://xxx.xxx:xxx/<something> can be listened, and those without extension behind the port number (:xxx) can not. Main parts of the script are:
    startButton.addEventListener(MouseEvent.CLICK, listen);
    req.url= "<adress>";
    snd = new Sound();
    snd.load(req);
    private function listen(event:MouseEvent):void {
    req = snd.play();
    Example:
    adress=http://scfire-ntc-aa08.stream.aol.com:80/stream/1010 - working
    adress=http://www.radionovosti.rs:443/radionovosti56s.mp3 - working
    adress=http://sh1.beotel.net:8002 - not working
    adress=http://77.105.36.58:8881 - not working
    It would be great if someone of Adobe employers explain to me what is the problem. Thanks.

  • How to become an iTunes Radio Station

    iTunes has a default list of radio stations. Does anyone know how you would go about getting added to that list? I work for a college radio station and we're looking to expand our streaming options.
    Thanks!

    What is the site/radio station? There are many internet radio stations iTunes cannot play because they use a stream format that is not compatible.

  • ITunes radio; station contact?

    Is there an easy way to contact a radio station listed in iTunes?
    I really like Lolliradio Happy Station; Italy.
    Would like to compliment them - can't find contact address.
    Same goes for other stations - I'd like to give them my support.

    A quick google search brought this up:
    http://www.lolliradio.net/
    I recommend doing a google search for any other radio station that interests you.

  • Adding college radio stations to iTunes radio roster

    KSPC 88.7FM - Claremont, CA would like to be added to the iTunes radio roster. KSPC is operated by the students of the Pomona Colleges. The web address is http://www.kspc.org/ How do we go about adding our radio station to iTunes radio roster?

    Greeetings I am wondering what your comment meant in regards to waiting
    What has been the process thus far?
    I am a faculty advisor for our college radio station
    http://ricradio.org/ and interested
    in knowing what other institutions are doing with radio.
    best and Peace
    philip palombo
    Assoc Professor/ RI College
    http://palombo.tv

  • On one of my computers, the tool bar includes an icon for radio stations and a calculator, but those do not appear on my other computer. Are these add-ons? How do I add them to my other computer?

    When I downloaded Firefox 4 on my desktop, it included an icon for radio stations, for the weather and a calculator. I don't remember choosing them. I also downloaded Firefox 4 on my netbook, but these same icons are visible. Can I add them?

    These may well be add-ons, look at what you have installed
    * use '''Firefox button'''(orange tab top left) ''' -> Add-ons | Plugins/Extensions''' <br /> that is the add-ons manager, and also allows you to search for other addons
    * see also [[customizing firefox with add-ons]]
    Some of the icons could also be bookmarks, note the bookmark toolbar does not display in Firefox 4 by default to get it back
    * use '''Firefox Button -> Options -> [x] Bookmarks Toolbar''' <br /> that is assuming you have bookmarks in the bookmarks toolbar folder (should have some defaults like 'most visited')
    Some add-ons may not be compatible with Firefox 4, but revisions may be issued that work, or alternatives with similar functions may be available.

  • Did recent firefox updates. Now adobe flash plugin has crased when trying to listen to radio station. pls help

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [/questions/761043]</blockquote><br>
    I always listen to radio station 105.7 fm in Balto, MD. A couple of days ago installed Firefox updates. "Help" shows no updates available at this time. I can message "adobe flash plugin has crashed". Unable to correct with info online. Not sure what to do at this point. Pls help.

    Your above posted system details show outdated plugin(s) with known security and stability risks that you should update.
    # Shockwave Flash 10.0 r42
    # Next Generation Java Plug-in 1.6.0_21 for Mozilla browsers
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/
    Update the [[Java]] plugin to the latest version.
    *http://java.sun.com/javase/downloads/index.jsp (Java Platform: Download JRE)
    See also http://kb.mozillazine.org/Plugin-container_and_out-of-process_plugins

  • Plugin error when trying to stream a radio station

    Hi!
    I get the message unknown plugin (video/x-ms-asf) in firefox when i try to listen to a radio station .
    I know this propably has to do with mplayer-plugin which isn't in rep . I was thinking of installing gecko-mediaplayer but it installs
    and some other packages which i don't need , for example gnome-mplayer when in fact i have mplayer installed.
    Is there an alternative way ?

    Either the client was using a beta of CS6 or the file was corrupt.
    BTW, did you actually try to open it from the USB stick? Not a good idea and that could have caused a problem all by itself.
    Bob

Maybe you are looking for