Repository: yt-dlp
Issue: [AmazonStore] download rented video error: "Unable to extract data" and "RegexNotFoundError"
Labels: DRM,site-bug

### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2022.09.01** ([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/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 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

California, USA

### Provide a description that is worded well enough to be understood

When trying to download a video I rented from Amazon, yt-dlp fails with an error (error message below).

I'm able to stream the video from browsers on the same machine I'm using yt-dlp. I've tried exporting cookies to a file (via an extension for chrome and firefox respectively) and using `--cookies-from-browser`, but both fail the same way.

I tried this first on Ubuntu 22.04 (using Chrome, Chromium, and Firefox), then on Mac OS 12.6 (using Safari 16 release 154 and Chrome 105.0.5195.125).

I also tried stripping some of the extra URL parameters from the video URL, but this also didn't help.

URLs:

- `https://www.amazon.com/gp/product/B07F6QK5QP/ref=ppx_yo_dt_b_d_asin_image_o00?ie=UTF8&psc=1`
- `https://www.amazon.com/gp/product/B07F6QK5QP`

A couple instances of sample verbose output is below.

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
### Mac OS, using cookies file and cleaned URL:

[17:23:55] catball@catbook-wired /Users/catball/Downloads [1] 
> sudo yt-dlp -vU --write-subs --cookies ~/Downloads/amazon.com_cookies.txt "https://www.amazon.com/gp/product/B07F6QK5QP"
[debug] Command-line config: ['-vU', '--write-subs', '--cookies', '/Users/catball/Downloads/amazon.com_cookies.txt', 'https://www.amazon.com/gp/product/B07F6QK5QP']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.09.01 [5d7c7d6] (pip)
[debug] Python 3.9.14 (CPython 64bit) - macOS-12.6-arm64-arm-64bit 
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 5.1.1 (setts), ffprobe 5.1.1, phantomjs 2.1.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Loaded 1670 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.09.01, Current version: 2022.09.01
yt-dlp is up to date (2022.09.01)
[debug] [AmazonStore] Extracting URL: https://www.amazon.com/gp/product/B07F6QK5QP
[AmazonStore] B07F6QK5QP: Downloading webpage
ERROR: [AmazonStore] B07F6QK5QP: Unable to extract data; 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 "/opt/homebrew/Cellar/yt-dlp/2022.9.1/libexec/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 670, in extract
    ie_result = self._real_extract(url)
  File "/opt/homebrew/Cellar/yt-dlp/2022.9.1/libexec/lib/python3.9/site-packages/yt_dlp/extractor/amazon.py", line 42, in _real_extract
    data_json = self._parse_json(self._html_search_regex(r'var\s?obj\s?=\s?jQuery\.parseJSON\(\'(.*)\'\)', webpage, 'data'), id)
  File "/opt/homebrew/Cellar/yt-dlp/2022.9.1/libexec/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 1258, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "/opt/homebrew/Cellar/yt-dlp/2022.9.1/libexec/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 1222, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)



### Mac OS, using cookies file and full URL:

[17:30:24] catball@catbook-wired /Users/catball/Downloads [1]
> sudo yt-dlp -v --write-subs --cookies ~/Downloads/amazon.com_cookies.txt "https://www.amazon.com/gp/product/B07F6QK5QP/ref=ppx_yo_dt_b_d_asin_image_o00?ie=UTF8&psc=1"
[debug] Command-line config: ['-v', '--write-subs', '--cookies', '/Users/catball/Downloads/amazon.com_cookies.txt', 'https://www.amazon.com/gp/product/B07F6QK5QP/ref=ppx_yo_dt_b_d_asin_image_o00?ie=UTF8&psc=1']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.09.01 [5d7c7d6] (pip)
[debug] Python 3.9.14 (CPython 64bit) - macOS-12.6-arm64-arm-64bit 
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 5.1.1 (setts), ffprobe 5.1.1, phantomjs 2.1.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Loaded 1670 extractors
[debug] [AmazonStore] Extracting URL: https://www.amazon.com/gp/product/B07F6QK5QP/ref=ppx_yo_dt_b_d_asin_image_o00?ie=UTF8&psc=1
[AmazonStore] B07F6QK5QP: Downloading webpage
ERROR: [AmazonStore] B07F6QK5QP: Unable to extract data; 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 "/opt/homebrew/Cellar/yt-dlp/2022.9.1/libexec/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 670, in extract
    ie_result = self._real_extract(url)
  File "/opt/homebrew/Cellar/yt-dlp/2022.9.1/libexec/lib/python3.9/site-packages/yt_dlp/extractor/amazon.py", line 42, in _real_extract
    data_json = self._parse_json(self._html_search_regex(r'var\s?obj\s?=\s?jQuery\.parseJSON\(\'(.*)\'\)', webpage, 'data'), id)
  File "/opt/homebrew/Cellar/yt-dlp/2022.9.1/libexec/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 1258, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "/opt/homebrew/Cellar/yt-dlp/2022.9.1/libexec/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 1222, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)



### Mac OS, using `cookies-from-browser=chrome` and full URL:

[17:31:16] catball@catbook-wired /Users/catball/Downloads [1] 
> sudo yt-dlp -v --write-subs --cookies-from-browser chrome "https://www.amazon.com/gp/product/B07F6QK5QP/ref=ppx_yo_dt_b_d_asin_image_o00?ie=UTF8&psc=1"
[debug] Command-line config: ['-v', '--write-subs', '--cookies-from-browser', 'chrome', 'https://www.amazon.com/gp/product/B07F6QK5QP/ref=ppx_yo_dt_b_d_asin_image_o00?ie=UTF8&psc=1']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.09.01 [5d7c7d6] (pip)
[debug] Python 3.9.14 (CPython 64bit) - macOS-12.6-arm64-arm-64bit 
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 5.1.1 (setts), ffprobe 5.1.1, phantomjs 2.1.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[Cookies] Extracting cookies from chrome
[debug] Extracting cookies from: "/Users/catball/Library/Application Support/Google/Chrome/Profile 11/Cookies"
[debug] using find-generic-password to obtain password from OSX keychain
[Cookies] Extracted 72 cookies from chrome
[debug] cookie version breakdown: {'v10': 72, 'other': 0, 'unencrypted': 0}
[debug] Proxy map: {}
[debug] Loaded 1670 extractors
[debug] [AmazonStore] Extracting URL: https://www.amazon.com/gp/product/B07F6QK5QP/ref=ppx_yo_dt_b_d_asin_image_o00?ie=UTF8&psc=1
[AmazonStore] B07F6QK5QP: Downloading webpage
ERROR: [AmazonStore] B07F6QK5QP: Unable to extract data; 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 "/opt/homebrew/Cellar/yt-dlp/2022.9.1/libexec/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 670, in extract
    ie_result = self._real_extract(url)
  File "/opt/homebrew/Cellar/yt-dlp/2022.9.1/libexec/lib/python3.9/site-packages/yt_dlp/extractor/amazon.py", line 42, in _real_extract
    data_json = self._parse_json(self._html_search_regex(r'var\s?obj\s?=\s?jQuery\.parseJSON\(\'(.*)\'\)', webpage, 'data'), id)
  File "/opt/homebrew/Cellar/yt-dlp/2022.9.1/libexec/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 1258, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "/opt/homebrew/Cellar/yt-dlp/2022.9.1/libexec/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 1222, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
```