Repository: yt-dlp/yt-dlp

Issue:
Tencent video failed
### 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'm running yt-dlp version **2023.03.04** ([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 [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)
- [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

China

### Provide a description that is worded well enough to be understood

Tencent video cannot be extracted

### 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] 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
C:\Users\Administrator>yt-dlp -vU https://v.qq.com/x/cover/ei44lqqq0fsg5aq/m00294km8qz.html
[debug] Command-line config: ['-vU', 'https://v.qq.com/x/cover/ei44lqqq0fsg5aq/m00294km8qz.html']
[debug] Portable config "E:\Tencent\Mplayer\yt-dlp.conf": ['--output', 'E:\\Tencent\\N_m3u8DL-CLI\\Downloads\\%(title)s-%(section_number)s-%(section_title)s.%(ext)s', '--console-title', '--progress-template', 'download-title:%(info.id)s-%(progress.eta)s', '--merge-output-format', 'mp4', '--no-write-subs', '--external-downloader', 'aria2c', '--cookies-from-browser', 'edge', '--embed-thumbnail', '--embed-metadata']
[debug] Encodings: locale cp936, fs utf-8, pref cp936, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.03.04 [392389b7d] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19044-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 6.0-full_build-www.gyan.dev (setts), ffprobe 6.0-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[Cookies] Extracting cookies from edge
[debug] Extracting cookies from: "C:\Users\Administrator\AppData\Local\Microsoft\Edge\User Data\Default\Network\Cookies"
[debug] Found local state file at "C:\Users\Administrator\AppData\Local\Microsoft\Edge\User Data\Local State"
[Cookies] Extracted 559 cookies from edge
[debug] cookie version breakdown: {'v10': 559, 'other': 0, 'unencrypted': 0}
[debug] Proxy map: {}
[debug] Loaded 1786 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.03.04, Current version: stable@2023.03.04
Current Build Hash: 5590c57bd0433ed239a2deaaf92e2ad6f37fe50f53664c821575cafe106a9421
yt-dlp is up to date (stable@2023.03.04)
[vqq:video] Extracting URL: https://v.qq.com/x/cover/ei44lqqq0fsg5aq/m00294km8qz.html
[vqq:video] m00294km8qz: Downloading webpage
WARNING: [vqq:video] unable to extract pinia 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
ERROR: the JSON object must be str, bytes or bytearray, not NoneType
Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 1518, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1594, in __extract_info
  File "yt_dlp\extractor\common.py", line 694, in extract
  File "yt_dlp\extractor\tencent.py", line 232, in _real_extract
  File "yt_dlp\extractor\tencent.py", line 166, in _get_webpage_metadata
  File "yt_dlp\extractor\common.py", line 992, in _parse_json
  File "json\__init__.py", line 341, in loads
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
```



Discussion:
Looks like the page javascript changed somewhat:
```html
<script>window.__PINIA__={
```

We need to adjust our regex, and while we're at it, let's make metadata extraction actually non-fatal:
```diff
diff --git a/yt_dlp/extractor/tencent.py b/yt_dlp/extractor/tencent.py
index 42a2175b0..2aa4c4721 100644
--- a/yt_dlp/extractor/tencent.py
+++ b/yt_dlp/extractor/tencent.py
@@ -163,11 +163,9 @@ class VQQBaseIE(TencentBaseIE):
     _REFERER = 'v.qq.com'
 
     def _get_webpage_metadata(self, webpage, video_id):
-        return self._parse_json(
-            self._search_regex(
-                r'(?s)<script[^>]*>[^<]*window\.__pinia\s*=\s*([^<]+)</script>',
-                webpage, 'pinia data', fatal=False),
-            video_id, transform_source=js_to_json, fatal=False)
+        return self._search_json(
+            r'<script[^>]*>[^<]*window\.__(?:pinia|PINIA__)\s*=',
+            webpage, 'pinia data', video_id, transform_source=js_to_json, fatal=False)
 
 
 class VQQVideoIE(VQQBaseIE):
```
thank you
Test VQQVideo_2 is 404.

Resolving patch:
diff --git a/yt_dlp/extractor/tencent.py b/yt_dlp/extractor/tencent.py
--- a/yt_dlp/extractor/tencent.py
+++ b/yt_dlp/extractor/tencent.py
@@ -163,11 +163,9 @@ class VQQBaseIE(TencentBaseIE):
     _REFERER = 'v.qq.com'
 
     def _get_webpage_metadata(self, webpage, video_id):
-        return self._parse_json(
-            self._search_regex(
-                r'(?s)<script[^>]*>[^<]*window\.__pinia\s*=\s*([^<]+)</script>',
-                webpage, 'pinia data', fatal=False),
-            video_id, transform_source=js_to_json, fatal=False)
+        return self._search_json(
+            r'<script[^>]*>[^<]*window\.__(?:pinia|PINIA__)\s*=',
+            webpage, 'pinia data', video_id, transform_source=js_to_json, fatal=False)
 
 
 class VQQVideoIE(VQQBaseIE):
@@ -176,7 +174,7 @@ class VQQVideoIE(VQQBaseIE):
 
     _TESTS = [{
         'url': 'https://v.qq.com/x/page/q326831cny0.html',
-        'md5': '84568b3722e15e9cd023b5594558c4a7',
+        'md5': 'b11c9cb781df710d686b950376676e2a',
         'info_dict': {
             'id': 'q326831cny0',
             'ext': 'mp4',
@@ -187,7 +185,7 @@ class VQQVideoIE(VQQBaseIE):
         },
     }, {
         'url': 'https://v.qq.com/x/page/o3013za7cse.html',
-        'md5': 'cc431c4f9114a55643893c2c8ebf5592',
+        'md5': 'a1bcf42c6d28c189bd2fe2d468abb287',
         'info_dict': {
             'id': 'o3013za7cse',
             'ext': 'mp4',
@@ -208,6 +206,7 @@ class VQQVideoIE(VQQBaseIE):
             'series': '鸡毛飞上天',
             'format_id': r're:^shd',
         },
+        'skip': '404',
     }, {
         'url': 'https://v.qq.com/x/cover/mzc00200p29k31e/s0043cwsgj0.html',
         'md5': 'fadd10bf88aec3420f06f19ee1d24c5b',
@@ -220,6 +219,7 @@ class VQQVideoIE(VQQBaseIE):
             'series': '青年理工工作者生活研究所',
             'format_id': r're:^shd',
         },
+        'params': {'skip_download': 'm3u8'},
     }, {
         # Geo-restricted to China
         'url': 'https://v.qq.com/x/cover/mcv8hkc8zk8lnov/x0036x5qqsr.html',


Test patch: