tuan3335 commited on
Commit
32dd219
·
1 Parent(s): ef2a762

feat: read YouTube cookies path from YOUTUBE_COOKIES_PATH environment variable

Browse files
Files changed (1) hide show
  1. 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
- # Path to cookies file in project root
25
- self.cookies_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "cookies.txt")
26
- print("🎬 YouTube Tool with cookies support initialized")
 
 
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
  """