From 12f625a4324e6c9fa8a7498d41d48584213a11ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Wed, 29 May 2019 13:45:56 +0200 Subject: [PATCH] ydl -> ytdl (cosmetics; ocd) --- delojza.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/delojza.py b/delojza.py index 7d8161b..3a30866 100755 --- a/delojza.py +++ b/delojza.py @@ -175,23 +175,23 @@ class DelojzaBot: # noinspection PyUnusedLocal def download_ytdl(self, urls, out_path, date, message, audio=False, filetitle=None): - ydl_opts = { + ytdl = { 'noplaylist': True, 'restrictfilenames': True, 'outtmpl': os.path.join(self.tmp_dir, '{}__%(title)s__%(id)s.%(ext)s'.format(datestr(date))) } if audio: - ydl_opts['format'] = 'bestaudio/best' - ydl_opts['postprocessors'] = [{ + ytdl['format'] = 'bestaudio/best' + ytdl['postprocessors'] = [{ 'key': 'FFmpegExtractAudio', 'preferredcodec': 'mp3', 'preferredquality': '256' }] filenames = [] - with youtube_dl.YoutubeDL(ydl_opts) as ydl: - ydl.download(urls) - for info in [ydl.extract_info(url, download=False) for url in urls]: - filename = ydl.prepare_filename(info) + with youtube_dl.YoutubeDL(ytdl) as ytdl: + ytdl.download(urls) + for info in [ytdl.extract_info(url, download=False) for url in urls]: + filename = ytdl.prepare_filename(info) globbeds = glob(os.path.splitext(filename)[0] + '.*') for globbed in globbeds: if globbed.endswith("mp3"):