mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-01-07 17:16:08 +00:00
[instagram] Extract embed videos (#8817)
This commit is contained in:
parent
fc27ea9464
commit
c4096e8aea
|
@ -4,6 +4,7 @@ import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
|
get_element_by_attribute,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
limit_length,
|
limit_length,
|
||||||
)
|
)
|
||||||
|
@ -38,6 +39,18 @@ class InstagramIE(InfoExtractor):
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _extract_embed_url(webpage):
|
||||||
|
blockquote_el = get_element_by_attribute(
|
||||||
|
'class', 'instagram-media', webpage)
|
||||||
|
if blockquote_el is None:
|
||||||
|
return
|
||||||
|
|
||||||
|
mobj = re.search(
|
||||||
|
r'<a[^>]+href=([\'"])(?P<link>[^\'"]+)\1', blockquote_el)
|
||||||
|
if mobj:
|
||||||
|
return mobj.group('link')
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue