[common] compute and use latest Firefox UA

instead of the latest ESR UA
This commit is contained in:
Mike Fährmann
2024-12-17 21:42:45 +01:00
parent 0802e42c90
commit 041baf8441
2 changed files with 8 additions and 3 deletions

View File

@@ -647,13 +647,19 @@ class CustomNone():
__repr__ = __str__
# v128.0 release on 2024-07-09 has ordinal 739076
# 735492 == 739076 - 128 * 28
_ff_ver = (datetime.date.today().toordinal() - 735492) // 28
NONE = CustomNone()
EPOCH = datetime.datetime(1970, 1, 1)
SECOND = datetime.timedelta(0, 1)
WINDOWS = (os.name == "nt")
SENTINEL = object()
USERAGENT = "gallery-dl/" + version.__version__
EXECUTABLE = getattr(sys, "frozen", False)
USERAGENT = "gallery-dl/" + version.__version__
USERAGENT_FIREFOX = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:{}.0) "
"Gecko/20100101 Firefox/{}.0").format(_ff_ver, _ff_ver)
SPECIAL_EXTRACTORS = {"oauth", "recursive", "generic"}
GLOBALS = {
"contains" : contains,