[util] add collections of image/video/archive filename extensions
This commit is contained in:
@@ -62,7 +62,7 @@ class KemonopartyExtractor(Extractor):
|
|||||||
dms = True if self.config("dms") else None
|
dms = True if self.config("dms") else None
|
||||||
max_posts = self.config("max-posts")
|
max_posts = self.config("max-posts")
|
||||||
creator_info = {} if self.config("metadata", True) else None
|
creator_info = {} if self.config("metadata", True) else None
|
||||||
exts_archive = {"zip", "rar", "7z"}
|
exts_archive = util.EXTS_ARCHIVE
|
||||||
|
|
||||||
# prevent files from being sent with gzip compression
|
# prevent files from being sent with gzip compression
|
||||||
headers = {"Accept-Encoding": "identity"}
|
headers = {"Accept-Encoding": "identity"}
|
||||||
|
|||||||
@@ -707,13 +707,20 @@ SECOND = datetime.timedelta(0, 1)
|
|||||||
WINDOWS = (os.name == "nt")
|
WINDOWS = (os.name == "nt")
|
||||||
SENTINEL = object()
|
SENTINEL = object()
|
||||||
EXECUTABLE = getattr(sys, "frozen", False)
|
EXECUTABLE = getattr(sys, "frozen", False)
|
||||||
|
SPECIAL_EXTRACTORS = {"oauth", "recursive", "generic"}
|
||||||
|
|
||||||
|
EXTS_IMAGE = {"jpg", "jpeg", "png", "gif", "bmp", "svg", "psd", "ico",
|
||||||
|
"webp", "avif", "heic", "heif"}
|
||||||
|
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 = "gallery-dl/" + version.__version__
|
||||||
USERAGENT_FIREFOX = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:{}.0) "
|
USERAGENT_FIREFOX = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:{}.0) "
|
||||||
"Gecko/20100101 Firefox/{}.0").format(_ff_ver, _ff_ver)
|
"Gecko/20100101 Firefox/{}.0").format(_ff_ver, _ff_ver)
|
||||||
USERAGENT_CHROME = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
|
USERAGENT_CHROME = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
|
||||||
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{}.0.0.0 "
|
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{}.0.0.0 "
|
||||||
"Safari/537.36").format(_ff_ver - 2)
|
"Safari/537.36").format(_ff_ver - 2)
|
||||||
SPECIAL_EXTRACTORS = {"oauth", "recursive", "generic"}
|
|
||||||
GLOBALS = {
|
GLOBALS = {
|
||||||
"contains" : contains,
|
"contains" : contains,
|
||||||
"parse_int": text.parse_int,
|
"parse_int": text.parse_int,
|
||||||
@@ -727,6 +734,9 @@ GLOBALS = {
|
|||||||
"hash_md5" : md5,
|
"hash_md5" : md5,
|
||||||
"std" : ModuleProxy(),
|
"std" : ModuleProxy(),
|
||||||
"re" : re,
|
"re" : re,
|
||||||
|
"exts_image" : EXTS_IMAGE,
|
||||||
|
"exts_video" : EXTS_VIDEO,
|
||||||
|
"exts_archive": EXTS_ARCHIVE,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user