I use this on my seedbox for anything sonarr grabs and sends to my blackhole that is a .magnet file rather than .torrent.

#!/bin/bash
File="$(find /PATH/TO/MAGNET/FILES -name '*.magnet' -print -quit)"
set -- $File
Filecontents="$(cat "$File")"
set -- $Filecontents
cd /PATH/TO/MAGNET/FILES
[[ "$Filecontents" =~ xt=urn:btih:([^&/]+) ]] || exit;
echo "d10:magnet-uri${#1}:${1}e" > "meta-${BASH_REMATCH[1]}.torrent"
rm "$File"
No comments yet!

Useful Scripts

!useful_scripts@lemmy.ml

Create post

Any kind of scripts that are useful… nothing malicious please.

Please prefix your post with the script language or some kind of indication of the platform it’s for.

Community stats

  • 1

    Monthly active users

  • 3

    Posts

  • 0

    Comments

Community moderators