1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-26 02:37:41 +00:00

[instagram] Add support for iframe embeds

This commit is contained in:
Sergey M․ 2016-04-16 22:31:05 +06:00
parent 0dafea02e6
commit c23533a100
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D

View file

@ -45,6 +45,12 @@ class InstagramIE(InfoExtractor):
@staticmethod
def _extract_embed_url(webpage):
mobj = re.search(
r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?instagram\.com/p/[^/]+/embed.*?)\1',
webpage)
if mobj:
return mobj.group('url')
blockquote_el = get_element_by_attribute(
'class', 'instagram-media', webpage)
if blockquote_el is None: