[common] add 'googlebot' User-Agent preset
This commit is contained in:
@@ -830,7 +830,11 @@ Description
|
|||||||
will use the latest ``User-Agent`` header of this preset target,
|
will use the latest ``User-Agent`` header of this preset target,
|
||||||
e.g. ``"+ff"``.
|
e.g. ``"+ff"``.
|
||||||
| (Supported values:
|
| (Supported values:
|
||||||
``firefox`` | ``ff`` | ``chrome`` | ``cr`` | ``gallery-dl`` | ``gdl``)
|
``firefox`` | ``ff`` |
|
||||||
|
``chrome`` | ``cr`` |
|
||||||
|
``gallery-dl`` | ``gdl`` |
|
||||||
|
``google-bot`` | ``bot``
|
||||||
|
)
|
||||||
|
|
||||||
| Starting this value with an ``@``
|
| Starting this value with an ``@``
|
||||||
will try to automatically detect and use the ``User-Agent`` header
|
will try to automatically detect and use the ``User-Agent`` header
|
||||||
|
|||||||
@@ -485,6 +485,8 @@ class Extractor():
|
|||||||
headers["User-Agent"] = util.USERAGENT_CHROME
|
headers["User-Agent"] = util.USERAGENT_CHROME
|
||||||
elif custom_ua in {"gallery-dl", "gallerydl", "gdl"}:
|
elif custom_ua in {"gallery-dl", "gallerydl", "gdl"}:
|
||||||
headers["User-Agent"] = util.USERAGENT_GALLERYDL
|
headers["User-Agent"] = util.USERAGENT_GALLERYDL
|
||||||
|
elif custom_ua in {"google-bot", "googlebot", "bot"}:
|
||||||
|
headers["User-Agent"] = "Googlebot-Image/1.0"
|
||||||
else:
|
else:
|
||||||
self.log.warning(
|
self.log.warning(
|
||||||
"Unsupported User-Agent preset '%s'", custom_ua)
|
"Unsupported User-Agent preset '%s'", custom_ua)
|
||||||
|
|||||||
Reference in New Issue
Block a user