Torrent link (magnet) with counter

2

Hi, can you download magnet links via php like normal mode?

I need to count how many times the file has been downloaded. I tried fopen() , file_get_contents() and header("Location: ") , which also did not work:

Warning: fopen() expects at least 2 parameters, 1 given in C:\xampp\htdocs\gamepatch\download2.php on line 4

and also

Warning: file_get_contents(magnet:?xt=urn:btih:ed4fad95b4cb): failed to open stream: No such file or directory in C:\xampp\htdocs\gamepatch\download2.php on line 4

Attempt:

<?php
   include "bd_connect.php";

   $arquivo = $_GET["arquivo"];
   header("Location: $arquivo");
?>
    
asked by anonymous 12.04.2014 / 05:49

1 answer

6

The link page looks like this:

<?php
   $link = urlencode( 'magnet:?xt=urn:btih:ed4fad95b4cb' );
   echo '<a href="contador.php?link='.$link.'">Clique para baixar</a>'
?>

And the page contador.php , like this:

<?php
   $link=$_GET['link'];
   ... código do seu contador vai aqui ...
   header( "Location: $link" );

?>

From these templates, you just have to add the desired logic or link database in the pages of the download links and the counter.

    
12.04.2014 / 06:10