mirror of
https://github.com/Benexl/FastAnime.git
synced 2025-12-12 15:50:01 -08:00
feat(downloads-config): add support for no check certs
This commit is contained in:
@@ -69,6 +69,7 @@ ANILIST_PREFERRED_LANGUAGE = "english"
|
||||
DOWNLOADS_DOWNLOADER = "auto"
|
||||
DOWNLOADS_DOWNLOADS_DIR = USER_VIDEOS_DIR
|
||||
DOWNLOADS_ENABLE_TRACKING = True
|
||||
DOWNLOADS_NO_CHECK_CERTIFICATE = True
|
||||
DOWNLOADS_MAX_CONCURRENT = 3
|
||||
DOWNLOADS_RETRY_ATTEMPTS = 2
|
||||
DOWNLOADS_RETRY_DELAY = 60
|
||||
|
||||
@@ -58,18 +58,6 @@ STREAM_DEFAULT_MEDIA_LIST_TRACKING = (
|
||||
STREAM_SUB_LANG = "Preferred language code for subtitles (e.g., 'en', 'es')."
|
||||
STREAM_USE_IPC = "Use IPC communication with the player for advanced features like episode navigation."
|
||||
|
||||
# ServiceConfig
|
||||
SERVICE_ENABLED = "Whether the background service should be enabled by default."
|
||||
SERVICE_WATCHLIST_CHECK_INTERVAL = (
|
||||
"Minutes between checking AniList watchlist for new episodes."
|
||||
)
|
||||
SERVICE_QUEUE_PROCESS_INTERVAL = "Minutes between processing the download queue."
|
||||
SERVICE_MAX_CONCURRENT_DOWNLOADS = "Maximum number of concurrent downloads."
|
||||
SERVICE_AUTO_RETRY_COUNT = "Number of times to retry failed downloads."
|
||||
SERVICE_CLEANUP_COMPLETED_DAYS = (
|
||||
"Days to keep completed/failed jobs in queue before cleanup."
|
||||
)
|
||||
SERVICE_NOTIFICATION_ENABLED = "Whether to show notifications for new episodes."
|
||||
|
||||
# FzfConfig
|
||||
FZF_HEADER_COLOR = "RGB color for the main TUI header."
|
||||
@@ -103,6 +91,7 @@ DOWNLOADS_DOWNLOADER = "The downloader to use"
|
||||
DOWNLOADS_DOWNLOADS_DIR = "The default directory to save downloaded anime."
|
||||
DOWNLOADS_ENABLE_TRACKING = "Enable download tracking and management"
|
||||
DOWNLOADS_MAX_CONCURRENT = "Maximum number of concurrent downloads"
|
||||
DOWNLOADS_NO_CHECK_CERTIFICATE = "Whether or not to check certificates"
|
||||
DOWNLOADS_RETRY_ATTEMPTS = "Number of retry attempts for failed downloads"
|
||||
DOWNLOADS_RETRY_DELAY = "Delay between retry attempts in seconds"
|
||||
DOWNLOADS_MERGE_SUBTITLES = (
|
||||
|
||||
@@ -316,6 +316,20 @@ class DownloadsConfig(OtherConfig):
|
||||
description=desc.DOWNLOADS_CLEANUP_AFTER_MERGE,
|
||||
)
|
||||
|
||||
server: ProviderServer = Field(
|
||||
default=ProviderServer.TOP,
|
||||
description=desc.STREAM_SERVER,
|
||||
)
|
||||
|
||||
ytdlp_format: str = Field(
|
||||
default=defaults.STREAM_YTDLP_FORMAT,
|
||||
description=desc.STREAM_YTDLP_FORMAT,
|
||||
)
|
||||
no_check_certificate: bool = Field(
|
||||
default=defaults.DOWNLOADS_NO_CHECK_CERTIFICATE,
|
||||
description=desc.DOWNLOADS_NO_CHECK_CERTIFICATE,
|
||||
)
|
||||
|
||||
|
||||
class MediaRegistryConfig(OtherConfig):
|
||||
"""Configuration for registry related options"""
|
||||
|
||||
@@ -20,3 +20,4 @@ class DownloadParams:
|
||||
force_ffmpeg: bool = False
|
||||
hls_use_mpegts: bool = False
|
||||
hls_use_h264: bool = False
|
||||
no_check_certificate: bool = True
|
||||
|
||||
@@ -6,17 +6,18 @@ import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
import httpx
|
||||
import yt_dlp
|
||||
from rich import print
|
||||
from rich.prompt import Confirm
|
||||
|
||||
import yt_dlp
|
||||
from yt_dlp.utils import sanitize_filename
|
||||
|
||||
from ..exceptions import FastAnimeError
|
||||
from ..patterns import TORRENT_REGEX
|
||||
from ..utils.networking import get_remote_filename
|
||||
from .base import BaseDownloader
|
||||
from .params import DownloadParams
|
||||
from .model import DownloadResult
|
||||
from .params import DownloadParams
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -89,6 +90,7 @@ class YtDLPDownloader(BaseDownloader):
|
||||
if params.force_unknown_ext
|
||||
else tuple(),
|
||||
"progress_hooks": params.progress_hooks,
|
||||
"nocheckcertificate": params.no_check_certificate,
|
||||
}
|
||||
opts = opts
|
||||
if params.force_ffmpeg:
|
||||
|
||||
Reference in New Issue
Block a user