Adding webradios by writing files .pls .m3u into a directory

General discussion about RuneAudio. Do not post any support or feature requests here.

Adding webradios by writing files .pls .m3u into a directory

Postby AW_Raudio » 21 Sep 2014, 12:21

Hi

Is it possible to add webradios to the library by writing(copying) files in format .pls and/or .m3u into a directory ? Which directory must be used ? How to update the database ?

I copied some files .pls and .m3u into /mnt/MPD/Webradio. Enabled automatic update of MPD's database when files in music_directory are changed. And forced library update.

All these stations are now in the library, but the URLs are shown as false and the numbering for "My Webradios(x)" is wrong. It still shows the number of webradios added by GUI.

How to add a large number of webradios ?

Rgds
AW
Rgds
AW
AW_Raudio
 
Posts: 9
Joined: 21 Sep 2014, 11:26

Re: Adding webradios by writing files .pls .m3u into a direc

Postby ACX » 21 Sep 2014, 23:34

Hi AW_Raudio,
the "My Webradios" entries are actually stored in /mnt/MPD/Webradio as a single .pls file for each radio station. The file follows this standard:

Code: Select all
[playlist]
NumberOfEntries=1
File1=http://50.7.173.162:8010/
Title1=Audiophile Baroque

Moreover, the UI stores the added webradios in its local database (Redis), so the displayed number of entries refers to the value stored in the db.

This was a deliberate choice to make the add process very simple via UI, and to keep a retrocompatibility with other MPD clients. Unfortunatly at this time there is no simple way to batch import more than one webradio at a time.
User avatar
ACX
RuneAudio co-founder
 
Posts: 1692
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: Adding webradios by writing files .pls .m3u into a direc

Postby hunchan » 02 Nov 2014, 06:56

I discovered a way to bulk add .pls files to Rune Audio Webradio. I noticed that when I added urls manually the .pls that was created used all lower case for the "numberofentries=1" string, so I simply used a find and replace utility called fnr.exe to change every instance of "NumberOfEntries=1" in my .pls files to all lower case like so:

NumberOfEntries=1 >>> numberofentries=1

I then copied the files to /mnt/MPD/Webradio, updated, and voila! they all appeared in the web ui.
hunchan
 
Posts: 2
Joined: 02 Nov 2014, 06:48

Re: Adding webradios by writing files .pls .m3u into a direc

Postby hunchan » 04 Nov 2014, 02:03

To revise my previous post, I was mistaken. There is absolutely no need change anything in the .pls files. Just copy them as is into /mnt/MPD/Webradio. If you update MPD now, nothing will change, but if you add one radio station url manually through the web GUI, then when you update the MPD database it will automatically detect all of the other .pls files.
hunchan
 
Posts: 2
Joined: 02 Nov 2014, 06:48

Re: Adding webradios by writing files .pls .m3u into a direc

Postby cmh714 » 04 Nov 2014, 02:26

I found after moving my pls files that when I went to one of the "imported" stations, the web url was missing and just said false....at least thats what happened to me. Most likely a permissions issue but didnt think to look before I fixed it through the UI.
cmh714
 
Posts: 470
Joined: 04 May 2014, 03:06

Re: Adding webradios by writing files .pls .m3u into a direc

Postby challenge » 04 Nov 2014, 09:01

I confirm this and it's pretty boring. Using 0.3 beta and pretty sure it's a bug.

I added a few web radios pls files following the standard:

  1. they aren't included in the web radio count in the library page. even if I add 10 files and update library, the web radio count in runeui shows only the one added via interface wizard.
  2. if I add only the files without creating at least one radio through the interface, they don't show in the interface and they're counted as zero. So the whole web radio folder doesn't open.
    I have to create one web radio in the interface wizard and then I can see the other too.
  3. as others said, even if the files are in the correct format, the UI don't show their url, but instead every station has the word "false" in the url field. So they don't work
Actually I have to insert them by hand using the runeui interface otherwise they won't work...

--Are they being indexed in database? I guess no, or something wrong it's happening since the files added are not counted and they don't have address.
challenge
 
Posts: 17
Joined: 05 Oct 2014, 14:21

Re: Adding webradios by writing files .pls .m3u into a direc

Postby challenge » 04 Nov 2014, 11:56

ok confirmed, the files added manually in the directory aren't being added to database.
Just checked redis db and only the ones added through the UI are listed, no trace of the other ones. Even after a library update.
I'll write this in the 0.3beta thread.
challenge
 
Posts: 17
Joined: 05 Oct 2014, 14:21

Re: Adding webradios by writing files .pls .m3u into a direc

Postby ACX » 04 Nov 2014, 12:03

challenge wrote:--Are they being indexed in database?

Yes, they are. You can check it with this command:

Code: Select all
redis-cli hgetall webradios
User avatar
ACX
RuneAudio co-founder
 
Posts: 1692
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: Adding webradios by writing files .pls .m3u into a direc

Postby gearhead » 30 Jun 2015, 15:04

Old thread, but just tried this again. Copied some .pls files to /mnt/MPD/Webradio and cannot get them to show up in the UI. The only one is the one I added via the UI.

Code: Select all
 # redis-cli hgetall webradios
1) "flac "
2) "http://sr7.inmystream.info:9100/stream.flac"

an 'ls' of the directory shows a bunch of *.pls files

If I add one in the UI, they all show up but the number in the UI is 2, the number I have added from the UI. When I run that redis command, it only slists the 2 I have added through the UI. Is there a redis command that will rescan the directory?

Code: Select all
 # redis-cli hgetall webradios
1) "flac "
2) "http://sr7.inmystream.info:9100/stream.flac"
3) "Andy's 80s"
4) "http://lin1.san.fast-serv.com:9844/"



Keith
gearhead
 
Posts: 101
Joined: 25 Nov 2014, 06:04

Re: Adding webradios by writing files .pls .m3u into a direc

Postby dwijtsma » 01 Jul 2015, 12:06

If someone could write a python script that scans the directory with webradio's and add them to the redis database, that would be nice :mrgreen:

PS: small hint ;)
Audio gear: RuneAudio on Raspberry Pi 2 + Dr. DAC nano, Marantz pm66se, Avalon Avatar
dwijtsma
 
Posts: 51
Joined: 03 Nov 2014, 20:16

support RuneAudio Donate with PayPal

Next

Return to General discussion

Who is online

Users browsing this forum: No registered users and 2 guests