[common] add 'googlebot' User-Agent preset

This commit is contained in:
Mike Fährmann
2026-01-21 17:57:26 +01:00
parent e2a17a58f0
commit 78da7edde8
2 changed files with 7 additions and 1 deletions

View File

@@ -830,7 +830,11 @@ Description
will use the latest ``User-Agent`` header of this preset target,
e.g. ``"+ff"``.
| (Supported values:
``firefox`` | ``ff`` | ``chrome`` | ``cr`` | ``gallery-dl`` | ``gdl``)
``firefox`` | ``ff`` |
``chrome`` | ``cr`` |
``gallery-dl`` | ``gdl`` |
``google-bot`` | ``bot``
)
| Starting this value with an ``@``
will try to automatically detect and use the ``User-Agent`` header

View File

@@ -485,6 +485,8 @@ class Extractor():
headers["User-Agent"] = util.USERAGENT_CHROME
elif custom_ua in {"gallery-dl", "gallerydl", "gdl"}:
headers["User-Agent"] = util.USERAGENT_GALLERYDL
elif custom_ua in {"google-bot", "googlebot", "bot"}:
headers["User-Agent"] = "Googlebot-Image/1.0"
else:
self.log.warning(
"Unsupported User-Agent preset '%s'", custom_ua)