X-Git-Url: https://472bisson.ca/gitweb/magnet.git/blobdiff_plain/b66caf1dce9526aeece6d22dc82382475cb02722..refs/heads/master:/index.php diff --git a/index.php b/index.php index 0838e17..238a241 100644 --- a/index.php +++ b/index.php @@ -1,71 +1,132 @@ "; - if($site == 'torrage') - { - $url = "http://torrage.com/torrent/" . $infohash . ".torrent"; - header('Location: ' . $url); //Internet - } - else if($site == 'torcache') - { - $url = "http://torcache.net/torrent/" . $infohash . ".torrent"; - header('Location: ' . $url); //Internet - } - else if($site == 'istoretor') - { - $url = "http://istoretor.com/fdown.php?hash=" . $infohash . ".torrent"; - header('Location: ' . $url); //Internet - } - else - { - $url = "http://zoink.it/torrent/" . $infohash . ".torrent"; - header('Location: ' . $url); //Internet - } - } - else - { - echo "Invalid INFO_HASH"; - } + $infohash = filter_input(INPUT_GET, 'infohash'); + $tor_name = filter_input(INPUT_GET, 'tname'); + $trackers = filter_input(INPUT_GET, 'trackers'); + $webseeds = filter_input(INPUT_GET, 'webseeds'); + + $infohash = strtoupper($infohash); + + if(strlen($infohash) == 0) + { + $error_code = 1; + } + else if(strlen($infohash) == 40 && ctype_xdigit($infohash)) + { + $magnetlink = "magnet:?xt=urn:btih:" . $infohash; + + if($tor_name != "") + { + $magnetlink = $magnetlink . "&dn=" . $tor_name; + } + if($trackers != "") + { + $trackers = str_replace("\r","&tr=",$trackers); + $trackers = str_replace(" ","&tr=",$trackers); + $magnetlink = $magnetlink . "&tr=" . $trackers; + } + if ($webseeds != "") + { + $magnetlink = $magnetlink . "&ws=" . $webseeds; + } + } + else + { + $error_code = 2; + } + //$magnetlink = "magnet:?xt=urn:btih:" .$infohash . "&dn=" . $tor_name . "&tr=" . $trackers; } ?> - - Torrage - - - - -

Torrage

-
- - -
- - Torrage - - Torcache - - Zoink - - iStoreTor -
-
-
- Create Magnet link - - - - \ No newline at end of file + + Magnet + + + + + + + + +
+
+
+

Magnet Info

+
+
+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
+
+ +
+

Error : Infohash cannot be empty.

+
+ +
+

Error : Invalid Infohash.

+
+ +
+

+
+ +
+

Enter Some Torrent Info Hash

+
+ +
+ + + \ No newline at end of file