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
Checking Tracker on Upload
Controls ·  Search New posts · Mark unread

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

2020-02-27 01:58:41
Hey everyone,

I'm trying to check against the parsed .torrent on torrents-upload.php as it fails to consider passkey in [color=rgb(251, 160, 38)]$site_config['announce_list'] [/color][color=rgb(204, 204, 204)]so anything we upload using our own announce url (our own domain), it fails to check
if it is anyway different from announce_list, which means uploads are ALWAYS flagged as "external" which they are not and hold no other backup trackers. Every line of config is in tact, and I take that file seriously.[/color]

I can not figure out for the life of me how to do a simple check on our domain against the array. Thrown maybe 6 different solutions at it, and no dice. var_dump is helpful but I just can't call my function correctly, or any other
way of doing this.

Problem:
Upload private torrent (with our announce url). Thinks it is external, and does just that. .torrent metadata confirmed. Makes no sense.

Desired Solution:
Upload a private torrent and see it as non-external. To not fail on domain validity (what the hell?)

I've tried:


var_dump(CheckTracker());

   function CheckTracker($domain){ // returns true on domain, or false on domain
   
   $domain = "http://website.com/announce";
   if (preg_match('{^http://[\w\.]*website.com/}i', $domain)) {
          return true;    // domain is a match from what is seen in .torrent in any pattern.
   } else {
          return false;    // domain is a NOT match from what is seen in .torrent in any pattern.
          }
  // return; // <- this returns the full url of current page
   }


And further on torrents-upload.php


        $TorrentInfo  = array();
       $TorrentInfo  = ParseTorrent("$torrent_dir/$fname");
       $announce     = $TorrentInfo[0];
       $infohash     = $TorrentInfo[1];
       $creationdate = $TorrentInfo[2];
       $internalname = $TorrentInfo[3];
       $torrentsize  = $TorrentInfo[4];
       $filecount    = $TorrentInfo[5];
       $annlist      = $TorrentInfo[6];
       $comment      = $TorrentInfo[7];
       $filelist     = $TorrentInfo[8];
   
       if (!in_array($announce, CheckTracker($annlist) === false)) {
       
       $external = 'yes';
   
       } else {
   
           $external = 'no';
      }
       


CheckTracker() has had many different passes, with and without a variable. The function echo perfectly fine, both on false/true/string. How to pass it over to the array check??
true, false, string.. doesn't matter. It almost entirely ignores it.

See, I'm trying to bypass the announce_list config variable because thats how this started. So I'm trying to jump in before it checks that, to validate our announce url using preg_match(). Anyone know what I'm missing here?

The reason for all of this mess is because this does not work:

site_config['PASSKEYURL'] =  "$site_config[announce_list]?passkey=%s";


Because that parameter will never pass over, and lack of feedback on StackOverflow only adds to the mystery. Pissing me off.. does this line above even work for anybody?
2020-02-27 05:21:00
my line in config is
$site_config[SITEURL]/announce.php?passkey=%s

Also do you have ssl and the siteurl matches the announce address having https in one and not the other would cause that error
2020-02-27 10:17:01
The first post was a really poor way of doing this, I've done something a lot better that allows AJAX to auto-update the torrent on first and only page view. This makes a lot more sense. Try it if you like, I couldn't find another way.

I'll be using this proudly - [color=rgb(235, 107, 86)]torrents-details.php[/color]
// Condition: ALL torrents are now external by default on upload.
// Fix: Detect if torrent is external, match table url to private announce ($domain), generate passkey, update table - Feb 26, 2020

if ($row["external"] = 'yes' && $CURUSER["control_panel"]=="yes") { // Admin only

   $matches = [];
   $domain = 'http://www.website.com/announce?passkey=' . substr(md5($row['name']), 17, 20);
   if (preg_match('{^http://[\w\.]*website.com/}i', $row["announce"], $matches)) {
      SQL_Query_exec("UPDATE torrents SET external='no', announce=" . sqlesc($domain) . " WHERE id=$id");
   }
}
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: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728