yt-dlp: [DRTV] Unable to download JSON metadata: HTTP Error 404 (dr.dk)

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

Denmark

Provide a description that is worded well enough to be understood

Downloading from “https://www.dr.dk/drtv/tv-guide” (Supported site “DRTV”) was no problem 3 days ago. Since then, attempts to download previous broadcasts have resulted in the following error:

Unable to download JSON metadata: HTTP Error 404: Not Found (caused by <HTTPError 404: Not Found>)

A test can be done with this url: yt-dlp.exe “https://www.dr.dk/drtv/se/alene-i-vildmarken_-opfindsomme-shelters_169521

Downloading something from “https://www.dr.dk/drtv/tv-guide” 5 minutes after a direct transmission ends is no problem. I think that the transmission then is transcoded into different formats, and these transcoded formats can no longer be downloaded because of a missing JSON.

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

yt-dlp.exe -vU "https://www.dr.dk/drtv/se/alene-i-vildmarken_-opfindsomme-shelters_169521"
[debug] Command-line config: ['-vU', 'https://www.dr.dk/drtv/se/alene-i-vildmarken_-opfindsomme-shelters_169521']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2023.10.04.180415 [b095fd3fa] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.22621-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 2022-03-07-git-e645a1ddb9-essentials_build-www.gyan.dev (setts), ffprobe 2022-03-07-git-e645a1ddb9-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.19.0, brotli-1.1.0, certifi-2023.07.22, mutagen-1.47.0, sqlite3-3.35.5, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1886 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Available version: nightly@2023.10.04.180415, Current version: nightly@2023.10.04.180415
Current Build Hash: 00fc0b80ab8bf1f1d3acc7002a6f078bb0574f63e6a6e2dcf18d82e736c9f482
yt-dlp is up to date (nightly@2023.10.04.180415)
[drtv] Extracting URL: https://www.dr.dk/drtv/se/alene-i-vildmarken_-opfindsomme-shelters_169521
[drtv] alene-i-vildmarken_-opfindsomme-shelters_169521: Downloading webpage
[drtv] 00922000810: Downloading video JSON
ERROR: [drtv] alene-i-vildmarken_-opfindsomme-shelters_169521: Unable to download JSON metadata: HTTP Error 404: Not Found (caused by <HTTPError 404: Not Found>); 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 "yt_dlp\extractor\common.py", line 715, in extract
  File "yt_dlp\extractor\drtv.py", line 203, in _real_extract
  File "yt_dlp\extractor\common.py", line 1069, in download_content
  File "yt_dlp\extractor\common.py", line 1033, in download_handle
  File "yt_dlp\extractor\common.py", line 903, in _download_webpage_handle
  File "yt_dlp\extractor\common.py", line 860, in _request_webpage

  File "yt_dlp\networking\_urllib.py", line 410, in _send
  File "urllib\request.py", line 531, in open
  File "urllib\request.py", line 640, in http_response
  File "urllib\request.py", line 569, in error
  File "urllib\request.py", line 502, in _call_chain
  File "urllib\request.py", line 649, in http_error_default
urllib.error.HTTPError: HTTP Error 404: Not Found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 4051, in urlopen
  File "yt_dlp\networking\common.py", line 114, in send
  File "yt_dlp\networking\_helper.py", line 204, in wrapper
  File "yt_dlp\networking\common.py", line 325, in send
  File "yt_dlp\networking\_urllib.py", line 415, in _send
yt_dlp.networking.exceptions.HTTPError: HTTP Error 404: Not Found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "yt_dlp\extractor\common.py", line 847, in _request_webpage
  File "yt_dlp\YoutubeDL.py", line 4070, in urlopen
yt_dlp.networking.exceptions._CompatHTTPError: HTTP Error 404: Not Found

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Reactions: 5
  • Comments: 17 (4 by maintainers)

Commits related to this issue

Most upvoted comments

I am close to finalizing my work to fix the DRTV extractor in PR #8484 and hope to have it ready soon.

The extractor still needs to be fixed in this project. I was only linking the upstream issue to share information. Reopening

@garret1317 regarding the tag: drtv may be geoblocked from abroad, but the problem is also present when trying to download from Denmark.

On Linux the verbose output is:

[debug] User config "/home/freddy/.config/yt-dlp/config": ['--paths', '~/Videos/youtube-dl', '--output', '%(title)s.%(upload_date)s.%(vcodec)s.%(acodec)s.%(autonumber)02d.%(ext)s', '--restrict-filenames', '--all-subs', '--embed-subs', '--embed-metadata', '--no-overwrites', '--no-playlist', '--min-sleep-interval', '1', '--max-sleep-interval', '2', '--concurrent-fragments', '4']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8 (No ANSI), error utf-8 (No ANSI), screen utf-8 (No ANSI)
[debug] yt-dlp version stable@2023.10.07 [377e85a17] (zip)
[debug] Python 3.11.5 (CPython x86_64 64bit) - Linux-6.1.55-1-MANJARO-x86_64-with-glibc2.38 (OpenSSL 3.1.3 19 Sep 2023, glibc 2.38)
[debug] exe versions: ffmpeg 6.0 (setts), ffprobe 6.0
[debug] Optional libraries: certifi-2023.07.22, sqlite3-3.43.1
[debug] Proxy map: {}
[debug] Loaded 1886 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.10.07, Current version: stable@2023.10.07
Current Build Hash: 47743cde1f66f16f8ef8440b78171877122b1277f906dbebfb7d49fb4c64ab0b
yt-dlp is up to date (stable@2023.10.07)
[drtv] Extracting URL: https://www.dr.dk/drtv/se/alene-i-vildmarken_-opfindsomme-shelters_169521
[drtv] alene-i-vildmarken_-opfindsomme-shelters_169521: Downloading webpage
[drtv] 00922000810: Downloading video JSON
ERROR: [drtv] alene-i-vildmarken_-opfindsomme-shelters_169521: Unable to download JSON metadata: HTTP Error 404: Not Found (caused by <HTTPError 404: Not Found>); 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 "/home/freddy/bin/yt-dlp/yt_dlp/extractor/common.py", line 715, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/freddy/bin/yt-dlp/yt_dlp/extractor/drtv.py", line 203, in _real_extract
    data = self._download_json(
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/freddy/bin/yt-dlp/yt_dlp/extractor/common.py", line 1069, in download_content
    res = getattr(self, download_handle.__name__)(url_or_request, video_id, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/freddy/bin/yt-dlp/yt_dlp/extractor/common.py", line 1033, in download_handle
    res = self._download_webpage_handle(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/freddy/bin/yt-dlp/yt_dlp/extractor/common.py", line 903, 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/freddy/bin/yt-dlp/yt_dlp/extractor/common.py", line 860, in _request_webpage
    raise ExtractorError(errmsg, cause=err)

  File "/home/freddy/bin/yt-dlp/yt_dlp/networking/_urllib.py", line 410, in _send
    res = opener.open(urllib_req, timeout=float(request.extensions.get('timeout') or self.timeout))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 525, in open
    response = meth(req, response)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 634, in http_response
    response = self.parent.error(
               ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 563, in error
    return self._call_chain(*args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/freddy/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 4051, in urlopen
    return self._request_director.send(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/freddy/bin/yt-dlp/yt_dlp/networking/common.py", line 114, in send
    response = handler.send(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/freddy/bin/yt-dlp/yt_dlp/networking/_helper.py", line 204, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/freddy/bin/yt-dlp/yt_dlp/networking/common.py", line 325, in send
    return self._send(request)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/freddy/bin/yt-dlp/yt_dlp/networking/_urllib.py", line 415, in _send
    raise HTTPError(UrllibResponseAdapter(e.fp), redirect_loop='redirect error' in str(e)) from e
yt_dlp.networking.exceptions.HTTPError: HTTP Error 404: Not Found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/freddy/bin/yt-dlp/yt_dlp/extractor/common.py", line 847, in _request_webpage
    return self._downloader.urlopen(self._create_request(url_or_request, data, headers, query))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/freddy/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 4070, in urlopen
    raise _CompatHTTPError(e) from e
yt_dlp.networking.exceptions._CompatHTTPError: HTTP Error 404: Not Found

It has nothing to do with geo-restrictions. DRTV has changed the way the site works, which has coursed problems - not only for yt-dlp but also for similar programs like for example TV4ever.

I’m pretty sure the content that isn’t geo-restricted has the same problem. For example: https://www.dr.dk/drtv/episode/explainer_-hvordan-fjerner-man-co2-fra-luften_409062