TwitchDownloader/modules/constants.py

52 lines
2 KiB
Python
Raw Permalink Normal View History

"""
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
}