]> 472bisson.ca Git - magnet.git/commitdiff
Added magnet.php
authorManjunath CV <cvmanjoo@gmail.com>
Thu, 6 Mar 2014 17:22:51 +0000 (22:52 +0530)
committerManjunath CV <cvmanjoo@gmail.com>
Thu, 6 Mar 2014 17:22:51 +0000 (22:52 +0530)
LICENSE.txt [moved from LICENSE with 100% similarity]
index.php
infohash.txt
magnet.php [new file with mode: 0644]
style.css

similarity index 100%
rename from LICENSE
rename to LICENSE.txt
index 3d30be87422fbe21f29de22da2ebe29b0f241b30..18644b2f4424f737a995017cc047fadd1ce920b8 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html>
+<html lang="en">
     <head>
         <title>Torrage</title>
         <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
             <span>Zoink</span>
         </form>                
         <?php
-        //http://torrage.com/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent
-        //http://torcache.net/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent
-        //http://zoink.it/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent
-
-        if (filter_has_var(INPUT_GET, 'infohash') && filter_has_var(INPUT_GET, 'site'))
+        /************************
+          http://torrage.com/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent
+          http://torcache.net/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent
+          http://zoink.it/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent
+        *************************/
+        if(filter_has_var(INPUT_GET, 'infohash') && filter_has_var(INPUT_GET, 'site'))
         {
             $infohash = filter_input(INPUT_GET, 'infohash');
             $site = filter_input(INPUT_GET, 'site');
-            if (strlen($infohash) == 40 && ctype_xdigit($infohash))
+            if(strlen($infohash) == 40 && ctype_xdigit($infohash))
             {
                 $infohash = strtoupper($infohash);
                 //echo "Debug:$url = ".$url."<br />";
-                if ($site == 'torrage')
+                if($site == 'torrage')
                 {
                     $url = "http://torrage.com/torrent/" . $infohash . ".torrent";
                     header('Location: ' . $url);  //Internet 
                 }
-                else if ($site == 'torcache')
+                else if($site == 'torcache')
                 {
                     $url = "http://torcache.net/torrent/" . $infohash . ".torrent";
                     header('Location: ' . $url);  //Internet 
@@ -49,7 +50,7 @@
             }
             else
             {
-                echo "<a>Invalid INFO_HASH</a>";
+                echo "<span>Invalid INFO_HASH</span>";
             }
         }
         ?>
index fbf486b9c263234be2405a4714c49bf8c1499e3d..3348e24ff9f102b4aaf96cdb2f7de306a20a7058 100644 (file)
@@ -2,11 +2,12 @@ http://torrage.com/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent
 http://torcache.net/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent
 http://zoink.it/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent
 
-
-
-
 ubuntu-13.10-desktop-i386.iso --> 597A92F6EEED29E6028B70B416C847E51BA76C38
-
 non exist --> 886D8CA336A8BBE7C1B19C8B5D23729496F7A48F
+xbmc-12.3.exe --> F948DD1E2A216B018FC3B5BA3FB4B1A63F61F06B
+
+http://mgnet.me/api.html
+magnet:?xt=urn:btih:FCB3DA0B7978EFC6157791D7B3224826FE749C09&dn=Nikita.1x01.(HDTV-LOL)&tr=udp://tracker.openbittorrent.com:80&tr=udp://tracker.publicbt.com:80&tr=udp://tracker.istole.it:80&tr=udp://open.demonii.com:80&tr=udp://tracker.coppersurfer.tk:80
 
-xbmc-12.3.exe --> F948DD1E2A216B018FC3B5BA3FB4B1A63F61F06B
\ No newline at end of file
+magnet:?xt=urn:btih:<info-hash>&dn=<name>&tr=<tracker-url>&ws=<webseed>
\ No newline at end of file
diff --git a/magnet.php b/magnet.php
new file mode 100644 (file)
index 0000000..1ad8c2f
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+if(filter_has_var(INPUT_GET, 'submit'))
+{
+    $infohash = filter_input(INPUT_GET, 'infohash');
+    $name = filter_input(INPUT_GET, 'tname');
+    $trackers = filter_input(INPUT_GET, 'trackers');
+
+    if(strlen($infohash) == 40 && ctype_xdigit($infohash))
+    {
+        $magnetlink = "magnet:?xt=urn:btih:" . $infohash;
+
+        if($name != "")
+        {
+            $magnetlink = $magnetlink . "&dn=" . $name;
+        }
+        if($trackers != "")
+        {
+            $magnetlink = $magnetlink . "&tr=" . $trackers;
+        }
+    }
+    //$magnetlink = "magnet:?xt=urn:btih:" .$infohash . "&dn=" . $name . "&tr=" . $trackers;
+}
+?>
+<!DOCTYPE html>
+<html lang="en">
+    <head>
+        <meta charset="utf-8" />
+        <link href="style.css" rel="stylesheet" type="text/css" />
+        <title>Magnet</title>
+    </head>
+    <body>
+        <form name="form1" method="get" action="#">
+
+            <label>Infohash</label>
+            <br>
+            <input type="text" name="infohash" placeholder="Hash of the Torrent" />
+            <br>
+
+            <label>Name</label>
+            <br>
+            <input type="text" name="tname" placeholder="Name of the Torrent" />
+            <br>
+
+            <label>Trackers</label>
+            <br>
+            <textarea rows="4" name="trackers">udp://tracker.openbittorrent.com:80/announce&#13;&#10;udp://tracker.publicbt.com:80/announce</textarea>
+            <br>
+            <input type="submit" name="submit" value="Create"/>
+        </form>
+
+        <span><?php echo $magnetlink; ?></span>
+        <br>
+        <a href = "<?php echo $magnetlink; ?>">Magnet Link</a>
+    </body>
+</html>
index 0dc3c839edf86f856fa68772fa853242a17bb292..34810554f5d2dd9f1ecddf766bae708bae57d569 100644 (file)
--- a/style.css
+++ b/style.css
@@ -1,34 +1,42 @@
 /* CSS layout */
 
-body{
-       margin: 5px;
-       padding: 5px;
-       font-family: monospace;
+body {
+    margin: 5px;
+    padding: 5px;
+    font-family: monospace;
 }
 
 input[type=text] {
-       width: 420px;
-       height: 30px;
-       padding: 1px;
-       
-       font-family:monospace;
-       font-size:large;
+    width: 420px;
+    height: 30px;
+    padding: 1px;
+
+    font-family:monospace;
+    font-size:large;
+}
+
+textarea {
+    width: 420px;
+    padding: 1px;
+
+    font-family:monospace;
+    font-size:medium;
 }
 
 input[type=submit] {
-               
-       font-family:monospace;
-       font-size:large;
-
-       border: 1px solid #777777;
-       background: #6e9e2d;
-       color: white;
-       font: bold 11px 'Trebuchet MS';
-       padding: 4px;
-       height: 30px;
-       cursor: pointer;
-       -moz-border-radius: 4px;
-       -webkit-border-radius: 4px;
+
+    font-family:monospace;
+    font-size:large;
+
+    border: 1px solid #777777;
+    background: #6e9e2d;
+    color: white;
+    font: bold 11px 'Trebuchet MS';
+    padding: 4px;
+    height: 30px;
+    cursor: pointer;
+    -moz-border-radius: 4px;
+    -webkit-border-radius: 4px;
 }
 
 /*