Initial commit: Twitch Stream Vision Analyzer
Async pipeline: streamlink + ffmpeg frame capture → Gemini Vision API analysis → rich console output + log file. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
42
config.py
Normal file
42
config.py
Normal file
@@ -0,0 +1,42 @@
|
||||
import argparse
|
||||
import os
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
|
||||
def load_config() -> argparse.Namespace:
|
||||
load_dotenv()
|
||||
|
||||
parser = argparse.ArgumentParser(description="Twitch Stream Vision Analyzer")
|
||||
parser.add_argument("--channel", required=True, help="Twitch channel name")
|
||||
parser.add_argument(
|
||||
"--interval",
|
||||
type=int,
|
||||
default=15,
|
||||
help="Frame capture interval in seconds (default: 15)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--quality",
|
||||
default="480p",
|
||||
help="Stream quality (default: 480p)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--lang",
|
||||
default="ru",
|
||||
help="Language for descriptions (default: ru)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--log-file",
|
||||
default="stream_log.txt",
|
||||
help="Log file path (default: stream_log.txt)",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
args.gemini_api_key = os.environ.get("GEMINI_API_KEY")
|
||||
if not args.gemini_api_key:
|
||||
parser.error("GEMINI_API_KEY must be set in .env or environment")
|
||||
|
||||
args.gemini_base_url = os.environ.get("GEMINI_BASE_URL")
|
||||
|
||||
return args
|
||||
Reference in New Issue
Block a user