1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-16 22:37:35 +00:00

Improve regex

Co-authored-by: Roy <git@rvsit.nl>
This commit is contained in:
Bart Broere 2024-03-14 13:34:33 +01:00 committed by GitHub
parent d4250c8703
commit ad64f3751e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -307,7 +307,7 @@ class VPROIE(NPOIE):
def _real_extract(self, url):
video_id = url.rstrip('/').split('/')[-1]
page, _ = self._download_webpage_handle(url, video_id)
results = re.findall(r'data-media-id="(.+_.+)"\s', page)
results = re.findall(r'data-media-id="([a-zA-Z0-9_]+)"\s', page)
formats = []
for result in results:
formats.extend(self._extract_formats_by_product_id(result, video_id))