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): def _real_extract(self, url):
video_id = url.rstrip('/').split('/')[-1] video_id = url.rstrip('/').split('/')[-1]
page, _ = self._download_webpage_handle(url, video_id) 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 = [] formats = []
for result in results: for result in results:
formats.extend(self._extract_formats_by_product_id(result, video_id)) formats.extend(self._extract_formats_by_product_id(result, video_id))