Browse Source

[fix] update user agent

jazzzooo 1 year ago
parent
commit
3c6549a17f
2 changed files with 9 additions and 3 deletions
  1. 2 2
      searx/data/useragents.json
  2. 7 1
      searxng_extra/update/update_firefox_version.py

+ 2 - 2
searx/data/useragents.json

@@ -7,5 +7,5 @@
         "Windows NT 10.0; Win64; x64",
         "Windows NT 10.0; Win64; x64",
         "X11; Linux x86_64"
         "X11; Linux x86_64"
     ],
     ],
-    "ua": "Mozilla/5.0 ({os}; rv:{version}) Gecko/20100101 Firefox/{version}"
-}
+    "ua": "Mozilla/5.0 ({os}; rv:109.0) Gecko/20100101 Firefox/{version}"
+}

+ 7 - 1
searxng_extra/update/update_firefox_version.py

@@ -32,7 +32,7 @@ useragents = {
     "versions": (),
     "versions": (),
     "os": ('Windows NT 10.0; Win64; x64',
     "os": ('Windows NT 10.0; Win64; x64',
            'X11; Linux x86_64'),
            'X11; Linux x86_64'),
-    "ua": "Mozilla/5.0 ({os}; rv:{version}) Gecko/20100101 Firefox/{version}",
+    "ua": "Mozilla/5.0 ({os}; rv:109.0) Gecko/20100101 Firefox/{version}",
     # fmt: on
     # fmt: on
 }
 }
 
 
@@ -64,6 +64,12 @@ def fetch_firefox_last_versions():
     major_last = versions[0].major
     major_last = versions[0].major
     major_list = (major_last, major_last - 1)
     major_list = (major_last, major_last - 1)
     for version in versions:
     for version in versions:
+        msg = (
+            "Please check if the rv segment of the user agent is still frozen at 109.0: "
+            "https://bugzilla.mozilla.org/show_bug.cgi?id=1805967"
+        )
+        assert version.major != 120, msg
+
         major_current = version.major
         major_current = version.major
         minor_current = version.minor
         minor_current = version.minor
         if major_current in major_list:
         if major_current in major_list: