diff --git a/src/you_get/common.py b/src/you_get/common.py index 2e2fbebd89..f6956fadc7 100755 --- a/src/you_get/common.py +++ b/src/you_get/common.py @@ -145,7 +145,7 @@ 'Accept-Charset': 'UTF-8,*;q=0.5', 'Accept-Encoding': 'gzip,deflate,sdch', 'Accept-Language': 'en-US,en;q=0.8', - 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.2592.68' # Latest Edge + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/126.0.2592.113' # Latest Edge } if sys.stdout.isatty(): diff --git a/src/you_get/extractors/instagram.py b/src/you_get/extractors/instagram.py index 8e261fe791..b0fd6f0fa7 100755 --- a/src/you_get/extractors/instagram.py +++ b/src/you_get/extractors/instagram.py @@ -5,8 +5,13 @@ from ..common import * def instagram_download(url, output_dir='.', merge=True, info_only=False, **kwargs): + headers = { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.2592.87', + 'sec-fetch-mode': 'navigate' # important + } + url = r1(r'([^?]*)', url) - cont = get_content(url, headers=fake_headers) + cont = get_content(url, headers=headers) vid = r1(r'instagram.com/\w+/([^/]+)', url) description = r1(r'