Refactor code structure for improved readability and maintainability
This commit is contained in:
parent
efb320eb05
commit
e078cada3b
11 changed files with 1640 additions and 1184 deletions
46
modules/constants.py
Normal file
46
modules/constants.py
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
"""
|
||||
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_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,
|
||||
'vodTimeout': 300,
|
||||
'uploadCloud': True,
|
||||
'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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue