LinuxMCE Forums

General => Users => Topic started by: Dap-P on October 26, 2013, 12:18:36 am

Title: Automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on October 26, 2013, 12:18:36 am
Hi all,

I found this nice site that had indexed a whole lot of internet radio stations.
Here you also can find 'Local' radio stations, based on your geolocation (IP based)

so i made a command that downloads the needed information, as this would seem to me like a handy function to have while installing LMCE, or available from the Webadmin

Command:
Code: [Select]
curl --silent http://opml.radiotime.com/Browse.ashx?c=local | grep audio | grep station|  gawk -F'"' '{ print "Station : " $4}{system("curl --silent "$6" |  head -n1")}'
Output:
Code: [Select]
Station : #Station Name# (#Genre#)
#URL#

Now i need some help with putting this info in LinuxMCE
Is there a commandline script i can call, to add media to the LMCE database?
Or should this be done via Mysql?

Anton
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: golgoj4 on October 26, 2013, 01:34:22 am
*bump* Sambucca might have a better idea. I would think that if done from the webadmin, setting up in the db would be done in the same command. I dont think there is a facility to do what you describe.

-Langston
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: sambuca on October 26, 2013, 02:42:52 pm
Hi,

You can add files and streams of any kind from the web-admin, I think it is the Media File Sync menu. Go to the media file sync page and there should be a "Add new file" or something like that on the left side. I'm not able to double-check right now, but look around in the mentioned places ;)

br,
sambuca
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Marie.O on October 26, 2013, 03:06:05 pm
and after you've added a single station successfully to the pluto_media database, take a look at the File table, how it was added. After that, you should be able to add a bunch of stations from the commandline.

EDIT: Oh, and look at File_Attribute and Attribute, to see where the details like Title etc are stored.
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: sambuca on October 26, 2013, 10:28:53 pm
If you create a script to insert(and/or update) stations in lmce, please try to make it generic and available for other LMCE users. I know this has been requested before, so it would be beneficial...

(I know the html scraping part will be different for different sites, but the script to insert/update channels should be the same)

br,
sambuca
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on October 26, 2013, 11:54:54 pm
Made a little progress, i can fill pluto_main from the cmdline

Example to add Dutch Radio station 3FM to LMCE. run this in bash, and you should have an extra radio stream
Code: [Select]
Station="3FM 96.5"
Genre="Alternative Rock"
Url="http://icecast.omroep.nl/3fm-bb-mp3"


echo "insert into File (EK_MediaType,DateAdded,Filename,Missing,IsDirectory,IsNew) VALUES(43,NOW(),'$Url',0,0,1);" | mysql pluto_media
PK_File=$(echo "select * from File where Filename='$Url';" | mysql pluto_media | tail -n1 | awk -F" " '{print $1}')
echo "insert into Attribute (FK_AttributeType,Name) VALUES(10,'$Station');" | mysql pluto_media
FK_Attribute=$(echo "select * from Attribute where Name='$Station';" | mysql pluto_media | tail -n1 | awk -F" " '{print $1}')
echo "insert into File_Attribute (FK_File,FK_Attribute,Track,Section) VALUES('$PK_File','$FK_Attribute',0,0);" | mysql pluto_media
echo "insert into LongAttribute (FK_AttributeType,FK_File,Text) VALUES(8,'$PK_File','$Genre');" | mysql pluto_media

But somehow the Stations name does not get linked to the 'File'
Run the code from a commandline, and see for yourself.

What am i not seeing in the database?

Anton

Modified, to correct commands
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: sambuca on October 26, 2013, 11:58:35 pm
Well, you have PK_Attribute and FK_Attribute, use one or the other ;-)

Another thing to consider is when to re-use an existing attribute.... You could keep adding attribute with the same name, but that would make duplicate attributes in LMCE, not sure you want that...

br,
sambuca
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on October 27, 2013, 12:01:27 am
I just saw it myself... Oops)
Fixed now
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Marie.O on October 27, 2013, 12:06:40 am
And a quick note on the syntax: use mysql -e instead of echo "", ie.

mysql pluto_media -e "SELECT COUNT(*) FROM File"


instead of

echo "SELECT COUNT(*) FROM File" | mysql pluto_media

Not sure if the variable replacement will still work, but that's how I add stuff into a database. OR, when I create scripts for LinuxMCE, I use the shell lib we already have in LinuxMCE, i.e.

. /usr/pluto/bin/SQL_Ops.sh 2>/dev/null || exit 1
. /usr/pluto/bin/Config_Ops.sh 2>/dev/null || exit 1

Q="SELECT IK_DeviceData FROM Device_DeviceData WHERE FK_Device = '$Device_ID' AND FK_DeviceData='$DD_ONLINE'"
Value=$(RunSQL "$Q")
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on October 27, 2013, 12:08:59 am
Another thing to consider is when to re-use an existing attribute.... You could keep adding attribute with the same name, but that would make duplicate attributes in LMCE, not sure you want that...

Sambuca, this would only affect the Genre... Personally, i dont use it, but i wanted to add it anyway.
I am not a database guy... i will try to make it as neat as possible, so your remark has been noted)))

Posde, Thanks, i will try that
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on October 27, 2013, 01:09:24 am
Ok, here is a working script,

It will download an indexfile and process it into the LinuxMCE
It does not add Genre's, only the station's name and the url

Can somebody try this out? And yes, it could mess up your whole DB.....
If you only want to see what stations would be added, comment out the Add to Database lines before running the script

Anton
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Marie.O on October 27, 2013, 11:11:20 am
Nice script, and I very much like the fact you added comments to it! One thing that you might want to look into is the last inserted ID http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html - instead of relying on the URL to be in the system only once, use LAST_INSERTED_ID() like this:

mysql pluto_media  -e "INSERT INTO File (Filename) VALUES ('my nice file'); SELECT LAST_INSERT()"

It will return the last inserted ID that was created during your connection. Very helpful in my book. (I always have to look the syntax up, as my brain is not very good at remembering things ;) )


EDIT: Instead of hardcoding the temporary file, use tempfile, ile.

NameOfTempFile=`tempfile`
wget --output-document=$NameOfTempFile xxxxxx
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: golgoj4 on October 27, 2013, 02:58:08 pm
Look, i dont mean to hijack, but let this thread be an example. if you reach out and get your hands a little dirty, people will show up to help

carry on  ;D
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on October 27, 2013, 05:37:40 pm
I want to expand the script with checks to not add duplicates, and to check the genre and reuse that attribute, its still just a simple script.

As I have no experience using mysql, all advise is appreciated. I will try to make to as useable as possible.

@posde Thanks for the tips

Anton
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: sambuca on October 28, 2013, 02:38:42 pm
Basically, it just involves doing a "select PK_Attribute from Attribute where FK_AttributeType = ? and Name=?", then check if that returned a PK_Attribute value. If it did, reuse that, if not, insert a new item.

br,
sambuca
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on October 28, 2013, 08:37:21 pm
Had some sparetime, and name some progress on the script,

New features:
- Use variable for tempfile
- Check if the Url is already in the DB before adding
- Reuse genre if it exists
- Adds genre if it not exists
- Uses SELECT MAX(id) to find out last added row

@sambuca, i couldn't get a working SELECT LAST_INSERT_ID, i think if it because i used 2 seperate mysql -e statements, If MAX(id) is not suitable, i have to make LAST_INSERT_ID working somehow

Attached is the new version

Anton
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Marie.O on October 28, 2013, 09:09:25 pm
use it in the same connection, as I outlined in a previous post:

mysql pluto_media -e "INSERT INTO File (Filename) Values ('abcd'); SELECT LAST_INSERT();"

As you see, you have two statements, on a single connection. That way, you get the last inserted ID.
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on October 28, 2013, 09:38:44 pm
I thought it would work that way, when i realised it didn't work as plan. thanks!!!

Here 2 new scripts,
 - add radiostations with select_last_id
and
 - delete radiostations

Anton
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Marie.O on October 28, 2013, 09:43:25 pm
The first file doesn't look right in line 25
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on October 28, 2013, 09:48:58 pm
What does not look right?
to me it seems correct, i do the insert, and last_insert in 1 command, with the output in $PK_File var

it even works for me

Anton
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: WhateverFits on October 29, 2013, 04:50:11 am
What does not look right?
to me it seems correct, i do the insert, and last_insert in 1 command, with the output in $PK_File var

it even works for me

Anton

The lines are tuncated:

Code: [Select]
               PK_File=$(mysql pluto_media -e "insert into File (EK_MediaType,DateAdded,Filename,Missing,IsDirectory,IsNew) VALUES(43,NOW(),'$Url',0,0,1);$

                #Add Station Name to Database
                FK_Attribute=$(mysql pluto_media -e "insert into Attribute (FK_AttributeType,Name) VALUES(10,'$Station');select LAST_INSERT_ID() from Attri$
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on October 29, 2013, 11:36:07 pm
My mistake...

Here are the correct ones:

Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: WhateverFits on October 29, 2013, 11:46:50 pm
Thanks! Looks good, now I can test it.
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Marie.O on October 30, 2013, 03:30:40 pm
Looks much better. One more little thing. To get rid of the tail -1 you have, use

mysql pluto_media -ss -e "SELECT 123"

That way, it will only return the resultset without any fieldname etc. The two 's' are the reason for mysql to be (s)ilent.
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on October 30, 2013, 11:31:58 pm
New update

Added a description to the script,
added the -ss flag, and removed tail -n1
added the Download Url to a variable
in the delete script added a loop, so that it reads all urls, and checks that in the database


In general, would it be wise to add multiple files to the same radiostation? Now i just grab the first one.

Anton
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: WhateverFits on October 31, 2013, 07:32:50 pm
In general, would it be wise to add multiple files to the same radiostation? Now i just grab the first one.

So far, this looks rather good. I've tested the prior version and now I'm going to test this one. It works great! I did have a duplicate URL attempted to get inserted and it failed gracefully. Very nice. Now, can you give an example of multiple files and the same radiostation? Example XML would be good to know what you are talking about.

Thanks for the good work!
Title: Re: Need help with automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on November 01, 2013, 10:24:13 pm
New update :

Now it is only 1 script

Added a show function, this will display all local radio stations, with their Url's and Genre

Anton

Edit: Somehow i broke the script... i will check it now
Edit 2: I think it is working again
I had to readd the tail -n1 for some commands, apparently the insert_last_id somehow returned multiple lines
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on November 16, 2013, 08:24:03 pm
Who has tested this, and what were the results?

Also, is it more clear, what i mean with multiple Urls for the same radiostation?


Anton
Title: Re:
Post by: ardirtbiker on November 16, 2013, 11:50:26 pm
It worked for me.. no problems

Sent from my SCH-I535 using Tapatalk 4
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: ladekribs on November 18, 2013, 08:17:09 am
It worked for me also, no problems either. Nice!

BR Stefan
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on November 18, 2013, 07:18:05 pm
Thats great news)

Anton
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: Alblasco1702 on December 29, 2013, 04:29:48 pm
Working to get it in webadmin that will make it  easyer to setup. :)
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: tsoukas 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
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P 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
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: huh 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.
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P 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
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: david_a_dawson 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>
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: david_a_dawson 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.
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P 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
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P 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
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: david_a_dawson 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.....
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: garagevibes 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
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P 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
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: coley 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.
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: Marie.O on March 18, 2014, 08:00:08 pm
I've recovered it from the old forum:

http://deb.linuxmce.org/possy/radioscript.sh
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: coley on March 18, 2014, 11:51:43 pm
I've recovered it from the old forum:

http://deb.linuxmce.org/possy/radioscript.sh
Thanks for that possy

-Coley.
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: golgoj4 on November 14, 2014, 03:07:39 am
What was the final disposition of this. Does someone want to make it into a formal device so users dont have to hit a forum to enable the feature?

Cmon down, we'll help!

-golgoj4
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on November 14, 2014, 01:02:51 pm
What was the final disposition of this. Does someone want to make it into a formal device so users dont have to hit a forum to enable the feature?
-golgoj4

Soon i will have the time to finish this. in a couple months.

Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: golgoj4 on November 15, 2014, 02:45:56 pm
Soon i will have the time to finish this. in a couple months.

Would you mind if we took what we there and added a simple interface in the web admin?

-golgoj4
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on November 17, 2014, 11:54:09 am
Would you mind if we took what we there and added a simple interface in the web admin?

-golgoj4

Sure) If it is not finished by the time i have time  ;) , i will pick up where you guys left off.

Anton.
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: phenigma on November 17, 2014, 11:15:23 pm
Hey guys, I tried the script (it thinks I'm in Missouri for some reason)  but my system won't play any of the included radio stations that it does add.  Do I need to do anything else?

J.
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: WhateverFits on November 18, 2014, 07:45:32 pm
Quick reload? There are several stations on mine that won't play due to oddball formats from the station.
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: golgoj4 on November 19, 2014, 08:30:06 pm
Quick reload? There are several stations on mine that won't play due to oddball formats from the station.

I have that issue as well. Some are good. some are not.

*Bonus points: access the media player that md's use to vet the url, discard if its no good.
Tricky, but thats why its listed under bonus. :)
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: Dap-P on April 20, 2015, 05:46:00 pm
*Bonus points: access the media player that md's use to vet the url, discard if its no good.
Tricky, but thats why its listed under bonus. :)

Probably this is fixed in the new update. there are also some other features added, like logo's.

the update is in Trac, and i think phenigma will try to publish it.

Regards,
Anton
Title: Re: Automatic adding Internet Radio streams to LinuxMCE
Post by: phenigma on April 20, 2015, 06:34:14 pm
The code has been pushed into svn and will be included in the next update. :D  Thanks!

J.