From: Manjunath CV Date: Thu, 23 Apr 2020 19:25:36 +0000 (+0530) Subject: A Complete Refresh X-Git-Url: https://472bisson.ca/gitweb/magnet.git/commitdiff_plain/c0adce5f9b064b542725bc661737678311bd7479 A Complete Refresh --- diff --git a/README.md b/README.md index a96e7a1..98ec99d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,14 @@ -torrage -======= +# Hash to Magnet -PHP script to generate .torrent file from info_hash -That is pulling .torrents file from http://torrage.com +Web tool to generate magnet URI from Torrent Hash. + +# Parameters + +* Magnet Hash (Required) +* Name of Torrent (Optional) +* Trackers (Optional) +* Webseeds (Optional) + +# Resources +1. Bittorrent Protocol http://bittorrent.org/beps/bep_0053.html +2. CSS Design - https://www.w3schools.com/w3css/ diff --git a/index.php b/index.php index bda4744..6f9e740 100644 --- a/index.php +++ b/index.php @@ -4,20 +4,35 @@ 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 != "") + $webseeds = filter_input(INPUT_GET, 'webseeds'); + + if(strlen($infohash) == 0) + { + $error_code = 1; + } + else if(strlen($infohash) == 40 && ctype_xdigit($infohash)) { - $magnetlink = $magnetlink . "&tr=" . $trackers; + $magnetlink = "magnet:?xt=urn:btih:" . $infohash; + + if($name != "") + { + $magnetlink = $magnetlink . "&dn=" . $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=" . $name . "&tr=" . $trackers; } ?> @@ -27,47 +42,84 @@ if(filter_has_var(INPUT_GET, 'submit')) Magnet + + + + + -
-
-

Magnet Info

+
+
+
+

Magnet Info

+
+
+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
-
-

- - -

-

- - -

-

- - -

-

- - -

-
-
- +
+

Error : Infohash cannot be empty.

+
+ +
+

Error : Invalid Infohash.

+
+ -
+

-
+
-
+

Enter Some Torrent Info Hash

-
+
- + + + \ No newline at end of file diff --git a/infohash.txt b/infohash.txt deleted file mode 100644 index 36e2399..0000000 --- a/infohash.txt +++ /dev/null @@ -1,14 +0,0 @@ -http://torrage.com/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent -http://torcache.net/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent -http://zoink.it/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent -http://istoretor.com/t/640FE84C613C17F663551D218689A64E8AEBEABE - -ubuntu-13.10-desktop-i386.iso --> 597A92F6EEED29E6028B70B416C847E51BA76C38 -non exist --> 886D8CA336A8BBE7C1B19C8B5D23729496F7A48F -xbmc-12.3.exe --> F948DD1E2A216B018FC3B5BA3FB4B1A63F61F06B - -http://mgnet.me/api.html - -magnet:?xt=urn:btih:E07744C839318F95DADC57809F11465A2D26EE73&dn=Non+Stop+2014+1080p+Trailer&tr=udp://tracker.openbittorrent.com:80/announce&tr=udp://open.demonii.com:1337&ws=http://videos.hd-trailers.net/nonstop-tlr1_h1080p.mov - -magnet:?xt=urn:btih:&dn=&tr=&ws= \ No newline at end of file diff --git a/magnet.html b/magnet.html new file mode 100644 index 0000000..7623c72 --- /dev/null +++ b/magnet.html @@ -0,0 +1,47 @@ + + + + Magnet + + + + + + + +
+
+

Magnet Info

+
+
+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
+
+ + + \ No newline at end of file diff --git a/magnet.png b/magnet.png new file mode 100644 index 0000000..97480df Binary files /dev/null and b/magnet.png differ diff --git a/style.css b/style.css new file mode 100644 index 0000000..b500007 --- /dev/null +++ b/style.css @@ -0,0 +1,39 @@ + +/* + Created on : 10 Jun, 2018, 9:23:39 PM + Author : Manjunath CV +*/ + +@import url('https://fonts.googleapis.com/css2?family=Roboto&family=Roboto+Mono&display=swap'); + +body { + font-family: 'Roboto', sans-serif; + +} + +#magnet { + font-family: 'Roboto Mono', monospace; +} + +section { + margin: auto; + width: 850px; +} + +footer { + width:100%; + text-align: center; +} + + + +/* Responsive layout - makes the two columns/boxes + stack on top of each other instead of next to + each other, on small screens */ +@media (max-width: 850px) { + section { + width: 95%; + } + + +}