How do I run multiple get_iplayer commands from a single .bat file?
#3
Hi Finchy505,
For how you've outlined your problem, Dinky's suggestion of using get_iplayer's pvr options is probably the way you want to go. However, for other downloads a batch script may be appropriate. So, here's some ideas:
  • From the get_iplayer Prompt
    I notice you've included the --get option in your examples which isn't needed when using --pid. Additionally, running your commands will pick up all available episodes including ones you've already downloaded—you probably want to include the --hide option to avoid all the already in history warnings. You also have three separate commands; it can all be done in one:
Code:
get_iplayer --hide --pid-recursive --pid b01qv24w,b01bsr61,b006xxw3
  • Using a get_iplayer Preset
    You could use --preset (-z) to add the options you want and then run that preset:
Create the Preset
Code:
get_iplayer -zMySeries --prefs-add --hide --pid-recursive --pid b01qv24w,b01bsr61,b006xxw3

Run the Preset
(You can include additional options if you want; for example --test.)
Code:
get_iplayer -zMySeries
get_iplayer -zMySeries -t

View the Preset's Options
Code:
get_iplayer -zMySeries --prefs-show

Update the Preset
Code:
get_iplayer -zMySeries --prefs-add <replacement and/or new options>
get_iplayer -zMySeries --prefs-del <option(s) to be removed>

Delete the Preset
Code:
get_iplayer -zMySeries --prefs-clear
  • Using a Batch Script
    I can't give a tutorial on batch scripts here, but the trick to downloading when using get_iplayer in a script is to prefix the get_iplayer command with cmd /c. It's also probably best to use .cmd as the file extension instead of .bat. Here's a quick example:
Code:
@echo off
echo Downloading new episodes for my series
cmd /c get_iplayer --hide --pid-recursive ^
   --subdir-format "Kids\<nameshort>\Series< 00seriesnum>" ^
   --pid b01qv24w,b01bsr61
cmd /c get_iplayer --hide --pid-recursive --pid b006xxw3
echo Finished downloading
exit /b 0
Note, the caret (^) in batch scripts escapes the next character (newlines in this example) so although the first download command is split across three lines in the script, it is treated as a single line and a single get_iplayer command.

I hope this helps.


Messages In This Thread
RE: How do I run multiple get_iplayer commands from a single .bat file? - by User 04 - 29-01-2019, 09:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Ashamed to admit - how do I put commands in ? dieselweasel 2 2,575 01-11-2017, 10:03 PM
Last Post: dieselweasel
  WebPVR: How to exclude common single word programme names? MrArtist 3 3,653 22-01-2017, 01:23 AM
Last Post: dinky
  BBC PID download single or multiple Robbie 3 3,703 02-11-2014, 10:22 AM
Last Post: Robbie