1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-02-03 14:03:11 +08:00

[Generic] CondeNast data-url embed, with test

URL already supported in CondeNastIE, just needed a tweak to the
GenericIE hook.
This commit is contained in:
John Hawkinson 2017-04-09 22:53:02 -04:00
parent b41be55155
commit e3ea5c7eb9

View File

@ -732,7 +732,7 @@ class GenericIE(InfoExtractor):
'Forbidden'
]
},
# Condé Nast embed
# Condé Nast iframe embed
{
'url': 'http://www.wired.com/2014/04/honda-asimo/',
'md5': 'ba0dfe966fa007657bd1443ee672db0f',
@ -746,6 +746,20 @@ class GenericIE(InfoExtractor):
},
'add_ie': ['CondeNast'],
},
# Condé Nast embed <div data-url="...">
{
'url': 'http://www.vanityfair.com/hollywood/2017/04/chris-evans-gifted-movie-captain-america-video',
'md5': '07e1618750fa14b573c5d1bf6ff01429',
'info_dict': {
'id': '58e54e8dfd2e615252000010',
'ext': 'mp4',
'timestamp': 1491472800,
'uploader': 'vanityfair',
'title': 'Chris Evans Answers Kids Questions About The Universe',
'upload_date': '20170406',
},
'add_ie': ['CondeNast'],
},
# Dailymotion embed
{
'url': 'http://www.spi0n.com/zap-spi0n-com-n216/',
@ -2403,7 +2417,7 @@ class GenericIE(InfoExtractor):
return self.url_result(mobj.group('url'), 'MLB')
mobj = re.search(
r'<(?:iframe|script)[^>]+?src=(["\'])(?P<url>%s)\1' % CondeNastIE.EMBED_URL,
r'<(?:iframe|script|div)[^>]+?(?:src|data-url)=(["\'])(?P<url>%s)\1' % CondeNastIE.EMBED_URL,
webpage)
if mobj is not None:
return self.url_result(self._proto_relative_url(mobj.group('url'), scheme='http:'), 'CondeNast')