X-Git-Url: https://472bisson.ca/gitweb/magnet.git/blobdiff_plain/62e96b27b092c3c529f8da78b8e8548e058a834f..refs/heads/master:/index.php?ds=inline diff --git a/index.php b/index.php index 090c191..238a241 100644 --- a/index.php +++ b/index.php @@ -1,49 +1,132 @@ - - - - Torrage - - - - -

Torrage

-
- - -
- - Torrage - - Torcache -
- "; - if ($site == 'torrage') - { - $url = "http://torrage.com/torrent/" . $infohash . ".torrent"; - header('Location: ' . $url); //Internet - } - else - { - $url = "http://torcache.net/torrent/" . $infohash . ".torrent"; - header('Location: ' . $url); //Internet - } - } - else - { - echo "Invalid INFO_HASH"; - } - } - ?> - - \ No newline at end of file + $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; +} +?> + + + + Magnet + + + + + + + + +
+
+
+

Magnet Info

+
+
+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
+
+ +
+

Error : Infohash cannot be empty.

+
+ +
+

Error : Invalid Infohash.

+
+ +
+

+
+ +
+

Enter Some Torrent Info Hash

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