liquidsoap tunein.com now playing implementation
  • Hello,

    I've implemented tunein.com now playing integration in liquidsoap that's been running successfully under Airtime 2.3.1 and now 2.4.  This enhancement supports sending track title, artist and album metadata to tunein.com which will show up on a station's player.  To use:
    • Apply for a tunein.com broadcaster API access.  See http://tunein.com/broadcasters/.
    • Copy the attached tunein.liq.txt script to /usr/lib/airtime/pypo/bin/liquidsoap_scripts as tunein.liq.
    • Make a backup copy of ls_script.liq and add the following lines to ls_script.liq (assumes Airtime 2.4):
    • After line 37, %include "ls_lib.liq", add:
      ##### Custom tunein
      %include "tunein.liq"
    • After line 53, l = crossfade_airtime(l), add:
      ##### Custom tunein start
      l = on_track(tunein.submit(partnerid="YourPartnerId",partnerkey="YourPartnerKey",stationid="YourStationId"), l)
      ##### Custom tunein end
    • Update the tunein.submit() call with your broadcaster credentials.
    • Customize the on_track() handler above to pass the optional parameter, commercial="true" or "false" depending on the track type.  This is different for every broadcaster.  See http://tunein.com/broadcasters/api/ for more information on what constitutes a "commercial."
    • Restart the airtime-liquidsoap service to load these changes, on Ubuntu: 
      service airtime-liquidsoap restart
      Note that this causes broadcasting to stop for a few seconds.  Also, if there are any syntax errors caused by improperly making changes to ls_script.liq, the airtime-liquidsoap service will not start and your station will be down.
    • Make backup copies of ls_script.liq and tunein.liq outside of the Airtime folders as updating Airtime with apt-get will wipe out these changes.
    Some notes on the implementation:
    • Logging is output to the liquidsoap.log (airtime-log -v liquidsoap).  Look for "tunein.submit."  At the default log level=3, no broadcast credentials are output.  At level=4, the entire URL request to tunein.com is output which does include credentials. 
    • The suggested location above to add the on_track() handler was selected so as to obtain the metadata before Airtime updates it based on the SYSTEM, Stream Settings, Stream label option.
    Since I don't really know liquidsoap/Ocaml, would appreciate feedback on any improvements.

    This implementation was done for a small not-for-profit internet broadcaster.

    -Bill
  • 106 Comments sorted by
  • Good work Bill!
    Is there anyway to send metadata of the actual Airtime show name? 
    For example, rather than sending the name and artist of the song being played, can I send the Name of the Airtime scheduled show, the Genre and the URL? The stuff that is set in the Calendar menu when creating a show.

    Thanks!

  • From Albert Santoni in another thread

    -----

    Hi guys,

    When Liquidsoap starts playing something, we
    actually fire off an HTTP request back to Airtime (in a convoluted
    way), which then lets us log the media item in our playout history.

    The function that gets called is notifyMediaItemStartPlaying() in ApiController.php.

    If you want to hack realtime TuneIn API updates into Airtime, looking at
    that function would be a good place to start. You could try to modify it
    to make a request to the TuneIn API every time it gets called...

    Thanks,
    Albert
    Post edited by Roger Wilco at 2014-12-18 16:08:58
  • There's a notifyMediaItemStartPlayAction() in ApiController.php
  • TuneIn API


    BASICS

    Requests to the Air API are very simple:


    # Update the song now playing on a station

    GET http://air.radiotime.com/Playing.ashx?partnerId=<id>&partnerKey=<key>&id=<stationid>&title=Bad+Romance&artist=Lady+Gaga


    Your partnerId replaces <id>, partnerKey replaces <key>, and stationId, including the preliminary 's' replaces <stationid>. Your title and artist information should be set to be updated by your broadcast software in correspondence with the currently playing song.


    SPECIFICS

    Input

    Parameter / Description


    title / The name of the song

    artist / The artist associated with the song

    album / The name of the associated album

    commercial / Set to true if the now playing broadcast is in commercial rather than a song


    Output

    Check the status code for success or failure result (200 means success)


    NOTES

    For now playing updates, please submit only once at the start of the song. Do not use a timer to submit a song, or submit a song multiple times. You may get blocked if you send in too many requests in a short period. Make sure to include an "s" before your station ID. Information does not update on the TuneIn.com site in realtime. Changes to station information can take up to a day to appear. If the station is going to a commercial or other non-song playing period, send the request with the commercial=true flag.

    
----
    http://tunein.com/broadcasters/api/

    (edit: formatting)
    Post edited by Roger Wilco at 2014-12-21 20:59:27
  • Well that is Great,Use Bill's Script if it works for you.
    Mine works for me.I used it up to earlier today,when I notice the problem you stated in this post.

    So although the core of the modifications  will still use my script proposed,I will  not to make Tunein or any other ApI have direct calls to the liquidsoap because it will pull down your server.

    My script was design
    • to take in consideration that you have modified the ls_script
    • You can use it standalone on any liquidsoap script
    • If any library change be it Airtime or Liquidsoap ,you just need to change the source from "s" to your source

    Always remember in programming "There is no one way to slew a Giant" ,You can write your own and itr might work for you and not others.


    But Your url output you print above carries a number of errors indicating that your script is not encoding properly and is different from my script (I highlight the errors)

    http://air.radiotime.com/Playing.ashx?partnerId=xxxxxxx&amp;partnerKey=xxxxxxxxid=xxxxxxx&amp;artist=&amp;title=Excision+&+Savvy+-+Sleepless+(Xilent+Remix)&amp;album=&amp;com
    merical=


    My script is a suggestion,one of which I have 99.9% confident in

    But if you solely use the calendar or with a mod script ,I outline the Santa Claus fixed above

    There are many ways to do the script

    @John_Chewter way is here https://forum.sourcefabric.org/discussion/16848/tunein-updater-code-for-talk-shows-etc-updates-with-show-info-tested-on-2-5-1

    @Yannick way is here https://forum.sourcefabric.org/discussion/17003/another-approach-to-tunein-icecast-playlist

    And you are Bill's

    Use whichever suits you best.

    My only wish is that the team at Sourcefabric would adopt one of them and bring it to WAF and stability and just  abondon that concept  fixing things which by the next distro will break.

    People are just yearning to have some of there expectations met and if you have even "one half bake cake you can eat."

    Notice I am full of parables and metaphor,Although I might starve,my next job in the other life will be a Guess what "Comedian"


    VOISSES











    Post edited by Voisses Tech at 2015-01-30 10:23:22
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Okay (always copy your info into notepad or gedit before pasting it to the forum to removed the amp)

    just make this correction and it will cure the metadata regardless of whether its url encode properly

    do this
    you can use nano or pico instead of gedit
    gedit will give you the line numbers
    •  use the santa clause  fix  not the old update title (this fix render it redundant)
    • sudo gedit /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_lib.liq
     
    change line 35 to Line 40 to look like this

        if !stream_metadata_type == 1 then
          # [("title", "#{!show_name} - #{m['artist']} - #{m['title']}"), ("mapped", "true")]
            [("title", "#{!show_name} - #{m['title']}"),("artist", "#{m['artist']}"), ("mapped", "true")]


        elsif !stream_metadata_type == 2 then
          #[("title", "#{!station_name} - #{!show_name}"), ("mapped", "true")]
           [("title","#{m['title']}-#{!station_name} - #{!show_name}"),("artist", "#{m['artist']}"), ("mapped", "true")]


        else
       # this is where both title and artist are join as one like icecast metadata called song
           # [("title", "#{m['artist']} - #{m['title']}"), ("mapped", "true")]
             [("title", " #{m['title']}"),("artist", "#{m['artist']}"), ("mapped", "true")]
            
            
     check that there is no error using    
     sudo /usr/lib/airtime/pypo/bin/airtime-liquidsoap --check /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq
     
     you should see something like this
     
     #########################################
    #           *** pypo  ***               #
    #     pypo notification gateway         #
    #########################################

     
     If all is okay stop or restart liquidsoap
     
     sudo service airtime-liquidsoap restart


    to see your logs

     sudo airtime-log -t liquidsoap

    VOISSES
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    excellent update ;-)
  • Thanks for this Bill. I just got listed on Tunein and was wondering how to impliment their API.
  • WOW.

    I tried so much to find a script for my TUNEIN like this 

    WOW -What A Whopper
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Vote Up0Vote Down hoerichhoerich
    Posts: 627Member, Airtime Moderator
    awesome, respect!
    Official Airtime Forum Manager
    --------------------------
    Most of the time an issue is located between keyboard and chair.
  • BIG THANK YOU!

    This works very well. But when a DJ is connected it doesn't work. I think we need to get the metadata from the input stream. Has anyone an idea how to read the meta?
  • Vote Up0Vote Down hoerichhoerich
    Posts: 627Member, Airtime Moderator

    BIG THANK YOU!

    This works very well. But when a DJ is connected it doesn't work. I think we need to get the metadata from the input stream. Has anyone an idea how to read the meta?

    AFAIK Metadata forwarding from input-stream is already ticketed.
    Official Airtime Forum Manager
    --------------------------
    Most of the time an issue is located between keyboard and chair.
  • Thanks, hoerich. Found it in the bug tracker. So we just have to wait a little.
    :D
  • I dont know if it is worth mentioning but I have not completed the steps above but my metadata is being sent to the TuneIn mobile apps but not the site. Looks like I will be trying this out.
    Post edited by Sal Yanez at 2013-08-09 23:33:52
  • Vote Up0Vote Down BartBart
    Posts: 89Member
    to be honest, I prefer to do things like this outside liquidsoap.
    for me liquidsoap is the hart of the system, and I prefer to keep it to the minimum.
    that's why I do that outside liquidsoap/airtime.

    But anyway, great job.
    Schelstraete Bart - http://www.contact-dance.com
    image
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    script, no more functional on 2.4.1

    I'm searching why
  • Figure it out, Albert?
  • I fixed a similar tunein script for centova users... I'll be taking a look at this for ya guys for 2.5
  • I fixed a similar tunein script for centova users... I'll be taking a look at this for ya guys for 2.5


    Let us know your results! :)
  • I have  modified the function of the script,I notice that there were three key things that was suggested by the Air Api that was not include

    • http Get request for the output (to verify the return header)
    • The delay so that multiple songs are not sent (  I adopt the similar policy to Icecast of a 2secs delay for metadata)
    • I used the On_metadata instead of On_track so that tags are not sent unless they change
    I include these in my function.

    When I originally wrote to TuneIn for a partner key and ID and they sent back to me querying to make sure that the script meets the criteria.

    My only guess was that the original script was sending multiple songs too quickly.

    If you think I am incorrect let me know


    I respond to their letter and hope they will reply so I can test my script next week when I am at home.

    V.O.I.S.S.E.S.
    Can You Hear Me Now.


    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Seconded!! :-B



    Let us know your results! :)




  • Either i am being a bit dumb or i am missing something really obvious and could use use some help.

    i have set up the script as per the instructions and everything was working perfect and i was passing the now playing information to tunein radio.

    As per the post of Jan 11 i changed On_track to On_metadata and restarted liquid soap and i received the following error.

    /usr/lib/airtime/pypo/bin/liquidsoap_scripts# sudo service airtime-liquidsoap start-with-monit


    Starting Liquidsoap Playout Engine: At line 56, char 16: the variable On_metadata used here has not been


      previously defined.


    Done.


    Then changed it back to use On_track and received the following error 

    /usr/lib/airtime/pypo/bin/liquidsoap_scripts# service airtime-liquidsoap restart

    Restarting Liquidsoap Playout Engine: ('Error loading config file: %s', error(111, 'Connection refused'))

    ^[[AAt line 56, char 13: the variable On_track used here has not been previously

      defined.

    Done.


    Now the only way i cam get liquidsoap to run is by commenting out line 56 :-(


    Any help would be greatly appreciated.


    Thanks in advance.


    Lee

    Post edited by Hit Mix UK at 2014-03-02 20:18:23
  • I am an idiot i have fixed this now, i really need to slop messing with stuff at 2:15am when i am not thinking straight :-)
  • Ha! So you have a working solution for 2.5? [-O<
  • Yes it looks like we do have this working, i have a live show going out in just over an hour so i will double check that the meta data is being sent to tunein radio correctly and if it is i will let you know.
  • Also Voisses Tech says in his post "I used the On_metadata instead of On_track so that tags are not sent unless they change"

    This should actually be on_metadata and on_track rather than On_metadata and On_track as its case sensitive.
  • I can confirm that its not working correctly in 2.5 when a DJ connects LIVE  :-(
  • So Bill's original script (that broke in 2.4.1?) works in 2.5+ again without modification?

    Voisses, where's a copy of your script modifications? :)
  • In the coming week,I will post .
    I am testing now  for Tunein , RDS ,Apps and Some SetTop boxes so if you look at "VOISSES" or "Caribbean Experience"  in Tunein You will see some of the my test connection including  album Arts etc .

    Right Now I am using annotate with dynamic request,so I need to fine tune this as something is messing my TOH.
    1366 x 768 - 111K
    Post edited by Voisses Tech at 2014-03-09 17:37:08
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Brilliant looking forward to testing it :-)
  • I am not sure if this is something anyone else has noticed.

    We get a lot of our listeners from tune in radio and when we are running automated streams obviously the name of the show, artist name and track name are being sent to tune in radio thanks to Bill Burton's scripts..

    When we stream live this information does not get displayed on tune in radio and we are seeing a considerable drop in listeners as a direct result.

    However if the Tune in radio iPhone & android app, sonos tunein radio app, BMW tune in radio app are used then the metadata is displayed, does any one know why their web site seems to behave differently to the apps.

    Lee
    Post edited by Hit Mix UK at 2014-03-31 11:07:07
  • Vote Up0Vote Down julianjulian
    Posts: 1Member
    so any working script for 2.5.1?
  • Vote Up0Vote Down YannickYannick
    Posts: 101Member
    Do you have news about this script ?

    I use airtime 2.5.1 and search information about it.

    Thanks
  • However if the Tune in radio iPhone & android app, sonos tunein radio app, BMW tune in radio app are used then the metadata is displayed, does any one know why their web site seems to behave differently to the apps.

    Lee


    Their web site uses whatever is sent to them via the AIR API exclusively. The mobile apps can parse the metadata embedded in the stream from the source client -- with or without proper AIR pings. You'll notice however without the AIR updates, the View Playlist function sandwiched between View Schedule and Choose Stream fails to load anything. It'll report "Not Available".

  • Can confirm this is working on 2.5.1 and Tune in. Had to leave out the optional commercial="false" parameter. liquadsoap would not start with that there.  Its defaulted to False anyway so not needed. 
  • Sal -- by "left it out" do you mean commented out?

    Can anyone confirm whether or not this does in fact send album metadata along with track and artist?
  • Also -- does it work with the 2.5.2 builds? Will 2.6 likely break it?
  • Hello everyone,
    Also -- does it work with the 2.5.2 builds? Will 2.6 likely break it?


    The tunein.liq script has no dependencies on Airtime itself and can be called from any liquidsoap script. I've been running this script unchanged on Airtime versions 2.3.1, 2.4, 2.4.1 and 2.5.1. The part that's Airtime specific is how to configure Airtime's ls_script.liq to call the tunein.submit method in the script. Since the ls_script.liq seems to change with most every Airtime release, the code and location that needs to be modified to call tunein.submit can change as well.  I suspect most of the problems people are having is how and where to modify ls_script.liq and not with the tunein.liq script itself.

    Airtime should probably support some kind of callbacks in the ls_script.liq for certain functionality that could exist in a new script like /etc/airtime/ls_callbacks.liq.  This script could be locally customized to call tunein.liq or other functionality and would not be automatically overwritten by apt-get when a new release of Airtime is installed.
    Can anyone confirm whether or not this does in fact send album metadata along with track and artist?
    Artist, Title, and Album are submitted to tunein.com as that's all their API supports.

    Sorry for the late response--I've been buried with unrelated tasks.

    Hope this helps,
    -Bill



  • Bill -- what're the proper ls_script.liq injection spots for 2.5?

    Voisses -- did ya forget to release the source for your time delay and http/get tweaks? ;)

    Can anything else be done to make this script better? Seems as though it's fairly simple and efficient as-is. Thoughts?
  • Daniel -- could we get this code into 2.5.2?
  • Hello,
    Bill -- what're the proper ls_script.liq injection spots for 2.5?


    In my case, I want to send the track title to tunein.com before Airtime overwrites it to something else as defined in Stream Settings, Stream Label. On line 38, I added the lines:

    ##### Custom tunein #####
    %include "tunein.liq"

    Then, a few lines down inside the create_source() method, I added the on_track() call:

    # the crossfade function controls fade in/out
    l = crossfade_airtime(l)
    ##### Custom tunein start
    l = on_track(tunein.submit(partnerid="YourPartnerId",partnerkey="YourParnerKey",stationid="YourStationId"), l)
    ##### Custom tunein end

    The problem with this change is that it only works for pre-recorded content, not live input so further changes need to be made to handle this case. I haven't figured out where or how to modify ls_script.liq appropriately.

    The on_track() method is used to call tunein.submit() so as to only send the metadata once as this is a requirement of the tunein.com API not to repeat sending metadata.  My tracks vary in length from 34 seconds to almost 90 minutes and I've verified by reviewing the log that tunein.submit() is only getting called once per track.

    Voisses -- did ya forget to release the source for your time delay and http/get tweaks? ;)

    I'd be interested in seeing those changes.

    Can anything else be done to make this script better? Seems as though it's fairly simple and efficient as-is. Thoughts?

    The main issue that needs to be addressed is how to modify the ls_script.liq the correct method and location to call the tunein.submit() method. All these scenarios need to be covered:



    • Pre-recorded content.
    • Live using either Show Source or Master Source
    • Airtime offline
    • Custom fallback playlists
    My best guess is to add the on_track() to just before the if output_sound_device then around line 322. This might work but then the track title would have been overwritten by the append_title() method defined in ls_lib.liq which is configured by Stream Settings in the UI.

    Another issue I didn't attempt to address at all is the tunein.com API requirement to set the parameter commercial=true/false depending on whether a track is music or not.  This is something that will be different for every broadcaster and would require customization.  Such customization would be done outside the tunein.liq script.

    Daniel -- could we get this code into 2.5.2?



    I think it's way too premature to consider moving this functionality into core. There are too many unresolved issues getting this functionality to work in all circumstances let alone dealing with configuration and user interface issues. 

     -Bill
  • Can anything else be done to make this script better? Seems as though it's fairly simple and efficient as-is. Thoughts?


    The main issue that needs to be addressed is how to modify the ls_script.liq the correct method and location to call the tunein.submit() method. All these scenarios need to be covered:



    • Pre-recorded content.
    • Live using either Show Source or Master Source
    • Airtime offline
    • Custom fallback playlists
    My best guess is to add the on_track() to just before the if output_sound_device then around line 322. This might work but then the track title would have been overwritten by the append_title() method defined in ls_lib.liq which is configured by Stream Settings in the UI.

    I don't get this part -- why would the Stream Settings in the UI overwrite Title (track) / Creator (artist) or Album metatada? The Stream Settings Name, Description, URL, and Genre should all remain static before, during, and after sending TuneIn an update, right? Is this a bug?

    We're currently running Airtime 2.5.1 + Icecast 2.3.3-kh7 -- going through the Icecast error logs, I can see where Airtime/LS are resending the same Title / Creator fields over and over again about a dozen times after a segue.

    What's really strange is that it's duplicating "Title - Creator" into what Icecast considers "Metadata title" and "Metadata song" BOTH while Album metadata is noticeably absent. That some sort of glitch in the kh builds perhaps?


    Another issue I didn't attempt to address at all is the tunein.com API requirement to set the parameter commercial=true/false depending on whether a track is music or not.  This is something that will be different for every broadcaster and would require customization.  Such customization would be done outside the tunein.liq script.

    No worries! This is something that will hopefully be addressed during the refactoring effort.

    Daniel -- could we get this code into 2.5.2?


    I think it's way too premature to consider moving this functionality into core. There are too many unresolved issues getting this functionality to work in all circumstances let alone dealing with configuration and user interface issues. 

     -Bill
    No need to worry about how it functions with fall-backs and stuff when they're all just hacks at this point anyway and not supported features! ;)
    Post edited by Roger Wilco at 2014-07-20 18:04:02
  • I used my server for testing,then I passes the codes on.

    I use  on metadata. instead.

    The problem I had is that tunein switch to live if the data was unknown,so I implement an if-elsif to take care of that.

    What I did to solve that was to use php-curl to pull the airtime api, in an array and extract it.

    This broke when I install 2.5.1.3 with https.

    I had to reinstall because seem I had a malware on that machine that force port 770 to issue a denial of service attack.

    I had this machine with both the icecast and airtime connect to the web.
    I have since rethink and have used a different approach and when I get back i will scour that drive for what happen.

    but I will definetley post my code this weekend.

    Post edited by Voisses Tech at 2014-07-22 16:59:40
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Ouch,I said that b4,but now that I am outta anger management,it should happen
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • What's the practical difference between pinging tunein via on_metadata versus on_track? Lost on that one...
  • Hello,

    I used my server for testing,then I passes the codes on.

    I use  on metadata. instead.

    The problem I had is that tunein switch to live if the data was unknown,so I implement an if-elsif to take care of that.

    What I did to solve that was to use php-curl to pull the airtime api, in an array and extract it.

    This broke when I install 2.5.1.3 with https.

    I had to reinstall because seem I had a malware on that machine that force port 770 to issue a denial of service attack.

    I had this machine with both the icecast and airtime connect to the web.
    I have since rethink and have used a different approach and when I get back i will scour that drive for what happen.

    but I will definetley post my code this weekend.



    Sorry to hear you are having problems with your machine.  Hope you get it sorted out soon.

    What's the practical difference between pinging tunein via on_metadata versus on_track? Lost on that one...


    I was suggesting to use on_track based on my reading of the liquidsoap documentation and concern that the track info must be submitted to tunein.com only once.  

    If you look at the next line after the suggested location to add the tunein.submit() line, you should see the line of code:
    l = on_metadata(notify_queue, l)

    You can see this in the log right after tunein.submit() logs an entry--look for .../notify.sh --media-id=12345. In this particular location of the script, on_metadata and on_track appear to do the same thing sending track info only once.

    I've also added some logging much farther down the script around line 420 just before, "if output_sound_device then" as I'm trying to see if it's possible to capture master and show live input metadata:
    s = on_track(fun (s) -> begin log("on_track(title): #{s['title']}") end, s)
    s = on_metadata(fun (s) -> begin log("on_metadata(title): #{s['title']}") end, s)

    When examining the log (airtime-log -v liquidsoap), I found that in some cases, the on_metadata gets logged three times in one second with the same track title where the on_track logging only happens once. However, when switching to live programming using Master Source and switching back again, the on_metadata event will be triggered in each case but on_track is not triggered at all.

    Hope this helps,
    -Bill
  • Ok  This is simple script with no bang or whistle ,just one line tells you what is sent to tunein

    if you run

    sudo airtime-log -t liquidsoap

    you will see a print exactly as is sent to  like this

    http://air.radiotime.com/Playing.ashx?partnerId=<id>&partnerKey=<key>&id=<stationid>&title=Bad+Romance&artist=Lady+Gaga
    Post edited by Voisses Tech at 2014-07-31 22:12:20
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • With more Comphrensive logs and with response from the Airtime server

    This will give you a  much more logs like if you are not connected and all the error codes

    like if your song artist is missing you will get a 200 ok status but a 400 in the opml stating that either the artist or title is missing
    Post edited by Voisses Tech at 2014-07-31 22:15:37
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Now if  you want some fun ,create your own api server by just  copy the simple script above and change the apiserver to your own  something like this

    api_server = "http://myserver/api/localserver.php?"

    now place the attached filed  on your server

    it will create a lovely history (in a file called metadata.txt) of all  that is  all your files that is played including dj's and stream (everything)

    You can use it for whatever records you want or customised it to output in any format you like xml,opml,json etc..

    remember that i am not a php genius or anything but a simple man and therefore it might  not have anything like security etc. This is just a sample and since it is used locally,I have no worry



    The greatest benefit ,if you modify your ls-script it will be an advance history of what is played not just through airtime.


    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • For some question answered

    why on-metadata?
    Simple for me I am dealing with metadata why should i use on track,but the complex answer is that on track will give data when the track info is unknown,I use on track for things like on start and on stop scenarios,as I said i like the simplest approach first.

    Why not the I use the other script?

    For me its defining a new function,I wanted something as simple as the last fm or flows script .


    Please note that its imperative that you tag you file that taglib can read them

    I  post a simple tag update file called updatetitle.liq that will update the artist data with the station name here http://forum.sourcefabric.org/discussion/16857/unknown
    .i am having problem putting the showname for title, when information is missing
    hope i solve it this weekend.




    Post edited by Voisses Tech at 2014-08-05 06:00:28
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.