Tuesday, July 30, 2013

UK Public Radio Browser hits Beta


Come a long way but finally the latest version has moved to Beta and is now feature complete, I've cut down what needs to be downloaded to just the executable and logo pack and the first time it's run it'll create the directories and xml's needed to manage the application - just copy the contents of the zip file to an empty directory and launch the exe - there isn't an installer so if you want to remove just delete all files in the folder/sub folders where the exe resides.

Following are some screenshots to help you out a tad figuring your way around the application 

requires Windows with minimum .Net Framework 4.0 installed

First tab you're see when you launch the application, click on the AZ the first time and it'll download all the metadata, once complete click again to see programmes currently available or soon available

Double click on a programme that interests you to be taken to the next tab to see available episodes, from this tab you can add the programme to your favourites and schedules


Example of programme in your favourites list, I use this to keep track of programmes I don't listen to regularly but want on keep a eye on to see if the odd episode interests me.


Example of programme added to the schedule list, this I use to keep track of programmes that I want to be notified of being available.  Note that the application it's self doesn't do this notification but instead executes an external command (ie batch script).  I've developed like this to keep it flexible and it's an area where one size won't fit all and could easily become a drain on development time.

An example is included which shows metadata being passed to an external command as shown in the screenshot - the application can't control the external command but can read return codes to indicate within application how the command have performed.  At bottom of post is an example for passing a parameter to get_iplayer.

Return Code Translation
Success 0
Failed 1 or greater
Unprocessed -1


Details of schedule run, if a episode is marked as success then it won't be picked up on the next schedule run.  Currently there is no option to process just the latest addition on the first run, as seen below where many episodes are available which you may not be interested in


Final tab, you can switch on the scheduler rather than manually running it.  Be mindful as to how often the metadata is polled, for most using the application once or twice a day then 8 - 12 hours would be a suitable period, currently I've got it set so if a local version of the metadata is less than 4 hours old than that version will be presents instead of the online version, so no point in setting any lower than 4.

Finally is the details for calling the batch file and the parameters that can be passed from the metadata



Script example of calling get_iplayer
create get_iplayer.bat (create in root folder) with following:-

SET iplayer_path="C:\Program Files (x86)\get_iplayer"
SET ffmpeg_path="C:\Program Files (x86)\get_iplayer\FFmpeg\ffmpeg-shared\bin\ffmpeg.exe"
SET Lame="C:\Program Files (x86)\get_iplayer\LAME\lame.exe"
SET RTMPDump_path="C:\Program Files (x86)\get_iplayer\RTMPDump\rtmpdump.exe"
SET Meta_Path="C:\Program Files (x86)\get_iplayer\AtomicParsley\AtomicParsley\AtomicParsley.exe"
SET MPlayer="C:\Program Files (x86)\get_iplayer\MPlayer\mplayer-svn-36348\mplayer.exe"

%iplayer_path%\get_iplayer.pl --type=radio --pid=%1 --modes default --rtmpdump %RTMPDump_path% --ffmpeg %ffmpeg_path% --atomicparsley %Meta_Path% --mplayer %Mplayer% --lame %Lame% --tag-podcast --file-prefix="-" --force > .\log\%1.log

exit %ERRORLEVEL%



Modify setupCMD.xml in folder root/setup to following:-


name = Get_iplayer
    command = get_iplayer.bat
    argument = PID

4 comments:

Anonymous said...

Oh dear - I'm probably being VERY stupid here - please forgive me. So far as good, I've got a list, I've added a couple of shows to the schedule. But now what? I can't see any guidance as to how they are recorded, or where the recorded files end up.

Or doesn't it go as far as this? Sorry to be so idiotic....

Martin963

lakeuk said...

If you want to get a recording then you'll need to create a command that calls an application like get_iplayer passing in the PID, support in this area is out of scope of my application although the command feature in my act allows others to make it possible to get working with apps like get_iplayer, following forum is the help I've got in this area - squarepenguin forums

Anonymous said...

I see that batch file comes from here:
http://squarepenguin.co.uk/forums/topic/get_iplayer-commands/

But that is only good for that particular setup (with separate instance of perl

Generic would be:

SET iplayer_path="C:\Program Files\get_iplayer\"
SET ffmpeg_path="C:\Program Files\get_iplayer\FFmpeg\ffmpeg-1.2-win32-static\bin\ffmpeg.exe"
SET Lame="C:\Program Files\get_iplayer\LAME\lame.exe"
SET RTMPDump_path="C:\Program Files\get_iplayer\RTMPDump\rtmpdump.exe"
SET Meta_Path="C:\Program Files\get_iplayer\AtomicParsley\AtomicParsley\AtomicParsley.exe"
SET MPlayer="C:\Program Files\get_iplayer\MPlayer\mplayer.exe"

cd %iplayer_path%

get_iplayer.cmd --type=radio --pid=%1 --modes default --rtmpdump %RTMPDump_path% --ffmpeg %ffmpeg_path% --lame %Lame% --aactomp3 --force > C:\iPlayer_Downloads\%1.log

exit %ERRORLEVEL%

This also downloads .m4a & auto-converts to .mp3

sebus

lakeuk said...

Batch script was produced by myself, I have an activestate perl install which my initial batch script was running against which led me to query on squarepenguin's forum for help.

Thanks for the generic script, batch scripting sided is not my strong point so any help in that area I'm going to have to leave for other to respond to like yourself and squarepenguin.