ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.87k stars 10k forks source link

[Kaltura] Folketinget ft.dk #30647

Open MsVibe opened 2 years ago

MsVibe commented 2 years ago

Checklist

Verbose log


youtube-dl --get-url --verbose https://www.ft.dk/da/aktuelt/tv-fra-folketinget/tv_kanalen_folketinget
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--get-url', '--verbose', 'https://www.ft.dk/da/aktuelt/tv-fra-folketinget/tv_kanalen_folketinget']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.01.17
[debug] Python version 3.7.3 (CPython) - Linux-5.10.63+-armv6l-with-debian-10.11
[debug] exe versions: ffmpeg 4.1.8-0, ffprobe 4.1.8-0, phantomjs ., rtmpdump 2.4
[debug] Proxy map: {}
WARNING: Falling back on generic information extractor.
ERROR: An extractor error has occurred. (caused by KeyError('dataUrl')); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/youtube_dl/extractor/common.py", line 508, in extract
    ie_result = self._real_extract(url)
  File "/usr/lib/python3/dist-packages/youtube_dl/extractor/kaltura.py", line 283, in _real_extract
    data_url = info['dataUrl']
KeyError: 'dataUrl'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/youtube_dl/extractor/common.py", line 508, in extract
    ie_result = self._real_extract(url)
  File "/usr/lib/python3/dist-packages/youtube_dl/extractor/kaltura.py", line 283, in _real_extract
    data_url = info['dataUrl']
KeyError: 'dataUrl'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 793, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python3/dist-packages/youtube_dl/extractor/common.py", line 521, in extract
    raise ExtractorError('An extractor error has occurred.', cause=e)
youtube_dl.utils.ExtractorError: An extractor error has occurred. (caused by KeyError('dataUrl')); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Description

Folketinget TV - Danish parliament

dirkf commented 2 years ago

This page gives the Kaltura media item with partner ID 2158211 and entry ID 1_24gfa7qq. The item is a KalturaLiveStreamEntry, for which there is no dataUrl. The Kaltura extractor doesn't expect this, presumably because it does not support live streams.

The extractor needs also to ask for the liveStreamConfigurations field when calling the Kaltura API. When a live stream is found (ie with objectType KalturaLiveStreamEntry'), the extractor should set the is_live metadata field to True and get the formats from the entries in info['liveStreamConfigurations'], which looks like this:

    [
       {
          'protocol': 'hds',
          'url': 'https://cdnapi.kaltura.com/p/2158211/sp/215821100/playManifest/entryId/1_24gfa7qq/protocol/https/format/hds/a.f4m',
          'publishUrl': null
        },
        {
          'protocol': 'hls',
          'url': 'https://cdnapi.kaltura.com/p/2158211/sp/215821100/playManifest/entryId/1_24gfa7qq/protocol/https/format/applehttp/a.m3u8',
          'publishUrl': null
        },
        {
          'protocol': 'applehttp',
          'url': 'https://cdnapi.kaltura.com/p/2158211/sp/215821100/playManifest/entryId/1_24gfa7qq/protocol/https/format/applehttp/a.m3u8',
          'publishUrl': null
        },
...
    ]

With a few changes on these lines I was able to watch some politicians in open-necked shirts discussing foreign policy. A proper PR is needed; meanwhile you can use the M3U8 URL above.

MsVibe commented 2 years ago

Thank you very much