update
This commit is contained in:
parent
1b17f1b660
commit
8e8382aa88
1 changed files with 27 additions and 1 deletions
28
nicesong
28
nicesong
|
|
@ -1,3 +1,29 @@
|
|||
#!/bin/sh
|
||||
|
||||
yt-dlp --embed-metadata -x --audio-format aac -f bestaudio "ytsearch:$(playerctl -i firefox metadata --format '{{ artist }} - {{ title }}')" -o "~/Music/%(artist)s - %(title)s.%(ext)s"
|
||||
query="$(playerctl -i firefox metadata --format '{{ artist }} - {{ title }}')"
|
||||
|
||||
echo "Searching YouTube for:"
|
||||
echo " $query"
|
||||
echo
|
||||
|
||||
yt-dlp "ytsearch1:$query" \
|
||||
--print "━━━━━━━━━━━━━━━━━━━━━━━" \
|
||||
--print "Title: %(title)s" \
|
||||
--print "Artist: %(artist|Unknown)s" \
|
||||
--print "Track: %(track|Unknown)s" \
|
||||
--print "Channel: %(uploader)s" \
|
||||
--print "Duration: %(duration_string)s" \
|
||||
--print "Views: %(view_count)s" \
|
||||
--print "URL: %(webpage_url)s" \
|
||||
--print "━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
|
||||
echo
|
||||
read -p "Download this? [y/N] " confirm
|
||||
|
||||
if [[ "$confirm" =~ ^[Yy]$ ]]; then
|
||||
yt-dlp --embed-metadata -x --audio-format aac -f bestaudio \
|
||||
"ytsearch1:$query" \
|
||||
-o "~/Music/%(artist)s - %(title)s.%(ext)s"
|
||||
else
|
||||
echo "Aborted. You resisted entropy."
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue