From 9d1514c1eb472a7b6518e32f6986cc408fcb066e Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 17 Aug 2019 19:41:26 +0300 Subject: [PATCH] Tentative fix for #77 --- royalnet/audio/ytdlfile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/royalnet/audio/ytdlfile.py b/royalnet/audio/ytdlfile.py index 03f04880..ec13ff05 100644 --- a/royalnet/audio/ytdlfile.py +++ b/royalnet/audio/ytdlfile.py @@ -13,7 +13,7 @@ class YtdlFile: "quiet": True, # Do not print messages to stdout. "noplaylist": True, # Download single video instead of a playlist if in doubt. "no_warnings": True, # Do not print out anything for warnings. - "outtmpl": "%(title)s-%(id)s.%(ext)s", # Use the default outtmpl. + "outtmpl": "%(epoch)s-%(title)s-%(id)s.%(ext)s", # Use the default outtmpl. "ignoreerrors": True # Ignore unavailable videos } @@ -52,8 +52,9 @@ class YtdlFile: if self.is_downloaded(): raise AlreadyDownloadedError() with youtube_dl.YoutubeDL({**self._default_ytdl_args, **ytdl_args}) as ytdl: + filename = ytdl.prepare_filename(self.info.__dict__) ytdl.download([self.info.webpage_url]) - self.filename = ytdl.prepare_filename(self.info.__dict__) + self.filename = filename def delete(self): if self.is_downloaded():