Skip to content

Commit

Permalink
update default User-Agent header to Firefox 128 ESR
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jul 9, 2024
1 parent 8e747b6 commit 8aca0e6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ extractor.*.user-agent
Type
``string``
Default
``"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0"``
``"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0"``
Description
User-Agent header value to be used for HTTP requests.

Expand Down
2 changes: 1 addition & 1 deletion docs/gallery-dl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"proxy": null,
"skip": true,

"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0",
"retries": 4,
"timeout": 30.0,
"verify": true,
Expand Down
7 changes: 3 additions & 4 deletions gallery_dl/extractor/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def _init_session(self):
useragent = self.config("user-agent")
if useragent is None:
useragent = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64; "
"rv:109.0) Gecko/20100101 Firefox/115.0")
"rv:128.0) Gecko/20100101 Firefox/128.0")
elif useragent == "browser":
useragent = _browser_useragent()
headers["User-Agent"] = useragent
Expand Down Expand Up @@ -911,13 +911,12 @@ def _browser_useragent():
HTTP_HEADERS = {
"firefox": (
("User-Agent", "Mozilla/5.0 ({}; "
"rv:109.0) Gecko/20100101 Firefox/115.0"),
"rv:128.0) Gecko/20100101 Firefox/128.0"),
("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/avif,image/webp,*/*;q=0.8"),
"image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8"),
("Accept-Language", "en-US,en;q=0.5"),
("Accept-Encoding", None),
("Referer", None),
("DNT", "1"),
("Connection", "keep-alive"),
("Upgrade-Insecure-Requests", "1"),
("Cookie", None),
Expand Down

0 comments on commit 8aca0e6

Please sign in to comment.