projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Credit @TRox1972 for tosh.cc (#9566) and localnews8 (#9539)
[youtube-dl]
/
youtube_dl
/
extractor
/
instagram.py
diff --git
a/youtube_dl/extractor/instagram.py
b/youtube_dl/extractor/instagram.py
index 3a5dd14e656eec1276aa145c4826d463953f16ec..3cbe77ad80f2fc9a03c738745524d5dac98c9d37 100644
(file)
--- 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):
@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:
blockquote_el = get_element_by_attribute(
'class', 'instagram-media', webpage)
if blockquote_el is None: