Page 112 of 117

REQUEST - add tuneIn radio streams

Posted: Mon 05 Dec 2016, 19:17
by tenochslb
Is it possible to add TuneIn radio streams to pradio?

What is TuneIn?:
TuneIn is a privately held company based in San Francisco, California founded by Bill Moore as RadioTime in Dallas, Texas in 2002. TuneIn has over 100,000 broadcast radio stations and four million on-demand programs and podcasts from around the world
https://en.wikipedia.org/wiki/TuneIn
There is a plugin available in VLC to be able to reproduce the TuneIn streams:
https://addons.videolan.org/content/sho ... iles-panel

The main code appears to be in the following file:

tunein.lua:

Code: Select all

--[[
 $Id$

 Copyright © 2014 VideoLAN and AUTHORS

 Authors: Diego Fernando Nieto <diegofn at me dot com>

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
--]]
require "simplexml"

function descriptor()
    return { title="TuneIn Radio" }
end

--
-- Main Function
--
function main()

	-- Add the main categories to browse TuneIn
	
	-- Check is the username was defined
	-- WISH: Dialog to change this params because vlc.config object doesn't work
	local __username__ = "user"
	local __password__ = "password"
	
	tunein_radio = NewTuneInRadio (__username__, __password__)

	--
	-- Create a new TuneinRadio object
	--
	tunein_radio.load_genre_cache( )

	--
	-- Use the add_radio_tracks to load categories in the playlist
	-- track_type is category, region, id
	--
	if __username__ ~= nil then
		tunein_radio.add_radio_tracks ( "category", "presets", "Favorites" )
	end
	
	tunein_radio.add_radio_tracks ( "category", "local", "Local Radio")
	tunein_radio.add_radio_tracks ( "category", "trending", "Trending")
	tunein_radio.add_radio_tracks ( "category", "music", "Music")
	tunein_radio.add_radio_tracks ( "id", "c57922", "News")
	tunein_radio.add_radio_tracks ( "category", "talk", "Talk")
	tunein_radio.add_radio_tracks ( "category", "sports", "Sports")
	tunein_radio.add_radio_tracks ( "region", "r0", "By Location")
	tunein_radio.add_radio_tracks ( "category", "lang", "By Language")
	tunein_radio.add_radio_tracks ( "category", "podcast", "Podcasts")
end

--
-- Class TuneInRadio
--
function NewTuneInRadio (username, password)
	--
	-- TuneIn Radio private members
	--
	local self = {	__username__ = username,
					__password__ = password,
					__genres_cache__ = {},
					__partner_id__ = "k2YHnXyS",
					__protocol__ = "http://",
					__BASE_URL__ = "opml.radiotime.com",
					__formats__ = "aac,html,mp3,wma,wmpro,wmvideo,wmvoice"
	}
    
	--
	-- Load the genre array in a cache
	--
	local load_genre_cache = function ()
			
		-- Local Variables
		local params = ""
		local method = "/Describe.ashx"
		params = "?c=genres" .. "&partnerId=" .. self.__partner_id__

		-- Create the URL
		local url = self.__protocol__ .. self.__BASE_URL__ .. method .. params

		-- Add the first node
		local tree = simplexml.parse_url(url)

		for _, body in ipairs( tree.children ) do
			simplexml.add_name_maps( body )

			-- This has found an genre
			if body.children_map["status"] == nil then
				if body.children_map["outline"] ~= nil then
					-- Browse all outline elements searching genres
					self.__genres_cache__ = (body.children_map["outline"])
				end
			end
		end
	end

	--
	-- Return the Genre name based in its genre_id
	--
	local get_genre_name = function ( genre_id )
		for _, genres in ipairs (self.__genres_cache__) do
			if ( genres.attributes["guide_id"] == genre_id ) then
				return  genres.attributes["text"]
			end
		end
	end
    
	--
	-- Add Radio Tracks Functions
	--
	local add_radio_tracks = function ( track_type, category, category_name, username, password )
		
		-- Local Variables
		local params = ""
		local method = "/Browse.ashx"
	
		-- Create the params string using track_type
		if track_type == "category" then
			params = "?c=" .. category
		elseif track_type == "region" then
			params = "?id=" .. category
		elseif track_type == "id" then
			params = "?id=" .. category
		end
		params = params .. "&formats=" .. self.__formats__ .. "&partnerId=" .. self.__partner_id__ .. "&username=" .. self.__username__ .. "&password=" .. self.__password__
	
		-- Create the URL
		local url = self.__protocol__ .. self.__BASE_URL__ .. method .. params
	
		-- Add the first node
		local node = vlc.sd.add_node( {	title = category_name,
									 	arturl = "https://raw.githubusercontent.com/diegofn/TuneIn-Radio-VLC/master/resources/" .. category .. ".png"
									 } )
		local tree = simplexml.parse_url(url)
			
		for _, body in ipairs( tree.children ) do
			simplexml.add_name_maps( body )
			
			-- This has found an station
			if body.children_map["status"] == nil then
				if body.children_map["outline"] ~= nil then
					
					-- Browse all outline elements searching stations
					for _, station in ipairs( body.children_map["outline"] ) do
						if station ~= nil then
							
							-- Add Station
							-- Check if the station is a Radio Station
							if station.attributes["type"] == "audio" then
								-- Its a station
								node:add_subitem( {path = station.attributes["URL"],
												title = station.attributes["subtext"],
												artist = station.attributes["text"],
												genre = get_genre_name ( station.attributes["genre_id"] ),
												arturl = vlc.strings.resolve_xml_special_chars ( station.attributes["image"] )
								} )
							
							elseif station.attributes["type"] == "link" then
								-- Its a Subnode (Link)
								node:add_subitem( {path = station.attributes["URL"],
												title = station.attributes["text"],
												artist = station.attributes["text"],
												album = station.attributes["text"],
								} )
							
							else
								-- Its a Subnode only
								-- WISH. Can display the entire tree
							end
						end
					end
				end
			end
		end
	end

	return {
		load_genre_cache = load_genre_cache,
		get_genre_name = get_genre_name,
		add_radio_tracks = add_radio_tracks
	}
end


Can something like this be included in pradio?

Posted: Wed 07 Dec 2016, 21:23
by zigbert
tenochslb
I will check this out, but right now there is no time...

Posted: Sat 10 Dec 2016, 23:33
by zigbert
Version 5.2.6
http://www.puppylinux.org/wikka/pmusicInstall

Changelog
- Bugfix: xerrs.log is getting filled (thanks to sheldonisaac)

Posted: Wed 04 Jan 2017, 16:58
by zigbert
Version 5.2.7
http://www.puppylinux.org/wikka/pmusicInstall

Changelog
- Bugfix: Export: Disclaimer prevents export (Thanks to MochiMoppel)
- Bugfix: Masstagger: Help dialog prevents tagging (Thanks to MochiMoppel)
- Bugfix: Help/Disclaimer dialogs prevents saving config (Thanks to MochiMoppel)
- Bugfix: Masstagger: Ensure all files in list get tagged

Posted: Wed 04 Jan 2017, 17:01
by zigbert
Version 5.3.2 - Development release
http://www.puppylinux.org/wikka/pmusicInstall

Changelog - (so far) for the next major update - pMusic 5.4.0

Code: Select all

- Radio
	- Allow alternative urls for each station in the index if found at radiosure.com
	- Use alternative url if no connection is provided
- Playqueue
	- Multiple playqueues
		- Show/hide in PlayQueue menu
		- Right-click menu to rename/delete
	- Sort / Shuffle items in list
- Export
	- Export from multiple sources (not only playqueue)
	- See and edit export-list before executing
	- Option to add albumart to target directory (thanks to 01micko)
	- Help dialog
	- Statusbar showing nr of files to export
	- Handgrip to scale window
	- Open empty export tool from the File menu
	- Right-click menu (playqueue and sourcelist): Send to export
	- Unify look with Masstagger dialog
- Visualization
	- Basic visualization engine
	- Available presets found in the View menu
	- Fullscreen/window mode
	- Preset file: /usr/local/pmusic/txt_visualization
	- Option to (de)activate visualization in preferences (cpu-usage)
- Masstagger
	- Remove file in list by mouse middle-click
	- Unify look with Export dialog
	- Set $STORAGE_DIR/albumart as default location for alternative albumart image files
	- Bugfix: update statusbar filecount when adding via right-click menu
- Play engine
	- Play tracks in alternative sources (not playqueue) without interfering with queue
	- Improve shuffle play
- Sourcelist
	- Choose visible columns in sourcelist (thanks to live)
- Gui:
	- Some rearrangements in the Music Sources menu
	- Bugfix: tooltip-markup shows even if tooltips is turned off in preferences
	- Themes
		- Nad5
			- icon_import.svg, icon_clean.svg
			- class for tree-headers including buttons - alt_list_header
			- Class for multiple playqueues
			- Minor adjustments
		- GTK
			- icon_import.svg, icon_clean.svg
			- Class for multiple playqueues
- Trackinfo
	- Album list: Search for track
	- Bugfix: Choosing Genre (id3) from menu-button includes id-nr.
- Support include-mechanishm in asoundrc for bluetooth support (thanks to fr33land and rerwin)
- File chooser (box_chooser)
	- Support widget-modes - open/save/... (thanks to MochiMoppel)
	- Specify default directory for file/directory-selection
- Move from func to func_C 
	- sec2time
- Top-Hits plugin
	- Gui improvements
	- Improve detection
	- Use file with highest rating (in case of several hits)
- Backend plugin
	- Option to move output to text editor
- Help: Link to the wiki in all info dialogs
- About: Link to wiki - disclaimer
- Move attribute info (-h/--help) to file txt_attributes.
- Bugfix: General error-msg missing NLS support for the word 'Error' in the frame
- Bugfix: Live stream (no length description) should not add timestamp to favorites

Posted: Sat 25 Feb 2017, 04:56
by Flash
I'm not sure this is a bug in Pmusic because I think the same thing has happened to me in Xine, but it was a while ago and I'm not sure.

Anyway, I was converting an audio book to mp3 so I could put it on my mp3 player and accidentally clicked on an mp3 file, which started Pmusic. I shut Pmusic off right away, but then noticed that the computer was going crazy. I'm sorry that I don't have time to really explain it better right now. I just want to get this screenshot where I can talk about it more when I have time. Note all the instances of func player that are running. Also pmusic. I can't kill them. They keep coming back. The only way I've found to stop what's going on is to reboot.

Posted: Sun 26 Feb 2017, 15:29
by zigbert
Flash
Please add the pMusic version.
How did you do the conversion - ffConvert?

Posted: Sat 11 Mar 2017, 22:33
by zigbert
With the highly improved podcast handling released in pMusic 5.2.0, it had to happen...

... A new frontend to use pMusic as a simple podcast manager.
Will be shipped in the next development release

Spanish translation

Posted: Mon 13 Mar 2017, 00:00
by vicmz
Here's a Spanish translation of pMusic 5.3.2

Posted: Thu 16 Mar 2017, 00:16
by Flash
zigbert wrote:Flash
Please add the pMusic version.
Sorry. :oops: it's 4.7.1, the one that comes with Quirky Werewolf 64-bit.
How did you do the conversion - ffConvert?
I use Pcdripper 3.9.4 by plinej. Quirky Werewolf 64-bit includes it, too. I never paid attention to how it does what it does, but it works well for me.

Re: Spanish translation

Posted: Mon 20 Mar 2017, 18:20
by zigbert
vicmz wrote:Here's a Spanish translation of pMusic 5.3.2
updated here

Thank you :)
Sigmund

Posted: Mon 20 Mar 2017, 18:26
by zigbert
@Flash
I guess the answer is that both pCdRipper and pMusic uses cdda2wav as its backend, so when killing the gui, the backend gets killed as well.

Bad pid-handling?
Yes.

How could this be improved?
I don't know (atm).

I suppose you know that:
- pMusic supports ripping as well...
- pMusic 4.7.1 is getting very old...

Posted: Mon 20 Mar 2017, 22:45
by Flash
I know pMusic can rip CDs. I tried it once a long time ago and found it didn't work as well for me as Pcdripper. I forget the reason. I could try it again if you think something has changed.

Pcdripper rips and converts to mp3 (my choice is 32 kbps mono) in one operation, then adds the mp3 file to a directory. It will keep ripping, converting to mp3 and adding the mp3 files to the same directory for as many CDs as are in the book. Some books have 30 CDs. The limit for tracks on a CD is 99. Only a few audiobook CDs take it to the limit. Most typically have 15~25 .wav tracks to be converted.

Posted: Fri 24 Mar 2017, 17:00
by Pelo
149 pages to translate, My God ! Just to inform that Pmusic 5.2.6 works well on Super Sulu (included)... Pmusic 5.2.7 and 5.3.2 /i shall see later.

Posted: Fri 24 Mar 2017, 18:27
by zigbert
Flash
If you are pleased with pCDripper, that is just great.
pMusic is in steady development, and suggestions is always welcome. It would be great if you took the time to test the ripping (export) function for your purpose. I remember you asked for an option to add numbering to the ripped tracks years ago. It has been there since then...

Posted: Fri 24 Mar 2017, 18:28
by zigbert
Pelo wrote:149 pages to translate, My God !
More to come :lol:

Posted: Fri 24 Mar 2017, 18:35
by zigbert
Version 5.4.0
See wiki

major news
- Allow several urls for each radio stations
- Multiple playqueues
- Podcast frontend
- New export window
- Visualization
- Search inside lyrics
- Play tracks other places than in the playqueue

All changes in the changelog

Posted: Fri 24 Mar 2017, 18:48
by zigbert
Request for help!

I have an unstable internet connection, which fails to build a fresh index of podcast channels (since the building process check if podcast url is alive before adding it to the index file).

If you have a reliable connection and are willing to let it run for some hours, I would be very thankful if you could send me a fresh index file. All you have to do is to press the button 'Build podcast index' - and wait...

Send me a pm, and you'll get my mail address.
Thank you

Posted: Mon 27 Mar 2017, 01:09
by Sailor Enceladus
I have some mp3s that are over an hour (i.e. trance sessions) and PMusic (currently 5.4.0) doesn't show their correct length.

This was using Slacko 6.9.6.4 32-bit. I uploaded the displayed song below if you need something to test:
https://my.pcloud.com/publink/show?code ... wxO41PFYey

Posted: Mon 27 Mar 2017, 20:05
by zigbert
Sailor Enceladus wrote:I have some mp3s that are over an hour (i.e. trance sessions) and PMusic (currently 5.4.0) doesn't show their correct length.
Thank you for your feedback. I have fixed this for next release

https://github.com/puppylinux-woof-CE/w ... 3125e4b311