2 Commits

Author SHA1 Message Date
dc8c561576 Update the notification system
This is to resolve issue #8.
2023-09-20 18:48:43 -04:00
d6a7b56bcf Catch for notification
plyer fails on Ubuntu with XFCE
2023-09-15 09:52:20 -04:00
2 changed files with 9 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
try: try:
import yt_dlp as yt import yt_dlp as yt
from plyer import notification from notifypy import Notify
except: except:
import os import os
script_dir = os.path.dirname(os.path.realpath(__file__)) script_dir = os.path.dirname(os.path.realpath(__file__))
@@ -28,12 +28,13 @@ def get(yt_url):
with yt.YoutubeDL(ytdl_options) as ytdl: with yt.YoutubeDL(ytdl_options) as ytdl:
ytdl.download(yt_url) ytdl.download(yt_url)
notification.notify( try:
title = "yt2mp3", notification = Notify()
message = "Download and conversion complete.", notification.title = "yt2mp3"
app_icon = None, notification.message = "Download and conversion complete."
timeout = 3, notification.send()
) except:
print("Notification failed.")

View File

@@ -1,2 +1,2 @@
yt-dlp yt-dlp
plyer notify-py