Refactor downloader and file manager for improved rclone integration and add healthcheck and smoke test options

- Renamed download flags in ContentDownloader for clarity.
- Enhanced FileManager with methods to build upload paths and verify existing files for rclone uploads.
- Updated StreamProcessor to return success status for stream processing.
- Added rclone smoke test and healthcheck functions to validate configuration and tool availability.
- Improved environment variable handling with a utility function.
- Updated TwitchArchive to incorporate new rclone verification and processing logic.
- Added unit tests for new functionality and refactored existing tests for clarity and coverage.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
MaddoScientisto 2026-04-25 11:54:03 +02:00
commit f97e0200d6
23 changed files with 1013 additions and 289 deletions

View file

@ -40,9 +40,9 @@ class ContentDownloader:
self.ffmpeg_path = ffmpeg_path
self.quality = config.get('quality', 'best')
self.hls_segments_vod = config.get('hls_segmentsVOD', 10)
self.download_vod = config.get('downloadVOD', True)
self.download_chat = config.get('downloadCHAT', True)
self.download_live_chat = config.get('downloadLiveCHAT', True)
self.download_vod_enabled = config.get('downloadVOD', True)
self.download_chat_enabled = config.get('downloadCHAT', True)
self.download_live_chat_enabled = config.get('downloadLiveCHAT', True)
self.use_chat_downloader_primary = config.get('useChatDownloaderPrimary', False)
self.use_chat_downloader_fallback = config.get('useChatDownloaderFallback', True)
@ -73,7 +73,7 @@ class ContentDownloader:
Returns:
bool: True if download succeeded, False otherwise
"""
if not self.download_vod:
if not self.download_vod_enabled:
return False
print(f'\n{Fore.CYAN}Downloading VOD: {vod_info["title"]}{Style.RESET_ALL}')
@ -272,7 +272,7 @@ class ContentDownloader:
Returns:
bool: True if succeeded, False otherwise
"""
if not self.download_chat:
if not self.download_chat_enabled:
return False
print(f'\n{Fore.CYAN}Downloading chat: {vod_info["title"]}{Style.RESET_ALL}')
@ -298,7 +298,7 @@ class ContentDownloader:
Returns:
subprocess.Popen: The process handle, or None if failed to start
"""
if not self.download_live_chat:
if not self.download_live_chat_enabled:
return None
print(f'\n{Fore.CYAN}Starting live chat download...{Style.RESET_ALL}')
@ -502,7 +502,7 @@ class ContentDownloader:
print(f'{Fore.YELLOW} Install with: pip install chat-downloader{Style.RESET_ALL}')
return False
if not self.download_live_chat:
if not self.download_live_chat_enabled:
print(f'{Fore.YELLOW}⚠ downloadLiveCHAT is disabled in config{Style.RESET_ALL}')
return False