mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-03 09:40:30 +00:00
[utils] change extract_attributes to work in python 2
This commit is contained in:
parent
c01e1a96aa
commit
9550ca506f
@ -383,8 +383,7 @@ def _extract_url(webpage):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
account_id, player_id, embed, video_id = re.match(self._VALID_URL, url).groups()
|
||||||
account_id, player_id, embed, video_id = mobj.groups()
|
|
||||||
|
|
||||||
webpage = self._download_webpage('http://players.brightcove.net/%s/%s_%s/index.min.js' % (account_id, player_id, embed), video_id)
|
webpage = self._download_webpage('http://players.brightcove.net/%s/%s_%s/index.min.js' % (account_id, player_id, embed), video_id)
|
||||||
|
|
||||||
|
@ -252,7 +252,8 @@ def extract_attributes(attributes_str, attributes_regex=r'(?s)\s*([^\s=]+)\s*=\s
|
|||||||
attributes = re.findall(attributes_regex, attributes_str)
|
attributes = re.findall(attributes_regex, attributes_str)
|
||||||
attributes_dict = {}
|
attributes_dict = {}
|
||||||
if attributes:
|
if attributes:
|
||||||
attributes_dict = {attribute_name: attribute_value for (attribute_name, attribute_value) in attributes}
|
for (attribute_name, attribute_value) in attributes:
|
||||||
|
attributes_dict[attribute_name] = attribute_value
|
||||||
return attributes_dict
|
return attributes_dict
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user