[instagram] use Chrome User-Agent by default (#6379)

This commit is contained in:
Mike Fährmann
2025-03-30 22:21:38 +02:00
parent 1396ea6352
commit ee26f3ccd7
3 changed files with 5 additions and 0 deletions

View File

@@ -663,6 +663,7 @@ Default
* ``"gallery-dl/VERSION"``: ``[Danbooru]``, ``mangadex``
* ``"gallery-dl/VERSION (by mikf)"``: ``[E621]``
* ``"Patreon/72.2.28 (Android; Android 14; Scale/2.10)"``: ``patreon``
* ``"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"``: ``instagram``
* ``"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:LATEST) Gecko/20100101 Firefox/LATEST"``: otherwise
Description
User-Agent header value used for HTTP requests.

View File

@@ -29,6 +29,7 @@ class InstagramExtractor(Extractor):
root = "https://www.instagram.com"
cookies_domain = ".instagram.com"
cookies_names = ("sessionid",)
useragent = util.USERAGENT_CHROME
request_interval = (6.0, 12.0)
def __init__(self, match):

View File

@@ -700,6 +700,9 @@ EXECUTABLE = getattr(sys, "frozen", False)
USERAGENT = "gallery-dl/" + version.__version__
USERAGENT_FIREFOX = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:{}.0) "
"Gecko/20100101 Firefox/{}.0").format(_ff_ver, _ff_ver)
USERAGENT_CHROME = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 "
"Safari/537.36")
SPECIAL_EXTRACTORS = {"oauth", "recursive", "generic"}
GLOBALS = {
"contains" : contains,