1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-26 18:34:32 +01:00

[pbs] Simplify and speed up player URL search

This commit is contained in:
Sergey M․ 2015-11-06 23:45:26 +06:00
parent 472404953a
commit 0fa6b17dcc

View File

@ -191,9 +191,13 @@ class PBSIE(InfoExtractor):
if media_id: if media_id:
return media_id, presumptive_id, upload_date return media_id, presumptive_id, upload_date
for iframe in re.findall(r'(?s)<iframe(.+?)></iframe>', webpage):
url = self._search_regex( url = self._search_regex(
r'(?s)<iframe[^>]+?(?:[a-z-]+?=["\'].*?["\'][^>]+?)*?\bsrc=["\']([^\'"]+partnerplayer[^\'"]+)["\']', r'src=(["\'])(?P<url>.+?partnerplayer.+?)\1', iframe,
webpage, 'player URL') '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')