Spaces:
Running
Running
feat: read YouTube cookies path from YOUTUBE_COOKIES_PATH environment variable
Browse files- utils/youtube_tool.py +5 -3
utils/youtube_tool.py
CHANGED
|
@@ -21,9 +21,11 @@ from .state_manager import get_agent_state
|
|
| 21 |
|
| 22 |
class YouTubeTool:
|
| 23 |
def __init__(self):
|
| 24 |
-
#
|
| 25 |
-
self.cookies_path = os.
|
| 26 |
-
|
|
|
|
|
|
|
| 27 |
|
| 28 |
def process_youtube(self, youtube_input: str, **kwargs) -> Dict[str, Any]:
|
| 29 |
"""
|
|
|
|
| 21 |
|
| 22 |
class YouTubeTool:
|
| 23 |
def __init__(self):
|
| 24 |
+
# Lấy path cookie từ biến môi trường
|
| 25 |
+
self.cookies_path = os.environ.get("YOUTUBE_COOKIES_PATH")
|
| 26 |
+
if not self.cookies_path:
|
| 27 |
+
raise ValueError("YOUTUBE_COOKIES_PATH environment variable is not set. Please set it to the path of your cookies.txt file.")
|
| 28 |
+
print(f"🎬 YouTube Tool with cookies support initialized. Cookie path: {self.cookies_path}")
|
| 29 |
|
| 30 |
def process_youtube(self, youtube_input: str, **kwargs) -> Dict[str, Any]:
|
| 31 |
"""
|