2 Commits

Author SHA1 Message Date
20xd6 5ff3842e2c Adds a basic notification on completion
This is for issue #6.
2023-09-13 22:28:47 -04:00
20xd6 ec7e2036fb Merge pull request 'Python conversion' (#2) from issue#1 into master
Reviewed-on: #2
2023-09-13 18:58:01 -04:00
2 changed files with 14 additions and 7 deletions
+11 -5
View File
@@ -1,4 +1,5 @@
import yt_dlp as yt import yt_dlp as yt
from plyer import notification
def get(yt_url): def get(yt_url):
ytdl_options = { ytdl_options = {
@@ -12,17 +13,22 @@ def get(yt_url):
'embed_metadata': True, 'embed_metadata': True,
'format': 'any/bestaudio/best', 'format': 'any/bestaudio/best',
# ️ See help(yt_dlp.postprocessor) for a list of available Postprocessors and their arguments # ️ See help(yt_dlp.postprocessor) for a list of available Postprocessors and their arguments
'postprocessors': [{ # Extract audio using ffmpeg 'postprocessors': [{ # Extract audio using ffmpeg,
'key': 'FFmpegMetadata'
},{
'key': 'FFmpegExtractAudio', 'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3', 'preferredcodec': 'mp3',
},{'key': 'FFmpegMetadata'},
}] {'key': 'EmbedThumbnail'},]
} }
with yt.YoutubeDL(ytdl_options) as ytdl: with yt.YoutubeDL(ytdl_options) as ytdl:
ytdl.download(yt_url) ytdl.download(yt_url)
notification.notify(
title = "yt2mp3",
message = "Download and conversion complete.",
app_icon = None,
timeout = 5,
)
def dl_progress(d): def dl_progress(d):
+1
View File
@@ -1 +1,2 @@
yt-dlp yt-dlp
plyer