Abstract (Italiano): Scrivo questo articolo in inglese perché (ovviamente) la registrazione dei video della BBC interessa maggiormente le persone che parlano inglese. Se lasciate un commento, gentilmente fatelo in inglese.
Abstract (English): I’m writing this post in English because (obviously) recording BBC videos is mostly of interest for those who speak English. Also, a small note for native speakers, especially British people: I’m Italian and I’m mostly used to write using American spelling. For this reason, the post may contain mistakes or American words which may seem unusual. I’m sorry for that. If you find errors (apart from AE spelling) let me know in the comments.
Update (30 April 2017): Version 4.0 of the script is out, which is mostly rewritten from scratch and leverages
youtube-dl
instead offfmpeg
. I’ve updated this post accordingly.
Introduction
I already wrote about downloading videos from the BBC and Hulu websites (in Italian), however it was about two years ago. Websites change and so does software, hence the suggested method of using get_flash_videos
does not work anymore.
I also wrote a generic article about downloading videos from websites (in Italian, too) that contains many different use cases and examples. One of my readers asked for clarification about recording iPlayer videos, so I tried again myself. I was able to apply some of the techniques of my post, together with a couple of clever tricks to find the maximum quality.
Since the process is a bit involved, I wrote a small software which automates all the steps and tells you how to start the recording immediately. This program is actually a so called user script, i.e. a piece of software that runs directly into your browser.
This article explains how to download and install the script. Then it shows you how to use it and what you need to do to record BBC iPlayer videos. Before we start, you need to be able to trick the BBC website into thinking you are living in the UK. If you are actually living there, skip the next section.
Pretending to be in the UK
The BBC iPlayer service is officially available only in the United Kingdom. The website will check your IP address and refuse access if you are trying to watch content from another country. To fix this problem, you need to use a technique to access the site through a server in the UK.
Usually the best tool for the job is a VPN service. VPNs are used to establish secure connections to private networks over the Internet, but may also be used to avoid geographical restrictions of websites.
There are many different VPN services. Most of them are paid (although cheap), while some are free. Among the best options, you can:
- use VPNGate by choosing a node in the UK
- use CyberGhost with free UK servers
- use VPNOneClick
- get a cheap lifetime deal for a professional VPN, such as:
- VPNSecure for 35$ (I bought this myself and I am very satisfied)
- Ivacy for 40$ (bundled with a firewall protection)
- KeepSolid VPN for 40$ (nice selection of countries)
- FastestVPN for 40$ (up to 10 simultaneous devices)
- RealVPN for 20$ (up to 5 simultaneous devices)
Please keep in mind that recently the BBC has started being more aggressive at blocking VPN providers. Always verify if your VPN provider works with the BBC (most of them have free trials available).
Luckily, I also wrote a Python script for easily using VPNGate by specifying only the desired country which works perfectly on any Linux distribution, including Ubuntu, Mint, Fedora, OpenSuse and Mageia. You can check it out here.
You may also try VPN OneClick, which lists UK among the servers. Regardless of what VPN service you choose, once it is activated, you are ready to go on and start recording videos from iPlayer.
Script installation
To run the user script in your browser, you need to install an extension that is compatible with Greasemonkey (version 3) scripts. The following are recommended:
- Firefox (up to version 56): Greasemonkey 3.x
- Firefox (starting from version 48): Tampermonkey
- Chrome/Chromium: Tampermonkey
- Opera: Tampermonkey
- Internet Explorer: change software and start using a real browser 😛
Currently the script does not work with Greasemonkey 4 on Firefox 57 or later. Please do not use Greasemonkey 4.
After this step, you can click the following link to open the script page on Greasyfork. On the page that shows up, click on the Install this script button to complete the procedure.
You are now ready to start downloading.
Recording videos
The next time you open a video page on iPlayer, you’ll see that the script adds a box under it with some instructions and a command line. The following pictures shows an example with this video.

The command line displayed in the gray box is a one-liner you can use together with youtube-dl
. This is a software used to convert and record video files, which can be installed on any of the common Linux distributions such as Ubuntu. More informations are available on the official website.
Despite its name, it does not work only for YouTube, it works for many other websites as well. My script uses it because it can download DASH streams served through a MPD file easily. The program can download some BBC videos without the need of my script, however the latter:
- works on many pages where
youtube-dl
doesn’t recognize the stream URL - provides you with converted SRT subtitles on the fly, thanks to its internal converter
Remember that you will still need ffmpeg
installed on your system. Check out its official website here.
To start the download:
- carefully copy the entire content of the gray box (and nothing else)
- paste it into a terminal window
- press Enter and wait until the process is over
Keep in mind that this will create a lot of temporary files, but they will get removed automatically at the end.
It is also possible to download the videos on Windows or macOS. On Windows you just need to create a new file called download.bat
(with Notepad, or any other editor) in the same directory of youtube-dl.exe
and copy-paste the command line into it. After that, you click the bat file and it should start downloading.
However, please note that I do not offer any assistance for Windows or macOS here on the blog. If in doubt, please use Linux, or find an expert to help you with your OS. You can find the installation instructions of youtube-dl
by clicking here.
Recording radio programmes
Starting from version 3.2, the script supports radio programmes such as those provided by BBC School Radio. The process is exactly the same as recording a video, including the command line. The files are in M4A format as provided by the BBC (no conversion is performed).
Conclusion
The script I developed allows to automate all the necessary steps required to ensure the highest possible quality during the downloading. In particular, the script does the following:
- find the configuration of the player for mobile phones
- get the list of DASH manifests for different bitrates
- look for the best available bitrate for desktop computers
- show the command line to the user
Performing the process manually is time consuming, error-prone and tedious if done multiple times. In this way it should be much easier for those who just want to record a couple of videos to watch them with a modern TV, on the train or keep them in a personal library.
Moreover, starting from version 3.0 the script shows you a download link to the original subtitles in TTML format (which is not very widespread). In addition, it performs an automatic conversion to the commonly used SRT format for your convenience.
Happy downloading! 🙂
Did you like the article?
Writing software and tutorials like this takes time. If you found the provided information useful, and you liked the post, you may buy me a coffee by clicking on the button. 🙂 If you do so, please leave a message on the donation page telling me it’s for this script.
Some progress, but still not success.
Tried first to use the latest released version of ffmpeg – 2.8.6.7-tessus. When I first ran the script on the radio 4 broadcast of Stephen Hawking, I got this – it looks as if the output file name needs double quotes round it, which your tampermonkey script wasn’t supplying:
So I edited the command line in Terminal to put double quotes there, and get this instead:
Looked more closely at this, and realise that I had edited your Tampermonkey script in line 17 to change the output directory to
~/Documents/My Videos
.And that with the space between My and Videos, the directory name now needs quotes around it.
But I had forgotten that I had later changed the directory name in Finder to be just
Videos
, notMy Videos
.so that line 17 should now read:
So back to your script in Tampermonkey to edit in that change. With the change, the output directory and file name no longer needs quotes, and the thing now works! Hurray.
So there was something in the nightly build of ffmpeg that didn’t work? Or something else, perhaps the time I tried to download it first, that stopped it working?
Of course I am not responsible if other people edit the script and it stops working. 😉
Most likely. Nightly builds are, by definition, made from the latest source code which may contain recent modifications, bugs, omissions, etcetera. It’s best to stick with a stable release unless there is the need of using the latest additions.
My script is created and tested with a recent stable release in mind. 🙂
Ciao Andrea, for some strange reasons the script works only once.
If I try it again on another video the text I am supposed to copy doesn’t appear under the video.
And another thing is going on recently.. Vpnsecure looks like working for a few minutes and then “BBC iPlayer TV programmes are available to play in the UK only” appears. I change server, it works for a few minutes and the message appear again.
Any ideas how to fix those problems?
Due to the recent VPN crackdown, VPNSecure informed me that you need to use only their DNS servers if you want to watch the BBC.
Hello! Can you help me? I’ve downloaded Greasemonkey and when I open a video page on iPlayer (http://www.bbc.co.uk/iplayer/episode/b0467pfd/coast-australia-series-1-4-tasmania) I don’t see any box at all. Can you help me please?
I don’t have issues with that page. Please double check that you installed my script correctly and that it shows up in the list of Greasemonkey scripts in your browser.
Hi Andrea! I’m trying to download this video http://www.bbc.co.uk/programmes/p03rr1v1, could you please tell me if your method may work even for it?
Yes, although there was a small issue in displaying the output with the latest version of Tampermonkey.
Hi Andrea, I can work the method fine for normal iplayer programmes, but do you know if there is any way to use it on programmes purchased on the iplayer website (but not available to download)? Thanks!
Hi, I’ve installed only recently your script, but the command line does not show up. I am not using any VPN, but a chromium extension. I am able to see the video in streaming, but, again, no windows comes up whit the command line to copy.
Emily, sorry but I don’t know about downloading purchased programmes.
Cassy, it usually does not work with browser extensions and you will need to use a real VPN service. This is also due to the fact that extensions and similar kinds of proxies are often detected. Conversely, VPN services (together with their DNS servers) are usually better at this. Also, sometimes it might be good to reload the page if the box does not show up the first time (while using a VPN).
Seems broken again:
Thanks,
I can see that you are surfing from Canada… you should check your VPN connection. The script is working for me e.g. on this episode.
Some are working (the one you posted works), but some aren’t. Please test this one for example. Thanks!
The script behaves inconsistently, sometimes I get the URL and sometimes I don’t. I am using Ubuntu 16.04 and the latest version of the script on Firefox and Chrome.
For example:
http://www.bbc.co.uk/iplayer/episode/b0078sl0/francescos-venice-1-blood (works)
http://www.bbc.co.uk/iplayer/episode/b0078sny/francescos-venice-2-beauty (doesn’t work)
I get a null URL:
Jun, Coruja, thank you for providing links! I analyzed those and it seems that the URLs of difference video qualities have a slightly different format. My script was choking at them and couldn’t determine the best quality. Please check out version 3.4.4. 🙂
Thank you for the update – all works well now.
hello, i was wondering: does it work with wimbledon streaming on BBC? for example http://www.bbc.co.uk/sport/live/tennis/36385117… i added http://www.bbc.co.uk/sport/live/tennis/* in the options but i do not see any differences… thank you 🙂
Embedded videos were not supported. I rewrote several parts of the script and now they should be OK, starting from version 3.5.
Is there any way to get this to work for Olympic videos? I’m trying to download the Volleyball game at http://www.bbc.co.uk/sport/live/olympics/36817542 but when I open the video there is no information from the script displayed below. If I go to a regular iPlayer video like a TV episode then it seems to work fine.
I was trying to download a volleyball game from the Olympics at http://www.bbc.co.uk/sport/live/olympics/36817542 but it doesn’t seem to display the download info below the video. I’ve tried it with both the Beebs plugin as well as VPNing into London, the behavior is the same. Please Help!
Yes, you can now download version 3.6 which adds support for the Olympics videos, that are embedded in a slightly different way. Don’t forget to leave a positive rating on Greasyfork afterwards. 🙂
It seems to have stopped working – the url is now coming up as “null”, even on a video where I was able to download before.
Can anything be done to make it work?
Thanks for making this script available, I really appreciate it! 🙂
The script works fine for me on multiple videos. What page are you referring to? Please check your VPN, your IP address is from the Netherlands.
Thanks for your reply. Strange that my IP is showing as Netherlands for you – it’s supposed to be UK and the BBC site lets me watch the iPlayer. Guess that would explain why the script no longer works for me.
Thanks for sharing your script – I did manage to use it a little before it stopped working for me. I’ve now found an alternative which involves downloading the video fragments (something to do with Adobe HDS) and then running a PHP script to combine the fragments once downloaded. This works quite well for me as I don’t have a reliable internet connection, so not having to download the whole stream in one go is more practical for me. FYI, here’s the method I’ve used instead: https://n1njahacks.wordpress.com/2015/01/29/how-to-save-hds-flash-streams-from-any-web-page/ – see the comment by “norton”.
Kind regards!
Weird, but it can happen sometimes. Once I spent a couple of days with many websites thinking I was in the US when I was actually in Italy. IP geolocation relies on databases that sometimes change. Anyway, I sometimes use
AdobeHDS.php
but I tend to avoid it because HDS streams are a bit annoying to record. Well, in the end it seems you got it working in that way so it’s good. 🙂Hello,
Thank you so much for your script and the tutorial. It’s working perfectly for me on mac. However I’m having issues with the quality. You said above that it downloads the best quality. Instead I’m having 540p quality when I know there’s 720p. Same for the radio, some stations have 320kbp but I’m getting 128kbp always. Am I doing something wrong, is there a setting I must activate?
When I’m getting a radio show I also get this error mesage:
But it still downloads the files perfectly. So I don’t understand what that’s about.
I’m very sorry I’m new to this and I don’t know command lines very well. Thank you for your help.
It may be that the quality detection fails on some videos. Could you provide the links to the specific episodes you are referring?
Yes This is the video in particular I wanted to get. http://www.bbc.co.uk/iplayer/episode/b07pqrkw/bbc-proms-2016-quincy-jones-prom . Altough I noticed the same issue with others. The HD download with the iplayer desktop application is better quality and almost double the size I get with the plugin. But sadly there’s no way to remove the DRM. Thank you
Thank you for providing a link and sorry for the late reply. Here’s what happened:
I have tweaked the script to give lower priority to the fake 1920×1080 streams. Version 3.6.2 now allows you to record that video in 1280×720 HD resolution.
Regarding radio programmes:
MP3 conversion is enabled by default for audio-only content and the default is 128kbps I guess. This works well for voice recordings, but it might not be the best option for music. Could you share a link for a radio programme that is available in 320kbps so I can try to figure out a good compromise?
Hello Andrea,
Thank you so for your reply and for providing the update! I was able to download the video without problems and in HD resolution. You’ve made my day!
On the mp3s, it’s not a huge deal, I’m happy your script exists in the first place. I was trying to get this http://www.bbc.co.uk/programmes/b07qbzbn among others. I was just surprised because I knew radio 3 had a higher bitrate than the other stations. They broadcast in HD at 320kbps because it’s best for classical and jazz and in the new iplayer for ios app you can download the shows and the high file size suggests higher bitrate indeed. Sadly the files are temporary and undownloadedble. It’s not a big deal but you might want to look into it. Many thanks!
I have checked that page but I can’t seem to find a M3U8 stream with bitrate higher than 128kbps. One is declared as 320kbps but in reality it isn’t.
That’s odd. Many thanks for having a look. Like I said it isn’t a huge deal. Thank you very much for this script!
Thanks very much for the script! Works perfectly on Radio 6 with Win 7, Firefox 48.0.2, Greasemonkey 3.9 and ffmpeg N-81755-g267da70 64bit.
Getting:
http://cp401489-vh.akamaihd.net/i/iplayerstream/secure_auth/,3200kbps/modav/bUnknown-6f245cb8-6185-4dc5-8435-adae4dc5d210_p04b188g_1476390746425,.mp4.csmil/index_0_av.m3u8: Server returned 403 Forbidden (access denied)
Testing:
http://www.bbc.co.uk/iplayer/episode/p04b183c/adam-curtis-hypernormalisation
The M3U8 URL is correct and it works fine. But you cannot access it from an American IP address, you need to fix your VPN.
I’m also getting “Server returned 403 Forbidden (access denied)”, and my VPN is working properly, so I don’t think thats the reason of the problem.
I take for granted that the fact the BBC is actively monitoring users to detect VPNs is very well known. When I say “check your VPN” I mean that one should ensure their VPN provider is taking appropriate measures to guarantee a working functionality also on BBC iPlayer and other websites. This usually includes appropriately changing IP addresses every now and then and setting up a working SmartDNS solution on their end so the experience is not disrupted frequently.
As I said before, the M3U8 URL which was specified above is working correctly. 🙂 If you have a different URL that doesn’t work and this is not due to an inadequate VPN then please post it so I can have a look. Thank you.
Is it possible to change the location to which the mp4 files are recorded? If so, how should I modify the script?
Yes, you can save the files anywhere you want but you don’t need to modify the script. 🙂 Assuming you want to save the files in
/home/andrea/Videos/
you just have to change directory in the terminal before recording the video:Also, you could simply tweak the path of the output file (and its name, if you want to):
it looks like it does not work anymore, does it ?
It works, but you need to fix your VPN. You currently expose a French IP address.
Hi!
Thank you very much for the script, Andrea!
Only a little advice: in the latest
ffmpeg
versions (v3 or upper) the filter-bsf:a aac_adtstoasc
isn’t needed anymore, because it is added automatically if the program detect aMalformed AAC bitstream
.Also the flag
-qscale 0
isn’t needed anymore, becauseffmpeg
select automatically the better quality.I hope I’ve helped you.
Happy New Year!!
Hi Andrea,
Just FYI…
It worked perfectly on Linux Mint 18, with Firefox, and Unblock-us VPN.
I also downloaded the srt subs and worked fine playing with VLC.
By the way, I can’t download the same programme with iPlayer for Andriod, althought video streaming was ok… That’s why, searching how to download via my dektop I arrived here.
Great job!
Daniele, that’s good to know, thank you. For now I think I will keep those parameters there just in case someone uses an older version, but I hope to remove them soon.
Miquel, great! 😀
I’m using your script from within the UK. It works well, thank you. Because I do prefer to use an older version of ffmpeg, please don’t change the script (there are many excellent reasons for sticking with a specific build of ffmpeg that actually works). I’m writing to ask you to consider adding a note to your webpage: if the user alters the file extension on the command line (from .mp3 to some alternative), it is possible to download a different bitrate version. For example, with a radio show you can download a 128 kb/sec stream by changing the output file’s extension to .m4a or you can download a 384 kb/sec version by changing the extension to .ts (or go mad and download a 1,500 kb/sec version by changing the extension to .wav – then encode the file you get to any format, or any bitrate, or any sample rate you want).
That’s just a matter of
ffmpeg
presets, you can tweak the output bitrate with-b:a 320k
for instance. Anyway, selecting 1500kbps is kinda pointless if the original file is at say 256kbps. You’d just oversample the audio without any improvement.Hey Andrea,
thx a lot; seems to work just fine on MacOS 10.12.3 with ffmpeg 3.2.4 installed via Homebrew.
Cheers
Martin
@Lazza – But the BBC’s master stream is not 256 kbps. It’s 1,500 kbps. FFmpeg taps into their master .wav source file on the server, and merely requests a particular format. You can get the original .wav file if you so wish. My tests show that it is not simply oversampling a 384 or 256 kb/sec stream.
Yes, it could be on some radio shows. I haven’t tried many of them, when I use the script it’s usually for videos. Do you have any specific example?
Given that a lot of people would complain if the format were different from MP3 (“it doesn’t play in my car!”) I preferred to stick to MP3. But I might change in the future, it’s just not a priority right now due to my current workload.
@Lazza: http://www.bbc.co.uk/programmes/b00qyqd9
@Andrea: Today I installed v3.8 of the Firefox Add-on, in Firefox 39 (running on Windows 7). It doesn’t work: FFmpeg cannot download any BBC iPlayer on-demand radio streams. For example, the one I’ve referred Lazza to.
Version 3.6.3 of the script continues to work okay with iPlayer on-demand radio streams (in connecting to https://aod-hls-uk-live.akamaized.net); but v3.8 gets ‘connection refused’ (in trying to connect to https://aod-hls-uk-live.bbcfmt.hs.llnwd.net).
Well, that video has 3 audio streams: one “advertised” as 320kbps, but it really is 128kbps, another one at 128kbps (for real) and a third one at 48kbps. You can verify for yourself here:
I’m now starting to get really confused about who is this other Andrea you are talking about. 😛 Anyways, that was due to a fix used for programmes using the old domain. Now it should be working with version 3.8.1. In most cases, you will see only the 128kbps quality and not the 48kbps one, so there will be no dropdown menu. This shouldn’t be a problem, I hope.
Since a couple of days (maybe yesterday) no pop-up is showing. I tried Great American Railroad Journeys, but it does not work anymore. Any idea?
Thank you.
It’s not working with Cebeebies or CBBC, like: http://www.bbc.co.uk/iplayer/episode/b01n83tj/get-well-soon-1-take-a-break
or http://www.bbc.co.uk/iplayer/episode/b08p1m1w/4-oclock-club-series-6-10-flashmob
First of all – thanx a lot @Lazza for this great script and for maintaining it!
As @Erik says – same probleme here. 2 days before it still worked fine. Today – nope. Seems BBC modified their iPlayer. For instance they now play a trailer before every show. Until Tuesday I could download via JDownloader too, this also doesn’t work any more. This is wy I think BBC has changed something.
Correct. I confirm they did a major revamp of the layout and they also tweaked a bit the inner workings of the player. I am investigating the situation a bit and I will need some time to write a new version of the script.
@Lazza Great! I’m patiently looking forward to the new script version 🙂
@Lazza
Thank you for your hard work. These two pages have the same content, but your script doesn’t work with the first page. Can you handle it? Thank you.
http://www.bbc.co.uk/iplayer/episode/b052775d/a-timewatch-guide-series-1-2-cleopatra
http://www.bbc.co.uk/programmes/b052775d
I have published version 4.0. Please read the new instructions in the post carefully. You can see a list of tested pages here.
Unfortunately it doesn’t work for me. I installed version 4.0 and tested the URLs you checked and provided (http://www.bbc.co.uk/iplayer/episode/b01n83tj/get-well-soon-1-take-a-break – and the other ones). The box doesn’t show up under the iPlayer. I’m on a Win 7 Pro machine. I would be very thankful if you have any ideas what to do.