Repository: yt-dlp
Issue: Fox: HTTP Error 410: Gone 
Labels: site-bug

### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2022.06.22.1** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [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/ytdl-org/youtube-dl#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 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)
- [X] 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

United States

### Description

Very odd behavior here. This is with the Fox extractor, which I previously updated and mostly works fine. A little background:

I have my own what is essentially a wrapper script for yt-dlp. It monitors various sources for new video content, and downloads it as it becomes available. One of those sources is Fox. When the script starts, it forms a queue of videos to download. If a Fox video is near the top of the queue (within the first ~4-5), it downloads without issue. However, once we get lower down, yt-dlp is unable to call the API in the process of obtaining the m3u8 URL, and instead receives a 410 Gone error. If I quit the script and restart it, and the Fox video is now at the top of the queue (as the others have been previously downloaded), there is no issue. It doesn't matter where the videos at the top come from—if they are all Fox videos, there will eventually be an error, if the first 5 videos are from ESPN or Paramount or something else, the Fox video will error. This issue doesn't occur with any other extractor used in my script, I can download 20 videos in a row from Paramount just fine, for example. Additionally, if I try to download Fox videos directly from the command line, outside of my script, I *never* see an error.

The only options I give yt-dlp are as follows. I only set `verbose = True` to track this bug, and `output` is a string that is predetermined by my script. These options are all related to downloading rather than extracting, so I doubt any of them will matter.

`ydl_opts = {'verbose': True, 'format': 'worst[height=720]', 'outtmpl': './' + output, 'hls_prefer_native': True, 'fragment_retries': 20, 'retries': 20, 'fixup': 'force'}`

Pated below is the verbose log of the error. I can update with the verbose log for the same video after quitting and restarting my script, to show that it does work there. My Python code is simply this, with `playlist_url` in this case being https://www.fox.com/watch/550a42bdcefcf39ec916296eb05941a8.

```
    with yt_dlp.YoutubeDL(ydl_opts) as ydl:
        result = ydl.download([playlist_url])
```

Note that the video is accessible in private browsing/incognito mode when visiting from a United States IP.

The only thing I can think of is that when I first call `import yt_dlp`, there are some settings loaded (such as a default header), then the Fox API server actually checks those settings and if it has been long enough since the initial import, they have expired. Just a hunch.

### Verbose log

```shell
[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 2022.06.22.1 [a86e01e]
[debug] Python version 3.9.2 (CPython 64bit) - Linux-5.10.0-12-amd64-x86_64-with-glibc2.31
[debug] exe versions: ffmpeg 4.4-static (setts), ffprobe 4.4-static
[debug] Optional libraries: Cryptodome-3.14.1, brotli-1.0.9, certifi-2022.05.18.1, mutagen-1.45.1, secretstorage-3.3.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[FOX] Downloading JSON metadata
[debug] [FOX] Extracting URL: https://www.fox.com/watch/550a42bdcefcf39ec916296eb05941a8
[FOX] 550a42bdcefcf39ec916296eb05941a8: Downloading JSON metadata
ERROR: [FOX] 550a42bdcefcf39ec916296eb05941a8: Unable to download JSON metadata: HTTP Error 410: Gone (caused by <HTTPError 410: 'Gone'>); 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/i/is/ischmidt/.local/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 647, in extract
    ie_result = self._real_extract(url)
  File "/home/i/is/ischmidt/.local/lib/python3.9/site-packages/yt_dlp/extractor/fox.py", line 95, in _real_extract
    self._access_token = self._call_api(
  File "/home/i/is/ischmidt/.local/lib/python3.9/site-packages/yt_dlp/extractor/fox.py", line 64, in _call_api
    return self._download_json(
  File "/home/i/is/ischmidt/.local/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 1001, in download_content
    res = getattr(self, download_handle.__name__)(url_or_request, video_id, **kwargs)
  File "/home/i/is/ischmidt/.local/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 965, in download_handle
    res = self._download_webpage_handle(
  File "/home/i/is/ischmidt/.local/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 833, 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/i/is/ischmidt/.local/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 790, in _request_webpage
    raise ExtractorError(errmsg, cause=err)

  File "/home/i/is/ischmidt/.local/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 772, in _request_webpage
    return self._downloader.urlopen(self._create_request(url_or_request, data, headers, query))
  File "/home/i/is/ischmidt/.local/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line 3594, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.9/urllib/request.py", line 523, in open
    response = meth(req, response)
  File "/usr/lib/python3.9/urllib/request.py", line 632, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.9/urllib/request.py", line 561, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.9/urllib/request.py", line 641, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 410: Gone
```