Repository: yt-dlp
Issue: [ie/tv2] metadata and playback JSON URLs return HTTP Error 404: Not Found
Labels: 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 that yt-dlp is broken on a **supported** site
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [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)
- [ ] 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

Germany

### Provide a description that is worded well enough to be understood

Using even the `_TESTS` URLs, the TV2 extractor returns  404 on either the metadata JSON or the playback (or rather [sic] "playabck") JSON URLs.

Using the first `_TESTS` URL http://www.tv2.no/v/1791207/ passes the metadata download, but fails the playback download. If I use the page URL it redirects to in the browser, https://www.tv2.no/video/nyheter/her-kolliderer-romsonden-med-asteroiden/20083301, it fails the metadata already. (Note that the redirect has a different `video_id`.)

I did notice, when using the browser and checking what it does in its debug console, that some metadata containing the M3U8 URL is downloded from `https://tv2news.play.cf.eu-north-1-prod.vmnd.tv/api/v2/asset/{video_id}/play?contentType=application%2Fx-mpegurl`, but as a POST request which I can only reproduce using curl, and haven't managed to reproduce in yt-dlp's python code.


### Provide verbose output that clearly demonstrates the problem

- [X] 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
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['-vU', 'http://www.tv2.no/v/1791207/']
[debug] User config "/home/barsnick/.config/yt-dlp/config": ['-o', '%(title).200B [%(extractor)s %(id)s].%(ext)s', '--parse-metadata', 'title:\\d.+(views|reactions) \\| (?P<title>.+)']
[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@2024.12.23 from yt-dlp/yt-dlp [65cf46cdd] (source)
[debug] Lazy loading extractors is disabled                                                                            
[debug] Git HEAD: 0b6b7742c           
[debug] Python 3.13.1 (CPython x86_64 64bit) - Linux-6.12.6-200.fc41.x86_64-x86_64-with-glibc2.40 (OpenSSL 3.2.2 4 Jun 2024, glibc 2.40)
[debug] exe versions: ffmpeg 7.0.2 (setts), ffprobe 7.0.2, phantomjs 1.9.8
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2023.05.07, requests-2.32.3, secretstorage-3.3.3, sqlite3-3.46.1, urllib3-1.26.20, websockets-13.0.1
[debug] Proxy map: {}                                                                                                  
[debug] Request Handlers: urllib, requests, websockets                                                                 
[debug] Plugin directories: ['/home/barsnick/.config/yt-dlp/plugins/barsnick/yt_dlp_plugins']
[debug] Loaded 1837 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.12.23 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.12.23 from yt-dlp/yt-dlp) 
[debug] Using fake IP 84.210.172.100 (NO) as X-Forwarded-For
[TV2] Extracting URL: http://www.tv2.no/v/1791207/
[TV2] 1791207: Downloading metadata JSON
[TV2] 1791207: Downloading playabck JSON
ERROR: [TV2] 1791207: Unable to download JSON metadata: HTTP Error 404: Not Found (caused by <HTTPError 404: Not Found>)
  File "/home/barsnick/Development/yt-dlp/yt_dlp/extractor/common.py", line 742, in extract
    ie_result = self._real_extract(url)
  File "/home/barsnick/Development/yt-dlp/yt_dlp/extractor/tv2.py", line 55, in _real_extract
    data = self._download_json(f'https://api.sumo.tv2.no/play/{video_id}?stream={protocol}',
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                               video_id, 'Downloading playabck JSON',
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                               headers={'content-type': 'application/json'},
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                               data=b'{"device":{"id":"1-1-1","name":"Nettleser (HTML)"}}')['playback']
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/barsnick/Development/yt-dlp/yt_dlp/extractor/common.py", line 1152, in download_content
    res = getattr(self, download_handle.__name__)(url_or_request, video_id, **kwargs)
  File "/home/barsnick/Development/yt-dlp/yt_dlp/extractor/common.py", line 1112, in download_handle
    res = self._download_webpage_handle(
        url_or_request, video_id, note=note, errnote=errnote, fatal=fatal, encoding=encoding,
        data=data, headers=headers, query=query, expected_status=expected_status,
        impersonate=impersonate, require_impersonation=require_impersonation)
  File "/home/barsnick/Development/yt-dlp/yt_dlp/extractor/common.py", line 962, 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,
                                 impersonate=impersonate, require_impersonation=require_impersonation)
  File "/home/barsnick/Development/yt-dlp/yt_dlp/extractor/common.py", line 911, in _request_webpage
    raise ExtractorError(errmsg, cause=err)

  File "/home/barsnick/Development/yt-dlp/yt_dlp/extractor/common.py", line 898, in _request_webpage
    return self._downloader.urlopen(self._create_request(url_or_request, data, headers, query, extensions))
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/barsnick/Development/yt-dlp/yt_dlp/YoutubeDL.py", line 4172, in urlopen
    return self._request_director.send(req)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "/home/barsnick/Development/yt-dlp/yt_dlp/networking/common.py", line 117, in send
    response = handler.send(request)
  File "/home/barsnick/Development/yt-dlp/yt_dlp/networking/_helper.py", line 208, in wrapper
    return func(self, *args, **kwargs)
  File "/home/barsnick/Development/yt-dlp/yt_dlp/networking/common.py", line 340, in send
    return self._send(request)
           ~~~~~~~~~~^^^^^^^^^
  File "/home/barsnick/Development/yt-dlp/yt_dlp/networking/_requests.py", line 365, in _send
    raise HTTPError(res, redirect_loop=max_redirects_exceeded)
yt_dlp.networking.exceptions.HTTPError: HTTP Error 404: Not Found
```