From 55f4092e3530318fad1d654bb806b044af712ba7 Mon Sep 17 00:00:00 2001 From: gor_down Date: Tue, 14 Jan 2025 04:57:34 -0300 Subject: [PATCH] script --- .scripts/ytdl-song-upload.sh | 8 +++++--- ...ytdl_yt_link_upload_to_catbox_and_copy_to_clipboard.sh | 7 +++++++ 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100755 .scripts/ytdl_yt_link_upload_to_catbox_and_copy_to_clipboard.sh diff --git a/.scripts/ytdl-song-upload.sh b/.scripts/ytdl-song-upload.sh index 0230026..be7e7ae 100755 --- a/.scripts/ytdl-song-upload.sh +++ b/.scripts/ytdl-song-upload.sh @@ -1,5 +1,7 @@ mkdir ~/.tmp cd ~/.tmp -FILENAME="$(yt-dlp --extract-audio --audio-format mp3 --print filename "$1")" -catboxupload "$FILENAME" -rm "$FILENAME" +clipboard=$(xclip -o) +output=$(yt-dlp --extract-audio --audio-format mp3 "$clipboard") +filename=$(echo "$output" | grep -oP '(?<=Destination: ).+\.mp3') +catboxupload "$filename" +rm "$filename" diff --git a/.scripts/ytdl_yt_link_upload_to_catbox_and_copy_to_clipboard.sh b/.scripts/ytdl_yt_link_upload_to_catbox_and_copy_to_clipboard.sh new file mode 100755 index 0000000..be7e7ae --- /dev/null +++ b/.scripts/ytdl_yt_link_upload_to_catbox_and_copy_to_clipboard.sh @@ -0,0 +1,7 @@ +mkdir ~/.tmp +cd ~/.tmp +clipboard=$(xclip -o) +output=$(yt-dlp --extract-audio --audio-format mp3 "$clipboard") +filename=$(echo "$output" | grep -oP '(?<=Destination: ).+\.mp3') +catboxupload "$filename" +rm "$filename"