Repository: yt-dlp/yt-dlp

Issue:
[VQQ] Partially broken extractor
### 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.10.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 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

USA

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

In the first days of the extractor release everything worked properly, after a few days the VIP content was no longer unlocked with cookies and qualities above 720p are also no longer available with an active subscription.

Trying to access VIP content with cookies causes an error in the extractor, using CN proxy also causes the same error, even in unrestricted content.

1080p+ quality is also no longer available when using cookies on unrestricted content.

### 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
[debug] Command-line config: ['-vU', '--cookies', 'cookies/tencent.txt', '--ffmpeg-location', './ffmpeg', 'https://v.qq.com/x/cover/7ce5noezvafma27/f00266j58tv.html']
[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.10.04 [4e0511f27]
[debug] Lazy loading extractors is disabled
[debug] Plugins: ['SamplePluginIE', 'SamplePluginPP']
[debug] Python 3.8.10 (CPython 64bit) - Linux-5.4.0-122-generic-x86_64-with-glibc2.29 (glibc 2.31)
[debug] Checking exe version: ./ffmpeg -bsfs
[debug] Checking exe version: /www/wwwroot/github/ffprobe -bsfs
[debug] exe versions: ffmpeg 4.4.1-static (setts), ffprobe 4.4.1-static, phantomjs 2.1.1
[debug] Optional libraries: Cryptodome-3.15.0, certifi-2019.11.28, sqlite3-2.6.0
[debug] Proxy map: {}
[debug] Loaded 1697 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.10.04, Current version: 2022.10.04
yt-dlp is up to date (2022.10.04)
[debug] [vqq:video] Extracting URL: https://v.qq.com/x/cover/7ce5noezvafma27/f00266j58tv.html
[vqq:video] f00266j58tv: Downloading webpage
[vqq:video] f00266j58tv: Downloading webpage
ERROR: f00266j58tv: An extractor error has occurred. (caused by KeyError('fvkey')); 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 "/www/wwwroot/github/builds/yt-dlp/yt_dlp/extractor/common.py", line 672, in extract
    ie_result = self._real_extract(url)
  File "/www/wwwroot/github/builds/yt-dlp/yt_dlp/extractor/tencent.py", line 197, in _real_extract
    formats, subtitles = self._extract_all_video_formats_and_subtitles(url, video_id, series_id)
  File "/www/wwwroot/github/builds/yt-dlp/yt_dlp/extractor/tencent.py", line 112, in _extract_all_video_formats_and_subtitles
    fmts, subs = self._extract_video_formats_and_subtitles(api_response, video_id)
  File "/www/wwwroot/github/builds/yt-dlp/yt_dlp/extractor/tencent.py", line 80, in _extract_video_formats_and_subtitles
    'url': f'{video_format["url"]}{video_response["fn"]}?vkey={video_response["fvkey"]}',
KeyError: 'fvkey'
```



Discussion:
 Can you try using --cookies-from-browser ?
 
 In any case, if you can share your account this is my email: elyse0@proton.me
Yes, I tried, the result is the same, the cookie stored in the file was fresh too, from a few seconds ago.

I will contact you via e-mail.

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
@@ -67,9 +67,10 @@ def _extract_video_formats_and_subtitles(self, api_response, video_id):
 
         formats, subtitles = [], {}
         for video_format in video_response['ul']['ui']:
-            if video_format.get('hls'):
+            if video_format.get('hls') or determine_ext(video_format['url']) == 'm3u8':
                 fmts, subs = self._extract_m3u8_formats_and_subtitles(
-                    video_format['url'] + video_format['hls']['pt'], video_id, 'mp4', fatal=False)
+                    video_format['url'] + traverse_obj(video_format, ('hls', 'pt'), default=''),
+                    video_id, 'mp4', fatal=False)
                 for f in fmts:
                     f.update({'width': video_width, 'height': video_height})
 
@@ -187,6 +188,10 @@ class VQQVideoIE(VQQBaseIE):
             'thumbnail': r're:^https?://[^?#]+s0043cwsgj0',
             'series': '青年理工工作者生活研究所',
         },
+    }, {
+        # Geo-restricted to China
+        'url': 'https://v.qq.com/x/cover/mcv8hkc8zk8lnov/x0036x5qqsr.html',
+        'only_matching': True,
     }]
 
     def _real_extract(self, url):


Test patch: