mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 11:01:34 -05:00
[pbs] Simplify and speed up player URL search
This commit is contained in:
parent
472404953a
commit
0fa6b17dcc
1 changed files with 7 additions and 3 deletions
|
@ -191,9 +191,13 @@ def _extract_webpage(self, url):
|
||||||
if media_id:
|
if media_id:
|
||||||
return media_id, presumptive_id, upload_date
|
return media_id, presumptive_id, upload_date
|
||||||
|
|
||||||
url = self._search_regex(
|
for iframe in re.findall(r'(?s)<iframe(.+?)></iframe>', webpage):
|
||||||
r'(?s)<iframe[^>]+?(?:[a-z-]+?=["\'].*?["\'][^>]+?)*?\bsrc=["\']([^\'"]+partnerplayer[^\'"]+)["\']',
|
url = self._search_regex(
|
||||||
webpage, 'player URL')
|
r'src=(["\'])(?P<url>.+?partnerplayer.+?)\1', iframe,
|
||||||
|
'player URL', default=None, group='url')
|
||||||
|
if url:
|
||||||
|
break
|
||||||
|
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
|
|
||||||
player_id = mobj.group('player_id')
|
player_id = mobj.group('player_id')
|
||||||
|
|
Loading…
Reference in a new issue