get_iplayer and Windows batch files

Vangelis forthnet northmedia1 at the.forthnet.gr
Mon Jan 16 10:41:03 EST 2012


On Sun Jan 15 23:30:07 GMT 2012, Shevek wrote:

>I have a batch script set up to run daily using Windows task scheduler.
>The trick is that by default .pl files are not associated to anything
>under windows (they are, I assume, under Linux), so you have to
>actually call perl.exe and pass get_iplayer.pl as an argument and then
>the arguments for get_iplayer.

 You are right; that is exactly what the "get_iplayer.cmd" file inside the
installation folder does. If opened with notepad (right click -> Edit), you 
get:

@echo off
perl.exe get_iplayer.pl %*

 So, in terms of a batch file context,

perl get_iplayer.pl

is the same as

CALL get_iplayer

>This is my script which downloads multiple programmes of both TV and
>Radio. When I want to add anything I simply add it to the list at line
>4 for TV and line 6 for Radio:

 I mostly download radio. I used to be an ipdl (Paul Battley's one) user,
where one would only need to provide a programme's pid (off the iPlayer 
site)
for that programme to be downloaded...
  More as a "batch file writing" exercise, I've written a .bat to download 
radio shows
with get_iplayer by simply providing a pid; I've named the file 
GetRadioProgramme.bat
and placed it inside my downloads folder ("D:\Vangelis\iPlayer 
Recordings\");
I am just running it from there...
Content of the GetRadioProgramme.bat file follows (this is for a Win 32bit 
OS):

@echo off
REM *** CD to get_iplayer's installation folder ***

cd /d "C:\Program Files\get_iplayer\"

REM *** Refresh Radio Cache ***

CALL get_iplayer --type=radio --refresh dontshowanymatches
echo.
echo *** Download Radio Programme via its pid ***
echo.
SET /P PID="Paste pid, then press ENTER "

CALL 
get_iplayer --type=radio -i --pid=%PID% --modes=flashaac --force -w --tag-podcast-radio

:END

One can use one's personalised flavour of the get_iplayer command, with 
additional options and their arguments...
Of course, using the standard route I can just type e.g.

get_iplayer --type=radio --pid=b019dmzb

but
1. I may have to first wait for the TV cache to be refreshed (default 
behaviour, can be changed...)
2. type everytime any additional options/arguments or, if don't want that, 
add them in my personal options
with get_iplayer --prefs-add
Anyhow, already said I did it as an exercise, possibly someone finds it 
useful...

Cheers, Vangelis.




More information about the get_iplayer mailing list