From 887a94c7ffcad6d07781ee720e3834c6422df3b6 Mon Sep 17 00:00:00 2001 From: bashonly Date: Mon, 2 Dec 2024 20:37:38 -0600 Subject: [PATCH] [ie/vk:uservideos] Fix `_VALID_URL` Authored by: bashonly --- yt_dlp/extractor/vk.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/vk.py b/yt_dlp/extractor/vk.py index 77f65238a9..05876aa80a 100644 --- a/yt_dlp/extractor/vk.py +++ b/yt_dlp/extractor/vk.py @@ -517,7 +517,11 @@ class VKIE(VKBaseIE): class VKUserVideosIE(VKBaseIE): IE_NAME = 'vk:uservideos' IE_DESC = "VK - User's Videos" - _VALID_URL = r'https?://(?:(?:m|new)\.)?vk(?:video\.ru|\.com/video)/(?:playlist/)?(?P[^?$#/&]+)(?!\?.*\bz=video)(?:[/?#&](?:.*?\bsection=(?P
\w+))?|$)' + _BASE_REGEX = r'https?://(?:(?:m|new)\.)?vk(?:video\.ru|\.com/video)' + _VALID_URL = [ + rf'{_BASE_REGEX}/playlist/(?P-?\d+_\d+)', + rf'{_BASE_REGEX}/(?P@[^/?#]+)(?:/all)?/?(?!\?.*\bz=video)(?:[?#]|$)', + ] _TEMPLATE_URL = 'https://vk.com/videos' _TESTS = [{ 'url': 'https://vk.com/video/@mobidevices', @@ -538,9 +542,16 @@ class VKUserVideosIE(VKBaseIE): 'title': 'Анонсы', }, 'playlist_mincount': 108, + 'skip': 'Redirects to main page', + }, { + 'url': 'https://vk.com/video/@gorkyfilmstudio/all', + 'only_matching': True, }, { 'url': 'https://vkvideo.ru/@mobidevices', 'only_matching': True, + }, { + 'url': 'https://vkvideo.ru/playlist/-204353299_426', + 'only_matching': True, }] _VIDEO = collections.namedtuple('Video', ['owner_id', 'id'])