seawolf2357 commited on
Commit
4f7204d
โ€ข
1 Parent(s): d9bec3c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -5,6 +5,10 @@ from huggingface_hub import InferenceClient
5
  import requests
6
  import asyncio
7
  from googleapiclient.discovery import build
 
 
 
 
8
 
9
  # ๋กœ๊น… ์„ค์ •
10
  logging.basicConfig(level=logging.DEBUG, format='%(asctime)s:%(levelname)s:%(name)s:%(message)s', handlers=[logging.StreamHandler()])
@@ -20,7 +24,7 @@ intents.guild_messages = True
20
  hf_client = InferenceClient("CohereForAI/c4ai-command-r-plus", token=os.getenv("HF_TOKEN"))
21
 
22
  # Pexels API ํ‚ค ์„ค์ •
23
- PEXELS_API_KEY = "5woz23MGx1QrSY0WHFb0BRi29JvbXPu97Hg0xnklYgHUI8G0w23FKH62"
24
  PEXELS_VIDEO_API_URL = "https://api.pexels.com/videos/search"
25
 
26
  # YouTube API ํ‚ค ์„ค์ •
@@ -29,6 +33,7 @@ youtube_service = build('youtube', 'v3', developerKey=YOUTUBE_API_KEY)
29
 
30
  # ํŠน์ • ์ฑ„๋„ ID
31
  SPECIFIC_CHANNEL_ID = int(os.getenv("DISCORD_CHANNEL_ID"))
 
32
 
33
  # ๋Œ€ํ™” ํžˆ์Šคํ† ๋ฆฌ๋ฅผ ์ €์žฅํ•  ์ „์—ญ ๋ณ€์ˆ˜
34
  conversation_history = []
@@ -119,7 +124,7 @@ async def search_music_on_youtube(keywords):
119
  part='snippet',
120
  type='video',
121
  maxResults=5,
122
- videoCategoryId='10' # ์Œ์•… ์นดํ…Œ๊ณ ๋ฆฌ ID
123
  ).execute()
124
  music_urls = []
125
  for item in response.get('items', []):
 
5
  import requests
6
  import asyncio
7
  from googleapiclient.discovery import build
8
+ from dotenv import load_dotenv
9
+
10
+ # ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ๋กœ๋“œ
11
+ load_dotenv()
12
 
13
  # ๋กœ๊น… ์„ค์ •
14
  logging.basicConfig(level=logging.DEBUG, format='%(asctime)s:%(levelname)s:%(name)s:%(message)s', handlers=[logging.StreamHandler()])
 
24
  hf_client = InferenceClient("CohereForAI/c4ai-command-r-plus", token=os.getenv("HF_TOKEN"))
25
 
26
  # Pexels API ํ‚ค ์„ค์ •
27
+ PEXELS_API_KEY = os.getenv("PEXELS_API_KEY")
28
  PEXELS_VIDEO_API_URL = "https://api.pexels.com/videos/search"
29
 
30
  # YouTube API ํ‚ค ์„ค์ •
 
33
 
34
  # ํŠน์ • ์ฑ„๋„ ID
35
  SPECIFIC_CHANNEL_ID = int(os.getenv("DISCORD_CHANNEL_ID"))
36
+ YOUTUBE_MUSIC_CHANNEL_ID = os.getenv("YOUTUBE_MUSIC_CHANNEL_ID")
37
 
38
  # ๋Œ€ํ™” ํžˆ์Šคํ† ๋ฆฌ๋ฅผ ์ €์žฅํ•  ์ „์—ญ ๋ณ€์ˆ˜
39
  conversation_history = []
 
124
  part='snippet',
125
  type='video',
126
  maxResults=5,
127
+ channelId=YOUTUBE_MUSIC_CHANNEL_ID # ํŠน์ • ์ฑ„๋„ ID๋กœ ๊ฒ€์ƒ‰
128
  ).execute()
129
  music_urls = []
130
  for item in response.get('items', []):