Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
download problem
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

2022-11-14 00:59:03
I have a problem when i download extern torrent it works , but when i download local torrent it says

Quote:
Error: file is not a .torrent.



but when i change in download.php  $row["external"]!='yes' to 'no'

if ($row["external"]!='yes' && $site_config["MEMBERSONLY"]){// local torrent so add passkey


then local torrents are working and external torrents are not working

Thanks in advance
Last edited by djlive on 2022-11-14 00:59:45
2022-11-14 10:01:24
I assume you mean about extent torrent in the source code:


//if user dont have a passkey generate one, only if tracker is set to members only
if ($site_config["MEMBERSONLY"]){
if (strlen($CURUSER['passkey']) != 32) {
$rand = array_sum(explode(" ", microtime()));
$CURUSER['passkey'] = md5($CURUSER['username'].$rand.$CURUSER['secret'].($rand*mt_rand()));
SQL_Query_exec("UPDATE users SET passkey='$CURUSER[passkey]' WHERE id=$CURUSER[id]");
}
}

if ($row["external"]!='yes' && $site_config["MEMBERSONLY"]){    // local torrent so add passkey
$dict = BDecode(file_get_contents($fn));
$dict['announce'] = sprintf($site_config["PASSKEYURL"], $CURUSER["passkey"]);
unset($dict['announce-list']);

   $data = BEncode($dict);
   
header('Content-Disposition: attachment; filename="'.$name.'"');

header("Content-Type: application/x-bittorrent");

print $data;

}else{        // external torrent so no passkey needed
 
header('Content-Disposition: attachment; filename="'.$name.'"');

   header('Content-Length: ' . filesize($fn));  
   
header("Content-Type: application/x-bittorrent");

readfile($fn);
}





www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Last edited by Botanicar on 2022-11-14 10:03:18
2022-11-14 10:08:53
thx Botanicar looks like with your code works
2022-11-14 10:14:42
I'm happy to help but the code is not mine you have MicroMonkey to thank for this

PS
Selv tak



www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2022-11-15 21:59:11
ok looks like i have other issue   when extern it is not enter my announce on the torrent in qbit

if its like its is extern is not adding the passkey
Last edited by djlive on 2022-11-15 22:07:07
2022-11-15 22:28:07
Test that combination:


//if user dont have a passkey generate one, only if tracker is set to members only
if ($site_config["MEMBERSONLY"]){
       if (strlen($CURUSER['passkey']) != 32) {
       $rand = array_sum(explode(" ", microtime()));
       $CURUSER['passkey'] = md5($CURUSER['username'].$rand.$CURUSER['secret'].($rand*mt_rand()));
       SQL_Query_exec("UPDATE users SET passkey='$CURUSER[passkey]' WHERE id=$CURUSER[id]");
       }
}

// local torrent so add passkey

if ($row["external"]!='yes' && $site_config["MEMBERSONLY"]) {    
       $dict = BDecode(file_get_contents($fn));
       $dict['announce'] = sprintf($site_config["PASSKEYURL"], $CURUSER["passkey"]);
       unset($dict['announce-list']);

       $data = BEncode($dict);

       header('Content-Disposition: attachment; filename="'.$name.'"');

       header('Content-Length: ' . strlen($data));

       header("Content-Type: application/x-bittorrent");

       print $data;

}
else
{    
// external  torrent so add passkey

       $data[ ] = Array( sprintf( $site_config['PASSKEYURL'], $CURUSER['passkey'] ) );

       $dict = BDecode( file_get_contents( $fn ) );

if ( ! ( is_array( $dict[ 'announce-list' ] ) ) )
  {
       $dict[ 'announce-list' ][ ] = Array( $dict[ 'announce' ] );
  }

       $dict[ 'announce-list' ] = array_reverse( array_merge( $dict[ 'announce-list' ], $data ) );

       header('Content-Disposition: attachment; filename="'.$name.'"');

       header('Content-Length: ' . filesize($fn));

       header("Content-Type: application/x-bittorrent");

       readfile($fn);

       echo BEncode($dict);
}



www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Last edited by Botanicar on 2022-11-15 22:30:10
2022-11-15 22:32:39
UPDATE : its not working with that code but i think i managed to do it i think so thank you ill do some test to see


thanks i managed to do it but ill try your combinatio also i`m afraid not to make a hole thank you for quick answer

mange tak
Last edited by djlive on 2022-11-15 22:42:06
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728