fix: demo_service1 keeps crashing if DEMO_YOUTUBE_API_KEY is not set

This commit is contained in:
DiligentCatCat
2023-06-13 14:29:27 +08:00
parent 3a6a04de0a
commit 5c31f0e2b5
+1
View File
@@ -23,6 +23,7 @@ load_dotenv()
os.environ['OPENAI_API_KEY'] = os.getenv("JARVIS_OPENAI_API_KEY")
youtube_api_key = os.getenv("DEMO_YOUTUBE_API_KEY")
if youtube_api_key is not None and youtube_api_key != '':
youtube_client = build('youtube', 'v3', developerKey=youtube_api_key)
youtube_video_max_result = 3
youtube_username_set = set()