mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-07-05 20:41:47 -07:00
Take the first result without breaking from a loop
Co-authored-by: dirkf <fieldhouse@gmx.net>
This commit is contained in:
parent
35857bf76b
commit
86118717af
1 changed files with 3 additions and 5 deletions
|
@ -357,11 +357,9 @@ class VPROIE(NPOIE):
|
|||
def _real_extract(self, url):
|
||||
video_id = url.rstrip('/').split('/')[-1]
|
||||
page = self._download_webpage(url, video_id)
|
||||
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))
|
||||
break
|
||||
format = traverse_obj(re.search(r'data-media-id="([a-zA-Z0-9_]+)"\s', page), (
|
||||
1, T(lambda x: self._extract_formats_by_product_id(x, video_id)),
|
||||
Ellipsis))
|
||||
|
||||
self._sort_formats(formats)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue