Skip to content
notnac edited this page Dec 28, 2018 · 31 revisions

PVR usage

Click here for all PVR options (Return to ToC)

PVR Basics

The PVR functionality allows you to record any number of iPlayer programmes using any combination of search terms that you would normally run on the command line. This feature allows you to run multiple batch recordings from a scheduler such as Unix cron (and possibly the Windows scheduler). The PVR searches are saved in $HOME/.get_iplayer/pvr/ or %USERPROFILE%\.get_iplayer\pvr\ in Windows. You can add, delete and list the PVR searches:

Add a new PVR search for a specific programme (i.e. 'series link'):

get_iplayer --pvr-add=Top_Gear "Top Gear"

Add a new PVR search for a specific programme with lower recording quality:

get_iplayer --pvr-add=Top_Gear "Top Gear" --tvmode=good

Add a new PVR search for a specific radio programme with lower recording quality:

get_iplayer --pvr-add=Doctor_Who_Radio "Doctor Who" --type=radio --radiomode=good

Use recursive recording with the PVR for BBC Three programmes that are posted over a period of time:

get_iplayer --pvr-add=Being_Human --pid=b00hqlc4 --pid-recursive

This can also be used for iPlayer box sets, stacked series, or BBC Three programmes made available all at once. However, there is no need to use the PVR for that purpose since those would be one-off downloads.

Add a new one-off recording PVR search. This will effectively queue the programmes for recording and delete the PVR search after completion:

get_iplayer --pvr-queue 123 231 32 "Blue Peter"

Add a new one-off recording PVR search for a specific PID:

get_iplayer --pvr-queue --pid=b01a2b3c

Use the --pvr-series option as a shortcut to create simple PVR searches to record specific series. This is analogous to an "Add Series" link in the Web PVR. Examples:

$ get_iplayer troy

Matches:
7575:	Troy: Fall of a City: Series 1 - Conditions, BBC One, b09tm9kv
7576:	Troy: Fall of a City: Series 1 - Siege, BBC One, b09vf7c0
7577:	Troy: Fall of a City: Series 1 - Spoils of War, BBC One, b09w375q
7578:	Troy: Fall of a City: Series 1 - Hunted, BBC One, b09wzybb
INFO: 4 matching programmes

# use cache index for any episode in series
# cannot use --pid or --url
$ get_iplayer --pvr-series 7575

Matches:
7575:	Troy: Fall of a City: Series 1 - Conditions, BBC One, b09tm9kv
INFO: 1 matching programmes
INFO: Saving PVR search '_Troy_Fall_of_a_City_Series_1_name_tv':
	type tv
	search0 ^Troy: Fall of a City: Series 1$

# add pvr search for all unique series in search results
$ get_iplayer --pvr-series "Arthur: Series 1(8|9)"

Matches:
...
419:	Arthur: Series 18 - Arthur Read: Super Saver, CBBC, b055tysm
420:	Arthur: Series 18 - Tibbles to the Rescue, CBBC, b055v0h6
421:	Arthur: Series 18 - Whip. Mix. Blend, CBBC, b055v113
422:	Arthur: Series 19 - Maria Speaks, CBBC, b05zhfxd
423:	Arthur: Series 19 - Carl's Concerto, CBBC, b05zhhpd
424:	Arthur: Series 19 - Too Much of a Good Thing, CBBC, b05zhjgl
...
INFO: 23 matching programmes
INFO: Saving PVR search '_Arthur_Series_18_name_tv':
	type tv
	search0 ^Arthur: Series 18$
INFO: Saving PVR search '_Arthur_Series_19_name_tv':
	type tv
	search0 ^Arthur: Series 19$

In many cases, you can define a PVR search that will capture all current and future series of a programme. For example, a PVR search for all current and future series of Doctor Who could be defined with:

get_iplayer --pvr-add doctor_who_tv --type=tv "^Doctor Who"

That will match TV programme cache entries with the programme brand name ("Doctor Who") located at the beginning (signified by the circumflex [^] regular expression metacharacter) of the complete programme name. If the brand name appears before a colon in the complete programme name, e.g., "Doctor Who: Series 11", use it in your search string to make it as specific as possible:

get_iplayer --pvr-add doctor_who_tv --type=tv "^Doctor Who:"

Take care not to make auch search strings overly broad. For example, "^Today" would match more than just the "Today" programme - it would match any programme whose name begins with "Today".

List the PVR searches already added:

get_iplayer --pvr-list

Remove a PVR search:

get_iplayer --pvr-del=Top_Gear

Disable a PVR search:

get_iplayer --pvr-disable=Top_Gear

Re-enable a PVR search:

get_iplayer --pvr-enable=Top_Gear

Run the PVR (this really should be added to a scheduler such as cron):

get_iplayer --pvr

Scheduling the PVR

Unix/macOS

A tutorial is on how to set up and use the PVR with cron is here. Basic steps:

Add this line to add to user's crontab (use crontab -e to edit) - this will run all of the PVR searches every hour:

0 * * * * /path/to/get_iplayer --pvr --quiet 2>> /tmp/get_iplayer.log

Optionally, to notify by email when programmes have been recorded, add this to the top of your crontab (this will take the stdout from the cron job and send it to the specified email address):

Or, run the PVR Scheduler from the command line. This will fire off the PVR every hour as long as the command is running:

get_iplayer --pvrscheduler 3600

Windows

There is an entry in the Start menu labelled 'Run PVR Scheduler Now'. This will start a command window which will fire off the PVR every 4 hours. Or, run the PVR Scheduler from the command line as shown above for Unix/macOS.

You may also use the PVR with Windows Task Scheduler. Below is a basic incantation for the schtasks utility to create a scheduled task to run all PVR searches every four hours (even if you are logged off), with output appended to a log file in your home directory.

schtasks /create /ru <username> /rp <password> /sc hourly /mo 4 /tn get_iplayer_pvr_task /tr "get_iplayer --pvr --quiet 2>> \"%^USERPROFILE%\get_iplayer_pvr_task.txt\""

You can disable/enable/delete the scheduled task using schtasks:

schtasks /change /disable /tn get_iplayer_pvr_task
schtasks /change /enable /tn get_iplayer_pvr_task
schtasks /delete /tn get_iplayer_pvr_task

You can also use the Task Scheduler GUI application to create and configure a scheduled task. If so, the quoting and escaping in your task's "Start a program" action settings is slightly different to the form used above for schtasks:

Program/script=get_iplayer
Add arguments=--pvr --quiet 2>> "%USERPROFILE%\get_iplayer_pvr_task.txt"

Search the internet for additional information about Task Scheduler and schtasks.

Clone this wiki locally