Repository: yt-dlp
Issue: Can't Download Live Programmes From iPlayer
Labels: geo-blocked,site-bug

### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2023.02.17** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

UK

### Provide a description that is worded well enough to be understood

Can you get a UK developer to look into this please. I’m unable to download an iPlayer Live programme from the "New & Trending" section at https://www.bbc.co.uk/iplayer
You'll see "Live" on a thumbnail there if a show is live.

Here’s my script:

```
-f ("bestvideo[width>=1920]"/bestvideo[ext=avc1])+bestaudio/best --embed-subs --sub-lang en --write-auto-sub --write-sub --convert-subs srt --ignore-errors --write-description --write-thumbnail --embed-thumbnail --merge-output-format mp4  --no-playlist ^
--output "L:/iPlayer/%%(title)s    UK iPlayer %%(height)sp %%(vcodec)s %%(acodec)s FPS %%(fps)s.%%(ext)s" ^ 
```

Get iPlayer will only download up to the live end of the show. So if it's only been live for 5 minutes then it will only download that 5 minutes, it won't continually download until the show has finished broadcasting on iPlayer. Once you fix yt-dlp will yt-dlp be able to continuously download until the live broadcast is over? This is a problem if it can't because I won't be able to download the live programme in full because once the live broadcast is finished the full programme isn't available to watch on iPlayer until 1 hour later or so.

While I'm here, on an unrelated issue, I'll be running an archive service in the future where I download all the videos from several popular political YouTube channels and if YouTube deletes those channels then I allow people to download them from my site. I'm trying to setup my downloader script to name the files how I want, etc. Would it be possible to get some more focused support such as via Discord (preferred), email or Github? Might need about 3 hours of your time. Would be happy to pay for this. I've tried paying coders on Fivrr but they were unsuccessful in doing what I wanted. Thanks

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['-U', '-vU']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8 (No VT), erro
r utf-8 (No VT), screen utf-8 (No VT)
[debug] yt-dlp version 2023.01.06 [6becd25] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-7-6.1.7601-SP1 (OpenSSL 1.
1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg N-65018-gad91bf8 (needs_adtstoasc), ffprobe N-65018
-gad91bf8
[debug] Optional libraries: Cryptodome-3.16.0, brotli-1.0.9, certifi-2022.12.07,
 mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1760 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releas
es/latest
Latest version: 2023.01.06, Current version: 2023.01.06
yt-dlp is up to date (2023.01.06)
Paste the video link to download: https://www.bbc.co.uk/iplayer/episode/l00568kn
/question-time-question-time
[debug] Command-line config: ['-f', '(bestvideo[width>=1920]/bestvideo[ext=avc1]
)+bestaudio/best', '--downloader', 'ffmpeg', '--embed-subs', '--sub-lang', 'en',
 '--write-auto-sub', '--write-sub', '--convert-subs', 'srt', '--ignore-errors',
'--write-description', '--write-thumbnail', '--embed-thumbnail', '--merge-output
-format', 'mp4', '-v', '--no-playlist', '--output', 'L:/iPlayer/%(title)s    UK
iPlayer %(height)sp %(vcodec)s %(acodec)s FPS %(fps)s.%(ext)s', 'https://www.bbc
.co.uk/iplayer/episode/l00568kn/question-time-question-time']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8 (No VT), erro
r utf-8 (No VT), screen utf-8 (No VT)
[debug] yt-dlp version 2023.01.06 [6becd25] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-7-6.1.7601-SP1 (OpenSSL 1.
1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg N-65018-gad91bf8 (needs_adtstoasc), ffprobe N-65018
-gad91bf8
[debug] Optional libraries: Cryptodome-3.16.0, brotli-1.0.9, certifi-2022.12.07,
 mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1760 extractors
[bbc.co.uk] Extracting URL: https://www.bbc.co.uk/iplayer/episode/l00568kn/quest
ion-time-question-time
[bbc.co.uk] l00568kn: Downloading video page
[bbc.co.uk] l00568kn: Downloading playlist JSON
ERROR: local variable 'programme_id' referenced before assignment
Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 1502, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1578, in __extract_info
  File "yt_dlp\extractor\common.py", line 680, in extract
  File "yt_dlp\extractor\bbc.py", line 576, in _real_extract
  File "yt_dlp\extractor\bbc.py", line 473, in _download_playlist
UnboundLocalError: local variable 'programme_id' referenced before assignment

Press any key to continue . . .
```