mirror of
https://github.com/JoeanAmier/XHS-Downloader.git
synced 2026-03-22 06:57:16 +08:00
feat(image): 增加对 JPEG 和 HEIC 图片格式的支持
- 在图片下载功能中添加了对 JPEG 和 HEIC 格式的支持 - 更新了相关模块和文档以支持新功能 Closes #229
This commit is contained in:
@@ -29,6 +29,7 @@ from .static import (
|
||||
FILE_SIGNATURES,
|
||||
FILE_SIGNATURES_LENGTH,
|
||||
MAX_WORKERS,
|
||||
__VERSION__,
|
||||
)
|
||||
from .tools import (
|
||||
retry,
|
||||
|
||||
@@ -138,8 +138,8 @@ class Manager:
|
||||
|
||||
@staticmethod
|
||||
def __check_image_format(image_format) -> str:
|
||||
if image_format in {"png", "PNG", "webp", "WEBP"}:
|
||||
return image_format.lower()
|
||||
if (i := image_format.lower()) in {"auto", "png", "webp", "jpeg", "heic", "avif", }:
|
||||
return i
|
||||
return "png"
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -3,7 +3,7 @@ from pathlib import Path
|
||||
VERSION_MAJOR = 2
|
||||
VERSION_MINOR = 5
|
||||
VERSION_BETA = True
|
||||
__version__ = f"{VERSION_MAJOR}.{VERSION_MINOR}.{'beta' if VERSION_BETA else 'stable'}"
|
||||
__VERSION__ = f"{VERSION_MAJOR}.{VERSION_MINOR}.{'beta' if VERSION_BETA else 'stable'}"
|
||||
ROOT = Path(__file__).resolve().parent.parent.parent
|
||||
PROJECT = f"XHS-Downloader V{VERSION_MAJOR}.{VERSION_MINOR} {
|
||||
'Beta' if VERSION_BETA else 'Stable'
|
||||
@@ -68,4 +68,4 @@ FILE_SIGNATURES_LENGTH = max(
|
||||
MAX_WORKERS: int = 4
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(__version__)
|
||||
print(__VERSION__)
|
||||
|
||||
Reference in New Issue
Block a user