Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Download Live Programmes From iPlayer #6332

Open
10 tasks done
holygamer opened this issue Feb 23, 2023 · 3 comments
Open
10 tasks done

Can't Download Live Programmes From iPlayer #6332

holygamer opened this issue Feb 23, 2023 · 3 comments
Labels
geo-blocked Content is geo-blocked site-bug Issue with a specific website

Comments

@holygamer
Copy link

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

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

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

Complete Verbose Output

[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 . . .
@holygamer holygamer added site-bug Issue with a specific website triage Untriaged issue labels Feb 23, 2023
@bashonly bashonly added geo-blocked Content is geo-blocked and removed triage Untriaged issue labels Feb 23, 2023
@jucor
Copy link
Contributor

jucor commented Feb 24, 2024

Similar problem here:

$ yt-dlp -F --live-from-start https://www.bbc.co.uk/iplayer/live/bbcone
[bbc] Extracting URL: https://www.bbc.co.uk/iplayer/live/bbcone
[bbc] bbcone: Downloading webpage
ERROR: [bbc] bbcone: Unable to extract playlist data; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
julien@Juliens-MacBook-Pro:ENG-SCO$ yt-dlp -vU --live-from-start https://www.bbc.co.uk/iplayer/live/bbcone
[debug] Command-line config: ['-vU', '--live-from-start', 'https://www.bbc.co.uk/iplayer/live/bbcone']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.12.30 from yt-dlp/yt-dlp [f10589e34] (pip)
[debug] Python 3.12.2 (CPython arm64 64bit) - macOS-14.3.1-arm64-arm-64bit (OpenSSL 3.2.1 30 Jan 2024)
[debug] exe versions: ffmpeg 6.1.1 (setts), ffprobe 6.1.1
[debug] Optional libraries: Cryptodome-3.19.1, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, sqlite3-3.45.1, urllib3-2.1.0, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1798 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2023.12.30 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2023.12.30 from yt-dlp/yt-dlp)
[bbc] Extracting URL: https://www.bbc.co.uk/iplayer/live/bbcone
[bbc] bbcone: Downloading webpage
ERROR: [bbc] bbcone: Unable to extract playlist data; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "/opt/homebrew/Cellar/yt-dlp/2023.12.30/libexec/lib/python3.12/site-packages/yt_dlp/extractor/common.py", line 718, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/yt-dlp/2023.12.30/libexec/lib/python3.12/site-packages/yt_dlp/extractor/bbc.py", line 1291, in _real_extract
    self._search_regex(
  File "/opt/homebrew/Cellar/yt-dlp/2023.12.30/libexec/lib/python3.12/site-packages/yt_dlp/extractor/common.py", line 1266, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)

@jucor
Copy link
Contributor

jucor commented Feb 24, 2024

And with another URL:

$ yt-dlp -vU --live-from-start https://www.bbc.co.uk/iplayer/episode/m001wssq/six-nations-rugby-2024-scotland-v-england
[debug] Command-line config: ['-vU', '--live-from-start', 'https://www.bbc.co.uk/iplayer/episode/m001wssq/six-nations-rugby-2024-scotland-v-england']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.12.30 from yt-dlp/yt-dlp [f10589e34] (pip)
[debug] Python 3.12.2 (CPython arm64 64bit) - macOS-14.3.1-arm64-arm-64bit (OpenSSL 3.2.1 30 Jan 2024)
[debug] exe versions: ffmpeg 6.1.1 (setts), ffprobe 6.1.1
[debug] Optional libraries: Cryptodome-3.19.1, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, sqlite3-3.45.1, urllib3-2.1.0, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1798 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2023.12.30 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2023.12.30 from yt-dlp/yt-dlp)
[bbc.co.uk] Extracting URL: https://www.bbc.co.uk/iplayer/episode/m001wssq/six-nations-rugby-2024-scotland-v-england
[bbc.co.uk] m001wssq: Downloading video page
[bbc.co.uk] m001wssq: Downloading playlist JSON
ERROR: cannot access local variable 'programme_id' where it is not associated with a value
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/yt-dlp/2023.12.30/libexec/lib/python3.12/site-packages/yt_dlp/YoutubeDL.py", line 1587, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/yt-dlp/2023.12.30/libexec/lib/python3.12/site-packages/yt_dlp/YoutubeDL.py", line 1722, in __extract_info
    ie_result = ie.extract(url)
                ^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/yt-dlp/2023.12.30/libexec/lib/python3.12/site-packages/yt_dlp/extractor/common.py", line 718, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/yt-dlp/2023.12.30/libexec/lib/python3.12/site-packages/yt_dlp/extractor/bbc.py", line 572, in _real_extract
    programme_id, title, description, duration, formats, subtitles = self._download_playlist(group_id)
                                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/yt-dlp/2023.12.30/libexec/lib/python3.12/site-packages/yt_dlp/extractor/bbc.py", line 469, in _download_playlist
    return programme_id, title, description, duration, formats, subtitles
           ^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'programme_id' where it is not associated with a value

@dirkf
Copy link
Contributor

dirkf commented Feb 24, 2024

The current BBC extractor pre-dates --live-from-start so there's no reason it should work. If someone can explain what the extractor needs to do to support this, I'll try to get the necessary features into the much delayed upstream extractor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
geo-blocked Content is geo-blocked site-bug Issue with a specific website
Projects
None yet
Development

No branches or pull requests

4 participants