Author Topic: Automatic adding Internet Radio streams to LinuxMCE  (Read 3413 times)

Dap-P

  • Veteran
  • ***
  • Posts: 85
    • View Profile
Re: Automatic adding Internet Radio streams to LinuxMCE
« Reply #30 on: November 18, 2013, 07:18:05 pm »
Thats great news)

Anton

Alblasco1702

  • Regular Poster
  • **
  • Posts: 16
    • View Profile
Re: Automatic adding Internet Radio streams to LinuxMCE
« Reply #31 on: December 29, 2013, 04:29:48 pm »
Working to get it in webadmin that will make it  easyer to setup. :)

tsoukas

  • Regular Poster
  • **
  • Posts: 18
    • View Profile
Re: Automatic adding Internet Radio streams to LinuxMCE
« Reply #32 on: January 10, 2014, 12:18:07 am »
Excellent job, really needed if you are into internet radio!
Some problems:
URL's register OK, the radio stations appear, but there is an error popping up after each entry that (most likely) prevents station name from being recorded (so all you get are the station URLS on the radio buttons):

Code: [Select]
Adding Radio Station : Styl FM 104.8  To LinuxMCE
./localradio.sh: line 69: /usr/bin/mysql: Argument list too long
Adding Radio Station : Sun Radio 97.1  To LinuxMCE
./localradio.sh: line 69: /usr/bin/mysql: Argument list too long
Adding Radio Station : Top Melody FM Radio 104.9  To LinuxMCE
./localradio.sh: line 69: /usr/bin/mysql: Argument list too long
Adding Radio Station : Village FM 88.3  To LinuxMCE
./localradio.sh: line 69: /usr/bin/mysql: Argument list too long
Adding Radio Station : Vima FM 99.5  To LinuxMCE
./localradio.sh: line 69: /usr/bin/mysql: Argument list too long
Adding Radio Station : Wave Radio 97.4  To LinuxMCE
./localradio.sh: line 69: /usr/bin/mysql: Argument list too long
Adding Radio Station : Yparxw FM 101.4  To LinuxMCE
./localradio.sh: line 69: /usr/bin/mysql: Argument list too long

More errors are displayed when you try to remove everything:

Code: [Select]
Deleting Radio Station : 98 FM 98.0  From LinuxMCE
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '63838
95490' at line 2
Error : URL not in Database
Error : URL not in Database
Deleting Radio Station : Akritikos FM 95.6  From LinuxMCE
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '83427' at line 2
Deleting Radio Station : Alpha 98,9 98.9  From LinuxMCE
Deleting Radio Station : Alpha FM 104.7  From LinuxMCE
Deleting Radio Station : Andromeda FM 87.5  From LinuxMCE
Error : URL not in Database

However, everything is successfully removed without a trace from the database.
Any ideas?

Thanks again for a great script!
ted

Dap-P

  • Veteran
  • ***
  • Posts: 85
    • View Profile
Re: Automatic adding Internet Radio streams to LinuxMCE
« Reply #33 on: January 10, 2014, 01:38:29 pm »
First, Thanks you for testing, and reporting.

I might have an idea why this is happening, but I will dig into this in the weekend.

Anton

huh

  • Guru
  • ****
  • Posts: 235
    • View Profile
Re: Automatic adding Internet Radio streams to LinuxMCE
« Reply #34 on: January 11, 2014, 05:02:50 am »
Lake to the game, but I just tried this and it worked great.  Only tried a couple stations and they work great.

Dap-P

  • Veteran
  • ***
  • Posts: 85
    • View Profile
Re: Automatic adding Internet Radio streams to LinuxMCE
« Reply #35 on: January 12, 2014, 02:55:21 pm »
Here is a new version, that removes the "|" from the station name, if it is there

Anton
« Last Edit: January 12, 2014, 09:00:05 pm by Dap-P »

david_a_dawson

  • Veteran
  • ***
  • Posts: 79
    • View Profile
Re: Automatic adding Internet Radio streams to LinuxMCE
« Reply #36 on: January 12, 2014, 03:25:14 pm »
I've tried running this, but nothing comes through.

I'm in the UK, this might make a difference if the xml returned is a bit different from what is expected.

A sample of the XML returned by calling http://opml.radiotime.com/Browse.ashx?c=local

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1">
<head>
<title>United Kingdom</title>
<status>200</status>

</head>
<body>
<outline type="link" text="National Networks" URL="http://opml.radiotime.com/Browse.ashx?id=c459441" guide_id="c459441"/>
<outline type="link" text="Aberdeen" URL="http://opml.radiotime.com/Browse.ashx?id=r101556" guide_id="r101556"/>
<outline type="link" text="Ashkirk" URL="http://opml.radiotime.com/Browse.ashx?id=r101561" guide_id="r101561"/>
<outline type="link" text="Ayr" URL="http://opml.radiotime.com/Browse.ashx?id=r101563" guide_id="r101563"/>
<outline type="link" text="Belfast" URL="http://opml.radiotime.com/Browse.ashx?id=r101355" guide_id="r101355"/>
<outline type="link" text="Birmingham" URL="http://opml.radiotime.com/Browse.ashx?id=r101353" guide_id="r101353"/>
......

Visiting http://opml.radiotime.com/Browse.ashx?id=c459441 (national radio) gives :

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1">
<head>
<title>UK National</title>
<status>200</status>

</head>
<body>
<outline text="All Stations" key="stations">
<outline type="audio" text="talkSPORT (London)" URL="http://opml.radiotime.com/Tune.ashx?id=s17077" bitrate="32" reliability="98" guide_id="s17077" subtext="Newcastle v Man City" genre_id="g2723" formats="mp3" show_id="p570635" item="station" image="http://d1i6vahw24eb07.cloudfront.net/s17077q.png" current_track="Newcastle v Man City" now_playing_id="s17077" preset_id="s17077"/>
<outline type="audio" text="Classic FM (London)" URL="http://opml.radiotime.com/Tune.ashx?id=s8439" bitrate="128" reliability="98" guide_id="s8439" subtext="Laurence Llewelyn Bowen" genre_id="g5" formats="mp3" show_id="p193011" item="station" image="http://d1i6vahw24eb07.cloudfront.net/s8439q.png" current_track="Laurence Llewelyn Bowen" now_playing_id="s8439" preset_id="s8439"/>
<outline type="audio" text="Gold (London)" URL="http://opml.radiotime.com/Tune.ashx?id=s45622" bitrate="128" reliability="97" guide_id="s45622" subtext="Eamonn Kelly" genre_id="g2755" formats="mp3" show_id="p193421" item="station" image="http://d1i6vahw24eb07.cloudfront.net/s45622q.png" current_track="Eamonn Kelly" now_playing_id="s45622" preset_id="s45622"/>
</outline>
<outline text="Explore UK National" key="related">
<outline type="link" text="Absolute Radio" URL="http://opml.radiotime.com/Browse.ashx?id=a38252" guide_id="a38252"/>
<outline type="link" text="BBC" URL="http://opml.radiotime.com/Browse.ashx?id=c467491" guide_id="c467491"/>
<outline type="link" text="BFBS" URL="http://opml.radiotime.com/Browse.ashx?id=a38328" guide_id="a38328"/>
<outline type="link" text="Capital FM" URL="http://opml.radiotime.com/Browse.ashx?id=a38250" guide_id="a38250"/>
<outline type="link" text="Heart" URL="http://opml.radiotime.com/Browse.ashx?id=a38249" guide_id="a38249"/>
<outline type="link" text="Kiss" URL="http://opml.radiotime.com/Browse.ashx?id=a38357" guide_id="a38357"/>
<outline type="link" text="Magic" URL="http://opml.radiotime.com/Browse.ashx?id=a38356" guide_id="a38356"/>
<outline type="link" text="Real Radio" URL="http://opml.radiotime.com/Browse.ashx?id=a38247" guide_id="a38247"/>
<outline type="link" text="Rock Radio" URL="http://opml.radiotime.com/Browse.ashx?id=a38248" guide_id="a38248"/>
<outline type="link" text="Smooth Radio" URL="http://opml.radiotime.com/Browse.ashx?id=a38246" guide_id="a38246"/>
<outline type="link" text="XFM" URL="http://opml.radiotime.com/Browse.ashx?id=a38316" guide_id="a38316"/>
</outline>
</body>
</opml>

Visiting http://opml.radiotime.com/Browse.ashx?id=c467491 (BBC radio), gives

Code: [Select]

<?xml version="1.0" encoding="UTF-8"?>
<opml version="1">
<head>
<title>BBC</title>
<status>200</status>

</head>
<body>
<outline text="Local Stations (5)" key="local">
<outline type="audio" text="BBC Asian Network (London)" URL="http://opml.radiotime.com/Tune.ashx?id=s44490" bitrate="48" reliability="92" guide_id="s44490" subtext="Asian Network Gold" genre_id="g334" formats="wma" show_id="p482318" item="station" image="http://d1i6vahw24eb07.cloudfront.net/s44490q.png" current_track="Asian Network Gold" now_playing_id="s44490" preset_id="s44490"/>
<outline type="audio" text="BBC Radio 1Xtra (London)" URL="http://opml.radiotime.com/Tune.ashx?id=s20277" bitrate="48" reliability="95" guide_id="s20277" subtext="Adele Roberts" genre_id="g18" formats="wma" show_id="p397082" item="station" image="http://d1i6vahw24eb07.cloudfront.net/s20277q.png" current_track="Adele Roberts" now_playing_id="s20277" preset_id="s20277"/>
<outline type="audio" text="BBC Radio 4 Extra (London)" URL="http://opml.radiotime.com/Tune.ashx?id=s6839" bitrate="48" reliability="96" guide_id="s6839" subtext="Miss Marple" genre_id="g209" formats="wma" show_id="p570432" item="station" image="http://d1i6vahw24eb07.cloudfront.net/s6839q.png" current_track="Miss Marple" now_playing_id="s6839" preset_id="s6839"/>
<outline type="audio" text="BBC Radio 5 live sports extra (London)" URL="http://opml.radiotime.com/Tune.ashx?id=s50459" bitrate="48" reliability="93" guide_id="s50459" subtext="Rugby Union" genre_id="g323" formats="wma" show_id="p182611" item="station" image="http://d1i6vahw24eb07.cloudfront.net/s50459q.png" current_track="Rugby Union" now_playing_id="s50459" preset_id="s50459"/>
<outline type="audio" text="BBC Radio 6 Music (London)" URL="http://opml.radiotime.com/Tune.ashx?id=s44491" bitrate="48" reliability="95" guide_id="s44491" subtext="Guy Garvey&apos;s Finest Hour" genre_id="g111" formats="wma" show_id="p116824" item="station" image="http://d1i6vahw24eb07.cloudfront.net/s44491q.png" current_track="Guy Garvey&apos;s Finest Hour" now_playing_id="s44491" preset_id="s44491"/>
</outline>
<outline text="All Stations" key="stations">
<outline type="audio" text="BBC Radio 2 (London)" URL="http://opml.radiotime.com/Tune.ashx?id=s24940" bitrate="48" reliability="97" guide_id="s24940" subtext="Elaine Paige" genre_id="g3" formats="wma" show_id="p180480" item="station" image="http://d1i6vahw24eb07.cloudfront.net/s24940q.png" current_track="Elaine Paige" now_playing_id="s24940" preset_id="s24940"/>
<outline type="audio" text="BBC Radio 5 live (London)" URL="http://opml.radiotime.com/Tune.ashx?id=s24943" bitrate="48" reliability="94" guide_id="s24943" subtext="5 Live Sport" genre_id="g2723" formats="wma" show_id="p857" item="station" image="http://d1i6vahw24eb07.cloudfront.net/s24943q.png" current_track="5 Live Sport" now_playing_id="s24943" preset_id="s24943"/>
<outline type="audio" text="BBC Radio 3 (London)" URL="http://opml.radiotime.com/Tune.ashx?id=s24941" bitrate="48" reliability="98" guide_id="s24941" subtext="The Early Music Show" genre_id="g5" formats="wma" show_id="p38676" item="station" image="http://d1i6vahw24eb07.cloudfront.net/s24941q.png" current_track="The Early Music Show" now_playing_id="s24941" preset_id="s24941"/>
<outline type="audio" text="BBC Radio 4 LW (Birmingham)" URL="http://opml.radiotime.com/Tune.ashx?id=s50577" bitrate="48" reliability="94" guide_id="s50577" subtext="Gardeners&apos; Question Time" genre_id="g266" formats="wma" show_id="p889" item="station" image="http://d1i6vahw24eb07.cloudfront.net/s50577q.png" current_track="Gardeners&apos; Question Time" now_playing_id="s50577" preset_id="s50577"/>
<outline type="audio" text="BBC Radio 4 (London)" URL="http://opml.radiotime.com/Tune.ashx?id=s25419" bitrate="48" reliability="96" guide_id="s25419" subtext="Gardeners&apos; Question Time" genre_id="g3124" formats="wma" show_id="p889" item="station" image="http://d1i6vahw24eb07.cloudfront.net/s25419q.png" current_track="Gardeners&apos; Question Time" now_playing_id="s25419" preset_id="s25419"/>
<outline type="audio" text="BBC Radio 1 (London)" URL="http://opml.radiotime.com/Tune.ashx?id=s24939" bitrate="48" reliability="95" guide_id="s24939" subtext="Huw Stephens" genre_id="g61" formats="wma" show_id="p134949" item="station" image="http://d1i6vahw24eb07.cloudfront.net/s24939q.png" current_track="Huw Stephens" now_playing_id="s24939" preset_id="s24939"/>
</outline>
<outline text="Explore BBC" key="related">
<outline type="link" text="BBC Local" URL="http://opml.radiotime.com/Browse.ashx?id=c467494" guide_id="c467494"/>
<outline type="link" text="BBC Nations" URL="http://opml.radiotime.com/Browse.ashx?id=c467492" guide_id="c467492"/>
<outline type="link" text="BBC World Service" URL="http://opml.radiotime.com/Browse.ashx?id=c467496" guide_id="c467496"/>
</outline>
</body>
</opml>

david_a_dawson

  • Veteran
  • ***
  • Posts: 79
    • View Profile
Re: Automatic adding Internet Radio streams to LinuxMCE
« Reply #37 on: January 12, 2014, 03:26:58 pm »
Should I assume that others are getting a flat list for the radio stations?  I'm definitely getting a nested structure.

Dap-P

  • Veteran
  • ***
  • Posts: 85
    • View Profile
Re: Automatic adding Internet Radio streams to LinuxMCE
« Reply #38 on: January 12, 2014, 08:40:48 pm »
Normally the site should give you a flat list of radio stations, based on your location.

Perhaps, the site doesn't know exactly where you are...
It should display your 'city' instead of the country where you are in.
I'll try to look into this...

Anton
« Last Edit: January 12, 2014, 08:52:26 pm by Dap-P »

Dap-P

  • Veteran
  • ***
  • Posts: 85
    • View Profile
Re: Automatic adding Internet Radio streams to LinuxMCE
« Reply #39 on: January 12, 2014, 08:59:42 pm »
Again, an update. I dont know if this is working for everybody, but i hope so

Anton
« Last Edit: January 12, 2014, 10:36:06 pm by Dap-P »

david_a_dawson

  • Veteran
  • ***
  • Posts: 79
    • View Profile
Re: Automatic adding Internet Radio streams to LinuxMCE
« Reply #40 on: January 12, 2014, 09:38:30 pm »
hello, I run with show|add, it starts, thinks for a moment, and quits with no results.....

garagevibes

  • Regular Poster
  • **
  • Posts: 23
    • View Profile
Re: Automatic adding Internet Radio streams to LinuxMCE
« Reply #41 on: January 12, 2014, 10:14:33 pm »
in the uk follow the link in the script http://opml.radiotime.com/Browse.ashx?c=local then copy the address for your area so for london copy this http://opml.radiotime.com/Browse.ashx?id=r100780 and then open the script in nano or other editor and amend the variable at the top of the script named DownloadURL with the new address save and then run to add uk stations in your area, it works great thank you for this

Dap-P

  • Veteran
  • ***
  • Posts: 85
    • View Profile
Re: Automatic adding Internet Radio streams to LinuxMCE
« Reply #42 on: January 12, 2014, 10:35:44 pm »
And again an update, this is fully functional for me.
Changed to a little different downloadurl, and put some some different filters in there.

In theory, what garagevibes sayd is possible, only i want this script to do all this automaticly.

Now, if only your country gets detected, the website should filter by popular stations.
Can you UK-based guys test this?

Anton
« Last Edit: February 11, 2014, 08:46:04 pm by Dap-P »

coley

  • Guru
  • ****
  • Posts: 481
    • View Profile
Re: Automatic adding Internet Radio streams to LinuxMCE
« Reply #43 on: March 18, 2014, 06:59:59 pm »
Did the script get into svn or somewhere other than the forum?
We seem to have lost attachments with the forum move.
Is it available somewhere?

thanks,
-Coley.

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3009
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Automatic adding Internet Radio streams to LinuxMCE
« Reply #44 on: March 18, 2014, 08:00:08 pm »
I've recovered it from the old forum:

http://deb.linuxmce.org/possy/radioscript.sh