taslim19 commited on
Commit
b269b33
·
1 Parent(s): 75f8d4a

fix(youtube): conditionally use cookies if available

Browse files
Files changed (1) hide show
  1. DragMusic/platforms/Youtube.py +4 -0
DragMusic/platforms/Youtube.py CHANGED
@@ -30,6 +30,10 @@ class YouTubeAPI:
30
  def __init__(self):
31
  self.base = "https://www.youtube.com/watch?v="
32
  self.opts = {"nocheckcertificate": True, "quiet": True, "no_warnings": True}
 
 
 
 
33
 
34
  async def get_info(self, link: str):
35
  """Fetches all video information using yt-dlp."""
 
30
  def __init__(self):
31
  self.base = "https://www.youtube.com/watch?v="
32
  self.opts = {"nocheckcertificate": True, "quiet": True, "no_warnings": True}
33
+
34
+ cookie_file = "cookies.txt"
35
+ if os.path.exists(cookie_file):
36
+ self.opts["cookiefile"] = cookie_file
37
 
38
  async def get_info(self, link: str):
39
  """Fetches all video information using yt-dlp."""