BBC iPlayer

From Indie IT Wiki

Introduction

BBC iPlayer, commonly shortened to iPlayer, is an internet television and radio service, developed by the BBC to extend its former RealPlayer-based and other streamed video clip content to include whole TV shows.

Documentation

https://github.com/jjl/get_iplayer/wiki/Documentation

Original Web Site

http://www.infradead.org/get_iplayer/html/get_iplayer.html

Latest Version

METHOD A

https://github.com/get-iplayer/get_iplayer/wiki/unix

sudo apt-get -y install libwww-perl liblwp-protocol-https-perl libmojolicious-perl libxml-libxml-perl libcgi-pm-perl
wget https://raw.githubusercontent.com/get-iplayer/get_iplayer/master/get_iplayer
sudo install -m 755 ./get_iplayer /usr/local/bin
get_iplayer -v
get_iplayer --cache-rebuild --type=tv,radio
get_iplayer --type=tv ".*"

METHOD B

sudo add-apt-repository ppa:jon-hedgerows/get-iplayer
sudo apt-get update
sudo apt-get install get-iplayer
get-iplayer --help
get-iplayer --refresh
get_iplayer ".*"
get_iplayer --prefs-add --tvmode=best

Documentation - https://github.com/get-iplayer/get_iplayer/wiki/documentation

Old Version

git clone git://git.infradead.org/get_iplayer.git

get_iplayer Options File

Make sure you have (at least) the following settings in your ~/.get_iplayer/options file. Configure to taste.

quality = sd
fps25 = 1
quiet = yes
ffmpeg = /usr/local/bin/ffmpeg
tv-quality = sd
nocopyright = yes
releasecheck = 1
atomicparsley = /usr/bin/AtomicParsley
subtitles = 1
ffmpegloglevel = quiet
ffmpegforce = yes

You can add each option manually with this ...

get_iplayer --prefs-add --subtitles

INFO: Added option 'subtitles' = '1'

Then, you can check to make sure it's worked with ...

get_iplayer --prefs-show

https://github.com/get-iplayer/get_iplayer/wiki/prefs

Showing Your Downloads History

get_iplayer --nocopyright --history |awk -F ', ' '{ print $2 }' |sed '/^$/d' |tac

Setting Up PVR Searches Recordings

The following commands allow you to set up saved searches to be run from cron for any number of different shows... a bit like a video recorder, hence the term Personal Video Recorder.

Adding

get_iplayer --pvr-add=the_midwives --type=tv "The Midwives"

Listing

get_iplayer --pvr-list

Running

get_iplayer --pvr

Deleting

get_iplayer --pvr-del the_midwives

ERROR: flv to mp4 conversion fails

FIX: temporary

ffmpeg -i filename.flv -vcodec copy -acodec copy filename.mp4

FIX: permanently

Make sure you have (at least) the following settings in your ~/.get_iplayer/options file. Configure to taste.

nocopyright yes
modes flashhd,flashhigh,flashnormal,iphone
ffmpeg /usr/local/bin/ffmpeg
flvstreamer /usr/bin/flvstreamer
output /home/paully/Videos

To find out where your programs are, issue the following commands:-

which ffmpeg
which flvstreamer

ERROR: RTMP_ReadPacket, failed to read RTMP packet header

NEW Solution - 2013 June / September

Edit your ~/.get_iplayer/options file...

rtmpdump /usr/bin/rtmpdump
rtmptvopts --swfVfy http://www.bbc.co.uk/emp/releases/iplayer/revisions/617463_618125_4/617463_618125_4_emp.swf

http://makingtechnologyeasier.blogspot.co.uk/2013/06/getiplayer-rtmpreadpacket-failed-to.html

OLD Solution: install rtmpdump alongside flvstreamer.

sudo apt-get install rtmpdump

get_iplayer will use rtmpdump automatically if it is installed. The result? Faster, smoother downloads with no errors. If it occurs again. delete the file ~/.swfinfo because the BBC have changed the flv specification for iPlayer.

Originally from: http://www.mail-archive.com/get_iplayer@lists.infradead.org/msg00279.html

ERROR: WARNING: Your version of flvstreamer/rtmpdump does not support SWF Verification

The BBC have started SWF Verification to their files. The standard software of flvstreamer does not support this, so switch back to rtmpdump instead. To do this, just change the line on your options file.

~/.get_iplayer/options
nocopyright yes
modes best
tvmode best
ffmpeg /usr/bin/ffmpeg
flvstreamer /usr/bin/rtmpdump
output /home/paully/Videos

Switches

--category film
--category HD
--get --output ~/Videos/
--channel hd
--get --vmode=flashvhigh --subtitles --output ~/Videos
--type=radio
--type=podcast

Modes / Resolutions

To show the video and audio options for an item, use the switch --info on it...

/usr/local/bin/get_iplayer --info 6874

To show the get_iplayer modes, use the --help option...

/usr/local/bin/get_iplayer --long-help | grep 'modes '

To download in worst mode at 25fps...

/usr/local/bin/get_iplayer --fps25 --tvmode worst --get 6874

To download in good mode at 25fps with subtitles... (THIS IS MY DEFAULT)

/usr/local/bin/get_iplayer --fps25 --tvmode good --subtitles --get 7030

To download in best mode at 50fps...

/usr/local/bin/get_iplayer --fps50 --tvmode best --get 6874

Streaming

Rather than downloading, you can stream your TV or Radio programme:-

./get_iplayer 518 --stream --vlc="/usr/bin/vlc" --flvstreamer="/usr/bin/flvstreamer" --player="vlc -" --modes=flashstd --tvmode=flashstd

or

./get_iplayer 518 --stream --player="mplayer -cache 3072 -" --modes=flashstd --tvmode=flashstd

Older Programmes

Sometimes, you will not see older programmes in the command line software, that do show on the official app or web site.

This is because get_iplayer can only search for programmes that were scheduled for broadcast on BBC linear services within the previous 30 days, even if some are available for more than 30 days on the iPlayer/Sounds sites. BBC Three programmes, red button programmes, iPlayer box sets, web-only content, and BBC podcasts are not searchable. Old programmes that are still available after 30 days must be located on the iPlayer/Sounds sites and downloaded directly via PID or URL.

For example, the complete series of the TV show Spooks is not shown in the command line but is available at the page below, so all you do is copy and paste the URL at the end of the get_iplayer command...

Main Page - https://www.bbc.co.uk/iplayer/episodes/b006mf4b/spooks

Series 1 Episode 1 - https://www.bbc.co.uk/iplayer/episode/p008wnc7/spooks-series-1-episode-1

get_iplayer "https://www.bbc.co.uk/iplayer/episode/p008wnc7/spooks-series-1-episode-1"

Here are some other shows which I like ...

Detectorists

Luther

WORK IN PROGRESS

Retrieve list of urls from a web page to use with jq and get_iplayer ...

curl "https://www.bbc.co.uk/iplayer/group/b00vk2lp" | grep 'REDUX' | jq '.entities[].props.href'

Viewing Outside The UK

BritBox