summaryrefslogtreecommitdiff
path: root/bin/extra/magnet2torrent
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-03-11 11:07:59 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-03-11 11:07:59 +0100
commitbfeeb48f551dcef96819eb124aa72241656c393b (patch)
tree08b2cb0f684ca069397cabd6433ac70a47edbb86 /bin/extra/magnet2torrent
parent49461617903c19c98cadac9da510a011a524ff59 (diff)
refactor
Diffstat (limited to 'bin/extra/magnet2torrent')
-rwxr-xr-xbin/extra/magnet2torrent8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/extra/magnet2torrent b/bin/extra/magnet2torrent
index 0a1f83e..9f7d006 100755
--- a/bin/extra/magnet2torrent
+++ b/bin/extra/magnet2torrent
@@ -21,7 +21,11 @@ fi
hash="${1##*btih:}"
hash="${hash%%&*}"
+url="$(curl -s "https://torrage.info/torrent.php?h=$hash" |
+ pup '#torrent-operation-link attr{href}')"
+>&2 printf "url: %s\n" "$url"
+
# Download the torrent file from a torrent website
torrent_file="${hash}.torrent"
-wget "https://itorrents.org/torrent/${hash}.torrent" -O "$torrent_file"
-echo "Torrent file written to ${torrent_file}"
+curl "$url" -H 'Referer: https://torrage.info/' > tmp.torrent
+echo "$torrent_file"