dotfiles/.local/bin/rtorrent-magnet

7 lines
219 B
Bash
Executable File

#!/bin/bash
watch_folder=~/rtorrent/watch/start
cd $watch_folder
[[ "$1" =~ xt=urn:btih:([^&/]+) ]] || exit;
echo "d10:magnet-uri${#1}:${1}e" > "meta-${BASH_REMATCH[1]}.torrent"
notify-send "rTorrent" "Torrent ajouté"