parent
d6a7b56bcf
commit
dc8c561576
12
download.py
12
download.py
@ -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__))
|
||||||
@ -29,12 +29,10 @@ 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)
|
||||||
try:
|
try:
|
||||||
notification.notify(
|
notification = Notify()
|
||||||
title = "yt2mp3",
|
notification.title = "yt2mp3"
|
||||||
message = "Download and conversion complete.",
|
notification.message = "Download and conversion complete."
|
||||||
app_icon = None,
|
notification.send()
|
||||||
timeout = 3,
|
|
||||||
)
|
|
||||||
except:
|
except:
|
||||||
print("Notification failed.")
|
print("Notification failed.")
|
||||||
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
yt-dlp
|
yt-dlp
|
||||||
plyer
|
notify-py
|
Loading…
x
Reference in New Issue
Block a user