Skip to content
notnac edited this page Dec 6, 2023 · 31 revisions

PVR usage

Click here for all PVR options (Return to ToC)

PVR Basics

The PVR functionality allows you to automatically record iPlayer/Sounds programmes using saved combinations of search terms and options 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 or Windows Task Scheduler. The PVR searches are saved in $HOME/.get_iplayer/pvr/ or %USERPROFILE%\.get_iplayer\pvr\ in Windows. See options file format for the format of PVR search files.

Adding searches

Add a new PVR search for a specific programme (i.e. set up a '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" --tv-quality=web,mobile

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 --radio-quality=med,low

Queuing one-off recordings

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

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

Queue a new one-off recording for a specific PID:

get_iplayer --pvr-queue --pid=b01a2b3c

Queue a new one-off recording for multiple PIDs:

get_iplayer --pvr-queue --pid=b01a2b3c,b0bxbj27

Adding searches to record entire series

You can use recursive series/brand recording with the PVR:

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

The above command form can also be used for iPlayer box sets, stacked series, or certain radio programmes with whole series made available in advance. However, there is no need to use the PVR functionality for those programmes since they would be one-time downloads.

You can also 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/remove/disable/enable PVR searches

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

Execute PVR searches

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

get_iplayer --pvr

Run only PVR searches with "top" in their names:

get_iplayer --pvr top

Run a single PVR search:

get_iplayer --pvr-single=Top_Gear

Run PVR searches in test mode (programmes not downloaded):

get_iplayer --pvr --test

Limitations

The PVR functionality is for downloading programme media files. Downloading only programme information or only subtitles or only metadata tags is not supported. The --metadata-only, --subtitles-only, --thumbnail-only, --cuesheet-only, --tracklist-only, --credits-only, and --tag-only are not saved in PVR searches. You can still download those items along with programme media files in PVR searches, or use the --*-only options separately on the command line.

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 * * * * /full/path/to/get_iplayer --pvr --quiet 2>> /tmp/get_iplayer.log

Find /full/path/to/get_iplayer with which get_iplayer.

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):

MAILTO=me@mydomain.com

Do not run get_iplayer as root user via cron.

macOS users can also schedule PVR runs with launchd. See http://launched.zerowidth.com for help in generating a .plist file to define the schedule for get_iplayer PVR runs.

Do not run get_iplayer as root user via launchd.

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 described below.

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.

All platforms

Run the PVR Scheduler from the command line. This will fire off the PVR every 4 hours (14400 secs) as long as the command is running:

get_iplayer --pvrscheduler=14400

1800 secs (30 mins) is the minimum value allowed.

Clone this wiki locally