From 5ff3842e2c0e1d9d17a69c5067c69acbf086aa9f Mon Sep 17 00:00:00 2001 From: 20xd6 <20xd6@airmail.cc> Date: Wed, 13 Sep 2023 22:28:47 -0400 Subject: [PATCH] Adds a basic notification on completion This is for issue #6. --- download.py | 18 ++++++++++++------ requierments.txt | 3 ++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/download.py b/download.py index c8eb498..55afafc 100644 --- a/download.py +++ b/download.py @@ -1,4 +1,5 @@ import yt_dlp as yt +from plyer import notification def get(yt_url): ytdl_options = { @@ -12,17 +13,22 @@ def get(yt_url): 'embed_metadata': True, 'format': 'any/bestaudio/best', # ℹ️ See help(yt_dlp.postprocessor) for a list of available Postprocessors and their arguments - 'postprocessors': [{ # Extract audio using ffmpeg - 'key': 'FFmpegMetadata' - },{ + 'postprocessors': [{ # Extract audio using ffmpeg, 'key': 'FFmpegExtractAudio', - 'preferredcodec': 'mp3', - - }] + 'preferredcodec': 'mp3', + },{'key': 'FFmpegMetadata'}, + {'key': 'EmbedThumbnail'},] } with yt.YoutubeDL(ytdl_options) as ytdl: ytdl.download(yt_url) + notification.notify( + title = "yt2mp3", + message = "Download and conversion complete.", + app_icon = None, + timeout = 5, + ) + def dl_progress(d): diff --git a/requierments.txt b/requierments.txt index b21e42f..9483d98 100644 --- a/requierments.txt +++ b/requierments.txt @@ -1 +1,2 @@ -yt-dlp \ No newline at end of file +yt-dlp +plyer \ No newline at end of file