seawolf2357
commited on
Commit
โข
4f7204d
1
Parent(s):
d9bec3c
Update app.py
Browse files
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 = "
|
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 |
-
|
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', []):
|