TwitchDownloader/modules/constants.py
MaddoScientisto 0d3cdfd12c feat: add upload options for pre-merge, merged, and standalone chat videos
- Updated global schema to include options for uploading original videos before merging, merged videos, and standalone chat videos.
- Modified constants to set default values for new upload options.
- Enhanced FileManager to handle new upload options, including conditional file uploads and deletions based on user configuration.
- Introduced unit tests for command-line argument parsing, configuration loading, and merging logic, ensuring robust handling of new features.
- Added tests for filtering logic, default configurations, and enabled streamer handling.
2026-02-11 17:44:34 +01:00

52 lines
2 KiB
Python

"""
Constants and default configuration values for Twitch Archive.
"""
# API Endpoints
TWITCH_OAUTH_URL = "https://id.twitch.tv/oauth2/token"
TWITCH_API_URL = "https://api.twitch.tv/helix"
TWITCH_GQL_URL = "https://gql.twitch.tv/gql"
TWITCH_GQL_CLIENT_ID = "kimne78kx3ncx6brgo4mv6wki5h1ko"
# File prefixes for different content types
PREFIX_LIVE = "LIVE_"
PREFIX_VOD = "VOD_"
PREFIX_CHAT = "CHAT_"
PREFIX_MERGED = "MERGED_"
PREFIX_METADATA = "METADA_" # Note: keeping original typo for compatibility
# Default configuration values
DEFAULT_CONFIG = {
'username': 'your_twitch_username',
'quality': 'best',
'root_path': 'archive',
'rclone_path': 'remote:path/to/streams',
'refresh': 60.0,
'streamlink_ttvlol': False,
'notifications': False,
'downloadMETADATA': True,
'downloadVOD': True,
'downloadCHAT': True,
'downloadLiveCHAT': True,
'mergeVideoChat': True, # Merge video and chat into single file
'mergeChatLayout': 'side-by-side', # Layout: 'side-by-side' or 'overlay'
'vodTimeout': 300,
'uploadCloud': True,
'uploadPreMergeVideo': True, # Upload original videos before merging
'uploadMergedVideo': True, # Upload merged videos (video + chat)
'uploadChatVideo': False, # Upload standalone chat video
'deleteFiles': False,
'onlyRaw': False,
'cleanRaw': True,
'hls_segments': 3,
'hls_segmentsVOD': 10,
# FFmpeg 8.0+ Enhancement Options
'ffmpeg_hwaccel': 'auto', # Hardware acceleration: 'auto', 'nvenc', 'qsv', 'amf', 'vaapi', 'none'
'ffmpeg_threads': 0, # Thread count (0 = auto-detect)
'ffmpeg_audio_codec': 'aac', # Audio codec for audio-only streams
'ffmpeg_audio_samplerate': 48000, # Audio sample rate (48000 recommended for broadcasts)
'ffmpeg_audio_bitrate': '192k', # Audio bitrate
'ffmpeg_error_recovery': True, # Enable error recovery for corrupted streams
'ffmpeg_faststart': True, # Enable faststart for MP4 (better streaming compatibility)
'ffmpeg_progress': False # Show encoding progress
}