diff options
author | Sergey M․ <dstftw@gmail.com> | 2016-04-16 22:31:05 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-04-16 22:31:05 +0600 |
commit | c23533a100eb0a383b60ed2e5990602e9318fe4b (patch) | |
tree | b8dc4e329731315b5181a8781ebe77f79afd30eb /youtube_dl/extractor | |
parent | 0dafea02e6644053b6db6603238827176f6c6f3e (diff) |
[instagram] Add support for iframe embeds
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/instagram.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube_dl/extractor/instagram.py b/youtube_dl/extractor/instagram.py index 3a5dd14e6..3cbe77ad8 100644 --- a/youtube_dl/extractor/instagram.py +++ b/youtube_dl/extractor/instagram.py @@ -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: |