this post was submitted on 20 Jun 2023
1 points (100.0% liked)

Useful Scripts

2 readers
0 users here now

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.

founded 2 years ago
MODERATORS
 

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)
sorted by: hot top controversial new old
there doesn't seem to be anything here