From 9278aea5936de1d2e9fffbc1f55b7e072c836e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Wed, 28 Dec 2022 11:52:12 +0100 Subject: [PATCH] add forced to list of preserved track comments --- delete_track_titles.sh | 2 +- watch-magnets.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 watch-magnets.sh diff --git a/delete_track_titles.sh b/delete_track_titles.sh index 6f2d4de..d4cbd39 100755 --- a/delete_track_titles.sh +++ b/delete_track_titles.sh @@ -22,7 +22,7 @@ for TRACK in $TRACKS; do [[ $TRACK_NAME == "null" ]] && echo "has no title, skipping." && continue echo -n "currently set to $TRACK_NAME... " shopt -s nocasematch - [[ $TRACK_NAME =~ full|\stitles|comment|director|sdh|sign ]] && echo "includes whitelisted word, not deleting." && continue + [[ $TRACK_NAME =~ full|\stitles|comment|director|sdh|sign|forced ]] && echo "includes whitelisted word, not deleting." && continue echo -n "deleting... " # mkvmerge --identify indexes tracks from 0, while mkvpropedit indexes from 1 mkvpropedit "$FILE" --edit track:"$((TRACK+1))" --delete name &>/dev/null diff --git a/watch-magnets.sh b/watch-magnets.sh new file mode 100755 index 0000000..cb50f54 --- /dev/null +++ b/watch-magnets.sh @@ -0,0 +1,5 @@ +# command -v notify-send 1>/dev/null || echo "The \"notify-send\" command is not available. Aborting." && exit 1 +SAVEDIR=$(xdg-user-dir DOWNLOAD) +[[ "$1" =~ ^magnet ]] && notify-send -a "Clipboard Watcher" "Magnet URL copied to the clipboard." +aria2c -d "$SAVEDIR" --input-file <( echo "$1" ) --bt-metadata-only=true --bt-save-metadata=true +# TODO: spawn aria2c in a subshell in case a magnet link takes forever to load \ No newline at end of file