ebruck / radiotray-ng

An Internet radio player for Linux
GNU General Public License v3.0
254 stars 23 forks source link

How to import existing streaming radio playlists? #92

Closed phd21 closed 5 years ago

phd21 commented 5 years ago

Hi ebruck,

Thank you for this nice application.

I have many streaming playlists available in various playlist formats. How can I import them into "radiotray-ng"? It would be great to have an import option.

I also use the excellent StreamTuner2 application which supports "drag n drop" to most music applications and that would be great to do with your radiotray-ng application directly or using its bookmarks editor as well.

Merry Christmas and Happy Holidays to you and yours.

Regards, Phil (phd21)

prof-milki commented 5 years ago

Hi everyone.

Let me chime in here to lobby for an add_radio(name, url, genere) DBUS method in Radiotray-NG. Or the other way round to match Bookmarks::add_station()... See also: http://fossil.include-once.org/streamtuner2/wiki/radiotray

ST2 is already patched to read the nicer RT-NG bookmarks.json format. But having the ability to export new stations directly to RT would be nifty, because it has a nicer interface for managing bookmarks. (Whereas Streamtuner is more or less just about unfiltered service browsing.)

Best!

ebruck commented 5 years ago

@prof-milki this is interesting. I'll do a bit of research to see how this can be added. This certainly can be used by @phd21 to write a script that imports any sort of playlist data he may have.

I'm open to exposing more of radiotray-ng via dbus than adding these sorts of features to the bookmark editor.

phd21 commented 5 years ago

Hi ebruck,

Thank you for replying quickly.

I am glad to see that Mario of StreamTuner2 (st2) is also engaged in this.

A lot of people (including me) would find an easy to use desktop import playlist option into your radiotray-ng bookmarks very useful.

I provided a link to my post on StreamTuner2 for your information.

StreamTuner2 ♪♬# / Discussion / Open Discussion: Request for adding support for "radiotray-ng" application and some other stuff. https://sourceforge.net/p/streamtuner2/discussion/1173108/thread/322751ea57/

Is there any way to show the streaming station icon (favicons) in the 'radiotray-ng" system tray application?

Best regards, Phil (phd21) phd21mint@gmail.com

ebruck commented 5 years ago

@phd21 @prof-milki

I read some of the discussions and JSON is rather easy to deal with especially in Python. The quickest route to getting something going is for ST2 to edit the JSON file found in the config setting and then issue a reload bookmarks command via the dbus interface.

prof-milki commented 5 years ago

@ebruck

Just added some fallback logic to augment RTNGs bookmarks.json directly. That's indeed the simplest option.

Radiotray recognizes the on-disk change right away, but the DBUS .reload_bookmarks() method does not seem to complete. It does get recognized with a "Bookmarks Reloaded" app notification, but the station list doesn't get rebuild/redrawn. (While Preferences > Reload Bookmarks does work as expected.)

ebruck commented 5 years ago

I think you found a bug. :-)

ebruck commented 5 years ago

@prof-milki please use v0.2.5-dev

prof-milki commented 5 years ago

@ebruck Works like a charm now ;)

phd21 commented 5 years ago

Hi ebruck,

I just compiled and installed the developer version0.2.5-dev and can also confirm that StreamTuner2 can add to the RadioTray-ng and it both work great.

Most of the Linux Mint people or other Linux users are not very comfortable compiling software from source code. Can you please provide "deb" files for this version? I am currently using Linux Mint 19 and Linux KDE Neon both based on Ubuntu 18.04, but I still use Linux Mint 18 based on Ubuntu 16.04 as do many others, do you know if your newer versions can be compiled on those systems?

It would still be great to be able to import streaming playlists (many stations at once) into RTNG using at least one common playlist format (.pls, .m3u, .xspf, etc...) and the ".json" format. I hope you are still considering creating an import playlist feature for RTNG?

Best regards, Phil (phd21)

ebruck commented 5 years ago

@phd21 more advanced station discovery and perhaps an import facility will be part of #52 @mburns83 is currently looking into this.

As for packaging please see https://github.com/ebruck/radiotray-ng/issues/90#issuecomment-447585370

phd21 commented 5 years ago

Hi ebruck,

Thank you for your work on radiotray-ng and for working with Mario of StreamTuner2 from all music lovers.

I put some paraphrased instructions on how to compile your radiotray-ng v0.2.5-dev on the Linux Mint forum post. I hope that is alright with you.

I read the links to the comments you provided. I totally understand how difficult it could be to provide the various installation files and options for all the various versions of Linux and Linux Mint. I thought radiotray-ng was in the Linux Mint repos for Linux Mint 19.x (based on Ubuntu 18.04), but it is not your newer versions and launchpad can sometimes take awhile before making updates avilable.

Are you familiar with "OBS" the OpenSUSE Build system which works for all software on all Linux platforms and can provide deb, rpm, and archive files? Or the AppImage option from the AppImage developers and or from the OBS system AppImage option? AppImages are great because all dependencies are packaged in the AppImage and they work on most Linux systems and older versions of Linux as well. The AppImage people (probonopd and TheAssassin) are willing to help developers get setup for automatically providing AppImages for their software and updates if they are the developer, but not from 3rd party requests. I have many software applications as AppImages that I use from Kdenlive, Ksnip (excellent screen capture and basic image editor), qTox (superb secure multimedia messenger), etc...

AppImage - Linux apps that run anywhere https://appimage.org/

Open Build Service https://openbuildservice.org/

Apps in AppImage format – AppImageHub https://appimage.github.io/apps/

TheAssassin/AppImageLauncher: Helper application for Linux distributions serving as a kind of "entry point" for running and integrating AppImages https://github.com/TheAssassin/AppImageLauncher

Merry Christmas and Happy Holidays to you and yours and everyone else.

Best regards, Phil (phd21)

ebruck commented 5 years ago

Thanks for the links.

ebruck commented 5 years ago

@prof-milki initial play_url support has been added: https://github.com/ebruck/radiotray-ng/commit/ffd743c6bfefc428a5e5626e47c59e34f3116208

Any testing you can do would be great as it's a bit of a hack.

thx!

phd21 commented 5 years ago

Hi Ed? Ebruck,

That is great. I also mentioned this in the post I have been working on with Mario.

Will this require us to re-compile RT-NG and if so exactly which branch and checkout tag do we use?

I found this link below regarding importing or converting playlist to json format that may be of interest in you and this post.

m3u to JSON converter https://gist.github.com/christopherlovell/9db2bdd81088cf673219

Merry Christmas and Happy Holidays to you and yours!

Best regards to you and yours,

Phil (phd21)

prof-milki commented 5 years ago

initial play_url support has been added: ffd743c Any testing you can do would be great as it's a bit of a hack.

@ebruck Thanks! The empty group "" seems quite involved. It's working great nonetheless. Didn't notice any UI issues either when switching between real bookmarks and temporary play_url stations.

This might even warrant a --play_url CLI option to make Radiotray invokable as generic audio player.

@phd21 See the attached script for importing JSPF playlists to Radiotray. I'd say it's too much overhead to support a complex playlist import scheme or drag and drop support in the bookmarks editor itself.

phd21 commented 5 years ago

Hi ebruck,

Happy New Years to you and yours.

Have your new changes been added to your "v0.2.5-dev" branch? So, all we have to do is download that, re-compile, and install that?

Thank your for the import JSPF playlist script, I will check that out. Is this script going to be added to your radiotray-ng app or its bookmarks editor, or does it have to be run stand-alone? It would still be great to have some way to import a more common playlist format like "xspf", or "m3u", or "pls" even if it converted those into the JSPF playlist format.first.

jchris/xspf-to-jspf-parser: Javascript library for consuming XSPF Playlists in the browser. https://github.com/jchris/xspf-to-jspf-parser

Best regards, Phil (phd21)

ghost commented 1 year ago

m3u to JSON converter

May some one rewrite it in Shell or Python?

ghost commented 1 year ago

And here is radiotray2transistor converter written in Python to convert JSON playlist into multiply M3U's playlists (one M3U per station):