Skip to content

Commit

Permalink
Minor fix.
Browse files Browse the repository at this point in the history
Fix yt-dlp download if token.pickle not or sa not exists!

Signed-off-by: anasty17 <[email protected]>
  • Loading branch information
anasty17 committed Dec 20, 2023
1 parent f953a48 commit 32f0b53
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bot/modules/ytdlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,13 @@ async def newEvent(self):
if "mdisk.me" in self.link:
name, self.link = await _mdisk(self.link, name)

try:
await self.beforeStart()
except Exception as e:
await sendMessage(self.message, e)
self.removeFromSameDir()
return

options = {"usenetrc": True, "cookiefile": "cookies.txt"}
if opt:
yt_opt = opt.split("|")
Expand Down Expand Up @@ -424,13 +431,6 @@ async def newEvent(self):
self.removeFromSameDir()
return

try:
await self.beforeStart()
except Exception as e:
await sendMessage(self.message, e)
self.removeFromSameDir()
return

LOGGER.info(f"Downloading with YT-DLP: {self.link}")
playlist = "entries" in result
ydl = YoutubeDLHelper(self)
Expand Down

0 comments on commit 32f0b53

Please sign in to comment.