Skip to content

Commit

Permalink
update default User-Agent header to Firefox 102 ESR
Browse files Browse the repository at this point in the history
snd update headers and ciphers for "browser": "firefox"
  • Loading branch information
mikf committed Jun 28, 2022
1 parent 1f9ff51 commit 3a5d5c3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ extractor.*.user-agent
Type
``string``
Default
``"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"``
``"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.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:91.0) Gecko/20100101 Firefox/91.0",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0",
"retries": 4,
"timeout": 30.0,
"verify": true,
Expand Down
18 changes: 11 additions & 7 deletions gallery_dl/extractor/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def _init_session(self):
else:
headers["User-Agent"] = self.config("user-agent", (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; "
"rv:91.0) Gecko/20100101 Firefox/91.0"))
"rv:102.0) Gecko/20100101 Firefox/102.0"))
headers["Accept"] = "*/*"
headers["Accept-Language"] = "en-US,en;q=0.5"
headers["Accept-Encoding"] = "gzip, deflate"
Expand Down Expand Up @@ -713,16 +713,21 @@ def _build_requests_adapter(ssl_options, ssl_ciphers, source_address):

HTTP_HEADERS = {
"firefox": (
("User-Agent", "Mozilla/5.0 ({}; rv:91.0) "
"Gecko/20100101 Firefox/91.0"),
("User-Agent", "Mozilla/5.0 ({}; rv:102.0) "
"Gecko/20100101 Firefox/102.0"),
("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/avif,*/*;q=0.8"),
"image/avif,image/webp,*/*;q=0.8"),
("Accept-Language", "en-US,en;q=0.5"),
("Accept-Encoding", "gzip, deflate"),
("Accept-Encoding", "gzip, deflate, br"),
("Referer", None),
("DNT", "1"),
("Connection", "keep-alive"),
("Upgrade-Insecure-Requests", "1"),
("Cookie", None),
("Sec-Fetch-Dest", "empty"),
("Sec-Fetch-Mode", "no-cors"),
("Sec-Fetch-Site", "same-origin"),
("TE", "trailers"),
),
"chrome": (
("Upgrade-Insecure-Requests", "1"),
Expand Down Expand Up @@ -755,8 +760,7 @@ def _build_requests_adapter(ssl_options, ssl_ciphers, source_address):
"AES128-GCM-SHA256:"
"AES256-GCM-SHA384:"
"AES128-SHA:"
"AES256-SHA:"
"DES-CBC3-SHA"
"AES256-SHA"
),
"chrome": (
"TLS_AES_128_GCM_SHA256:"
Expand Down
2 changes: 1 addition & 1 deletion gallery_dl/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.

__version__ = "1.22.2"
__version__ = "1.22.3-dev"

0 comments on commit 3a5d5c3

Please sign in to comment.