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
132.32k stars 10.03k forks source link

RedbullTV specific file download issue #29648

Open codingforfun opened 3 years ago

codingforfun commented 3 years ago

Checklist

Verbose log

$ youtube-dl https://www.redbull.com/de-de/videos/a-line-across-the-sky-part-i-de-reel-rock-s2-e1 --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'https://www.redbull.com/de-de/videos/a-line-across-the-sky-part-i-de-reel-rock-s2-e1', u'--verbose']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.06.06
[debug] Python version 2.7.12 (CPython) - Linux-4.15.0-142-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: ffmpeg 4.3.2-0york0, ffprobe 4.3.2-0york0
[debug] Proxy map: {}
[RedBull] a-line-across-the-sky-part-i-de-reel-rock-s2-e1: Downloading JSON metadata
[RedBullEmbed] rrn:content:videos:1db7f3dd-6a6b-5950-8dd6-094d75b9c06d:de-INT: Downloading JSON metadata
[RedBullEmbed] AA-1UPEV4ZQ91W11: Downloading access token
[RedBullEmbed] AA-1UPEV4ZQ91W11: Downloading video information
ERROR: An extractor error has occurred. (caused by KeyError(u'error',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/redbulltv.py", line 147, in _real_extract
    return self.extract_info(asset_id)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/redbulltv.py", line 78, in extract_info
    e.cause.read().decode(), video_id)['error']
KeyError: u'error'
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 836, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 547, in extract
    raise ExtractorError('An extractor error has occurred.', cause=e)
ExtractorError: An extractor error has occurred. (caused by KeyError(u'error',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Description

The above error only occures with that specific file. YT-DL works well on other files of this site. Also the specific file could be played in browser.

SuperSonicHub1 commented 3 years ago

Looks like whoever hacked on this extractor didn't follow coding conventions and decided to directly access the 'error' key instead of using dict.get. Should be an easy fix.

SuperSonicHub1 commented 3 years ago

After fixing the coding mistake, this is my log:

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--simulate', '--verbose', 'https://www.redbull.com/de-de/videos/a-line-across-the-sky-part-i-de-reel-rock-s2-e1']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.06.06
[debug] Git HEAD: a80358271
[debug] Python version 3.7.3 (CPython) - Linux-5.4.109-26092-g9d947a4eeb73-x86_64-with-debian-10.8
[debug] exe versions: ffmpeg 4.1.6-1, ffprobe 4.1.6-1, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[RedBull] a-line-across-the-sky-part-i-de-reel-rock-s2-e1: Downloading JSON metadata
[RedBullEmbed] rrn:content:videos:1db7f3dd-6a6b-5950-8dd6-094d75b9c06d:de-INT: Downloading JSON metadata
[RedBullEmbed] AA-1UPEV4ZQ91W11: Downloading access token
[RedBullEmbed] AA-1UPEV4ZQ91W11: Downloading video information
ERROR: RedBullEmbed said: None
Traceback (most recent call last):
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/extractor/common.py", line 634, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/YoutubeDL.py", line 2288, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.7/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/extractor/redbulltv.py", line 73, in extract_info
    headers={'Authorization': token}
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/extractor/common.py", line 899, in _download_json
    expected_status=expected_status)
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/extractor/common.py", line 877, in _download_json_handle
    expected_status=expected_status)
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/extractor/common.py", line 667, in _download_webpage_handle
    urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query, expected_status=expected_status)
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/extractor/common.py", line 652, in _request_webpage
    raise ExtractorError(errmsg, sys.exc_info()[2], cause=err)
youtube_dl.utils.ExtractorError: Unable to download JSON metadata: HTTP Error 404: Not Found (caused by <HTTPError 404: 'Not Found'>); 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 "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/extractor/common.py", line 634, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/YoutubeDL.py", line 2288, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.7/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/extractor/redbulltv.py", line 73, in extract_info
    headers={'Authorization': token}
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/extractor/common.py", line 899, in _download_json
    expected_status=expected_status)
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/extractor/common.py", line 877, in _download_json_handle
    expected_status=expected_status)
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/extractor/common.py", line 667, in _download_webpage_handle
    urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query, expected_status=expected_status)
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/extractor/common.py", line 652, in _request_webpage
    raise ExtractorError(errmsg, sys.exc_info()[2], cause=err)
youtube_dl.utils.ExtractorError: Unable to download JSON metadata: HTTP Error 404: Not Found (caused by <HTTPError 404: 'Not Found'>); 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.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/YoutubeDL.py", line 836, in __extract_info
    ie_result = ie.extract(url)
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/extractor/redbulltv.py", line 147, in _real_extract
    return self.extract_info(asset_id)
  File "/home/kyleanthonywilliams2/youtube-dl/youtube_dl/extractor/redbulltv.py", line 80, in extract_info
    self.IE_NAME, error_message), expected=True)
youtube_dl.utils.ExtractorError: RedBullEmbed said: None