diff --git a/src/you_get/extractors/instagram.py b/src/you_get/extractors/instagram.py
index 0a9da345..e7c79717 100755
--- a/src/you_get/extractors/instagram.py
+++ b/src/you_get/extractors/instagram.py
@@ -6,14 +6,14 @@ from ..common import *
def instagram_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
url = r1(r'([^?]*)', url)
- html = get_html(url, faker=True)
+ cont = get_content(url, headers=fake_headers)
vid = r1(r'instagram.com/\w+/([^/]+)', url)
- description = r1(r'\s([^<]*)', html) # with logged-in cookies
+ description = r1(r'\s([^<]*)', cont) # with logged-in cookies
title = "{} [{}]".format(description.replace("\n", " "), vid)
- stream = r1(r'', html)
+ data = re.search(r'window\._sharedData\s*=\s*(.*);', cont)
try:
info = json.loads(data.group(1))
post = info['entry_data']['PostPage'][0]
assert post
except:
# with logged-in cookies
- data = re.search(r'window\.__additionalDataLoaded\(\'[^\']+\',(.*)\);', html)
+ data = re.search(r'window\.__additionalDataLoaded\(\'[^\']+\',(.*)\);', cont)
if data is not None:
log.e('[Warning] Cookies needed.')
post = json.loads(data.group(1))