aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-04-16 22:31:05 +0600
committerSergey M․ <dstftw@gmail.com>2016-04-16 22:31:05 +0600
commitc23533a100eb0a383b60ed2e5990602e9318fe4b (patch)
treeb8dc4e329731315b5181a8781ebe77f79afd30eb /youtube_dl/extractor
parent0dafea02e6644053b6db6603238827176f6c6f3e (diff)
[instagram] Add support for iframe embeds
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/instagram.py6
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: