[util] rename 'USERAGENT' to 'USERAGENT_GALLERYDL'

This commit is contained in:
Mike Fährmann
2026-01-03 10:30:24 +01:00
parent e33a63231f
commit a28fbbc3c6
6 changed files with 6 additions and 7 deletions

View File

@@ -19,7 +19,7 @@ class DanbooruExtractor(BaseExtractor):
page_limit = 1000
page_start = None
per_page = 200
useragent = util.USERAGENT
useragent = util.USERAGENT_GALLERYDL
request_interval = (0.5, 1.5)
def _init(self):

View File

@@ -20,7 +20,7 @@ class E621Extractor(danbooru.DanbooruExtractor):
page_limit = 750
page_start = None
per_page = 320
useragent = util.USERAGENT + " (by mikf)"
useragent = util.USERAGENT_GALLERYDL + " (by mikf)"
request_interval_min = 1.0
def items(self):

View File

@@ -26,7 +26,7 @@ class MangadexExtractor(Extractor):
"{manga}_c{chapter:>03}{chapter_minor}_{page:>03}.{extension}")
archive_fmt = "{chapter_id}_{page}"
root = "https://mangadex.org"
useragent = util.USERAGENT
useragent = util.USERAGENT_GALLERYDL
_cache = {}
def _init(self):

View File

@@ -18,7 +18,7 @@ class WeasylExtractor(Extractor):
filename_fmt = "{submitid} {title}.{extension}"
archive_fmt = "{submitid}"
root = "https://www.weasyl.com"
useragent = util.USERAGENT
useragent = util.USERAGENT_GALLERYDL
def populate_submission(self, data):
# Some submissions don't have content and can be skipped

View File

@@ -26,7 +26,7 @@ class ZerochanExtractor(BooruExtractor):
per_page = 200
cookies_domain = ".zerochan.net"
cookies_names = ("z_id", "z_hash")
useragent = util.USERAGENT
useragent = util.USERAGENT_GALLERYDL
request_interval = (0.5, 1.5)
def login(self):
@@ -173,7 +173,6 @@ class ZerochanTagExtractor(ZerochanExtractor):
self.per_page = 24
else:
self.posts = self.posts_api
self.session.headers["User-Agent"] = util.USERAGENT
if exts := self.config("extensions"):
if isinstance(exts, str):

View File

@@ -716,7 +716,7 @@ EXTS_IMAGE = {"jpg", "jpeg", "png", "gif", "bmp", "svg", "psd", "ico",
EXTS_VIDEO = {"mp4", "m4v", "mov", "webm", "mkv", "ogv", "flv", "avi", "wmv"}
EXTS_ARCHIVE = {"zip", "rar", "7z", "tar", "gz", "bz2", "lzma", "xz"}
USERAGENT = "gallery-dl/" + version.__version__
USERAGENT_GALLERYDL = "gallery-dl/" + version.__version__
USERAGENT_FIREFOX = (f"Mozilla/5.0 (Windows NT 10.0; Win64; x64; "
f"rv:{_ff_ver}.0) Gecko/20100101 Firefox/{_ff_ver}.0")
USERAGENT_CHROME = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) "