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
User Posts

Go to Profile

Once a torrent is uploaded, its automatically scraped by reading the peer table after upload. The torrent announces within a few minutes from that point, stats are live.

External torrents are scraped by cleanup, or simply read on torrent detail page. You hardly notice the difference, but I use a world icon to indicate its not locally tracked.

I'll check that out! I like that it provides an immediate solution to external instead of waiting around for the system to catch up.


$tracker = !empty($arr['announce']) ? array(
   $arr['announce']
) : null;
$scrape  = new Scrape;
$stats   = array();
foreach ($scrape->scrape($row['info_hash'], $tracker) as $value) {
   array_push($stats, $value);
}
if ($scrape->has_errors() && $row['external'] == 'yes') {
   printf('<span>error</span> %s', $scrape->get_errors()[0]);
}
if (!empty($stats)) {
   echo intval($stats[0]['seeders']);
   echo intval($stats[0]['leechers']);
} else {
   echo $row['seeders'];
   echo $row['leechers'];
}
Oh I see, sorry I got 2 posts confused with each other (it keeps autoscrolling down)

Thats really weird, is your PASSKEY url config setting correct and enabled?

Even if its removing the announce field, it should not effect any of the encoding or other fields. It sounds like there are modifications to download.php already that may be effecting this mod.
scrape.php is seperatefrom download.php and should not effect the other one.

This file just acts as a peer report on the info hash. Its completely independent from any other files or functions.
signature — 2022-12-10 22:18:13 in v3 Support

function validate_image_url($string) {
 // Use a regular expression to search for [img] and [/img] tags in the string
 $pattern = '/\[img\](.+?)\[\/img\]/';

 // Check if the string contains the [img] and [/img] tags
 if (preg_match($pattern, $string, $matches)) {
   // Get the URL from the matches array
   $url = $matches[1];

   // Validate the URL using PHP's filter_var function
   if (filter_var($url, FILTER_VALIDATE_URL)) {
     // If the URL is valid, return the original string
     return $string;
   }
 }

 // If the URL is not valid or the [img] and [/img] tags were not found, return an empty string
 return '';
}


Here's how you could use this function:


// Check and validate the image URL
$result = validate_image_url(“[img] $row[signature] [/img]”);

// Print the result
echo $result;

Today my tracker is alive and very busy so I dont know.. I think our encryption is incompatible on some clients.

I added a INSERT query at the failure code, and this pulls up in 5 minutes



So something is wrong around the peer insert area or possible just before that. It have to trace user_id so I can match the failure hits and tie it to which user is being rejected (which should not be happening).

secret key is our encryption key exchange between the entire swarm. That should never fail, but I did update the key a while back so I think 2 torrents (red in seedbox) didnt catch the update.

Now I have to wonder what is kicking peers

UPDATE

2 fields not allowing NULL, was the issue. Bug is fixed. 70+ peers inserted right away lol
Which announce is working? The new one or the original one?
signature — 2022-12-09 17:33:37 in v3 Support
Is any global being checked for initialized state? - isset()

Use strlen($var) > 0

Instead of

!= ‘’

And that also lets you control input length. Also, using the != operator is slowing down your code. It checks the variable if a type conversion is needed internally. You know exactly what type (int, string, etc) you’re expecting from POST so use strict comparison !== instead. This is why you should use != on objects (type conversion).

C# is religious about this as well as C/C++ so PHP being compiled in C, the same rules apply just very loosely. PHP is a hybrid language.
Thanks MicroMonkey! I did that and it’s a lot better now.

I got a lot of messages about “data counter incorrect” or simply “info hash not found”.

I think that ternary check on the passkey is causing problems conditionally. Yet no passkey errors in sql logger? So weird.

Saturday morning I will dedicated 6 hours for this bug alone and find out why. I now have to offer a “global stats reset” option for users now to curb the ‘what the hell’ effect.

I mean… how does one actually deduct!?


$downloaded = max(0, $data[‘downloaded’] - $peer_row[‘downloaded’]);


Is this wrong?
It appears that I am encountering this same issue on my tracker which makes no sense. This requires further investigation.
@Botanicar - Oh, is this a PhpMyAdmin theme? That is slick! I like it. I use HeidiSQL but that’s good to know! Thanks!
Memcaching will help, however your must flush the bucket on every torrent index update (like uploading a torrent, editing etc). Trust me.. offer this as a user option. Let them decide. It’s very useful for asynchronous code - AJAX etc

Static media will slow things down due to the bandwidth consumption and resources being resolved and distributed. Personally, switching to WebP or AVIF will reduce bandwidth considerably, but ideally you want to implement static cache too on a load balanced configured for NGINX/FPM

Make final changes to your main CSS file. Compress it and upload. You might save 100KB ;)

JS too.. pack it. Use jQuery 3.6.1 minified and declare that your final version (they’re not really supporting it anymore. Just rare security updates).

Finally your PHP code. Which is bad. The entire V3 code is just way old and the opposite of compact. Everything is spaghetti. Take that as age of maturity, but still operates surprising well even today.

Rewrite the thing (it takes a lol)
signature — 2022-12-08 03:52:14 in v3 Support
Then you should run a query that pulls that field out, and work with the variable.

Writing a query is fairly easy. And even easier with no parameters to prepare.


$test = SQL_Query_exec(“SELECT signature FROM users WHERE id = $CURUSER[id]”);
if ($user = mysqli_fetch_assoc($test)) {
  echo $user[‘signature’];
}
Losing a bit of interest on this, namely the unusual occurrences.

I’ll try to get a test torrent going today on the local install and see to getting this working properly. If it’s stuck at passkey, then something is not reading the GET requests for some reason.

Hopefully after passkey, we can go right through successfully. I know the code quite well so I am fully experienced as far as that goes.

Man, where do you get a nice GUI like that? Possible for dedicated server / NGINX?
signature — 2022-12-03 22:14:28 in v3 Support
I think I understand now. I use something similar to verify mimetypes using finfo() class (SPL stack).

But in your case, you want to validate url extension (https://blahblah.com/pic.jpg) and allow embedding, or else show "invalid file type" error.


$signature = '';
$parts = parse_url($row['signature']);
$extension = pathinfo($parts['path'], PATHINFO_EXTENSION);
if (in_array($extension, array('jpg', 'png', 'jpeg'))) {
  $signature = trim($row['signature']);
} else {
  // throw a error message
}
signature — 2022-12-02 18:52:16 in v3 Support
Its best to accept local images and validate before and after as apposed to linking a image url and having it redirect to some other website.

This way, you can check the image headers, mimetype, this that etc without allowing a potential risk. I dont allow it for a similar reason.
Error and access logs grow every day, if you mean server logs.

That would be at server-level. As for the script, I really dont know - I didn’t use any of its logging at any time as it was vague.
The error is telling you the tracker url may be incorrect or simply offline. Have you verified this?
$stats[] should be the decoded array. Calling $stats[‘files’] should be valid, however it is an array too. So the return should be an array that is enumerable.

The code looks correct.

I think the class is too old. Was this scraper included with your install?
Message Encryption — 2022-11-28 17:10:20 in v3 Mods Completed
First, generate your keys. Create genkeys.php and upload to root


<?php
echo base64_encode(openssl_random_pseudo_bytes(32)); // first key
echo base64_encode(openssl_random_pseudo_bytes(64)); // second key


Get to yourtracker.com/genkeys.php

Open /backend/config.php and add your keys


define('key_primary', 'YOUR_FIRST_GENERATED_KEY');
define('key_secondary', 'YOUR_SECOND_GENERATED_KEY');


Open mailbox-functions.php and add


function encryptMessage(string $data): string
{
   $primary_key      = base64_decode(key_primary);
   $secondary_key    = base64_decode(key_secondary);
   $method           = "AES-256-CBC";
   $iv_length        = openssl_cipher_iv_length($method);
   $iv               = openssl_random_pseudo_bytes($iv_length);
   $first_encrypted  = openssl_encrypt($data, $method, $primary_key, OPENSSL_RAW_DATA, $iv);
   $second_encrypted = hash_hmac('SHA3-512', $first_encrypted, $secondary_key, true);
   $output           = base64_encode($iv . $second_encrypted . $first_encrypted);
   return $output;
}
function decryptMessage(string $input): mixed
{
   $first_key            = base64_decode(key_primary);
   $second_key           = base64_decode(key_secondary);
   $mix                  = base64_decode($input);
   $method               = "AES-256-CBC";
   $iv_length            = openssl_cipher_iv_length($method);
   $iv                   = substr($mix, 0, $iv_length);
   $second_encrypted     = substr($mix, $iv_length, 64);
   $first_encrypted      = substr($mix, $iv_length + 64);
   $data                 = openssl_decrypt($first_encrypted, $method, $first_key, OPENSSL_RAW_DATA, $iv);
   $second_encrypted_new = hash_hmac('SHA3-512', $first_encrypted, $second_key, true);
   if (hash_equals($second_encrypted, $second_encrypted_new))
       return $data;
   return false;
}


Open mailbox.php and find


$display = "<div>".format_comment($arr['msg'])."<br /><br />";


Replace with


$display = $arr['encrypted'] === 'yes' ? "<div>".format_comment(decryptMessage($arr['msg']))."<br /><br />" : "<div>".format_comment($arr['msg'])."<br /><br />";


Find


SQL_Query_exec("INSERT INTO `messages` (`sender`, `receiver`, `added`, `subject`, `msg`, `unread`, `location`) VALUES ('$CURUSER[id]', '$sendto', '".get_date_time()."', $subject, $msg, '$status', '$to')") or die("Aargh!");


Replace with


$encrypted = (isset($_POST['encrypt']) && intval($_POST['encrypt']) === 1) ? 'yes' : 'no';
$msg = (isset($_POST['encrypt']) && intval($_POST['encrypt']) === 1) ? encryptMessage($msg) : $msg;
$subject = (isset($_POST['encrypt']) && intval($_POST['encrypt']) === 1) ? encryptMessage($subject) : $subject;
SQL_Query_exec("INSERT INTO `messages` (`encrypted`, `sender`, `receiver`, `added`, `subject`, `msg`, `unread`, `location`) VALUES ('$encrypted', '$CURUSER[id]', '$sendto', '".get_date_time()."', $subject, $msg, '$status', '$to')") or die("Aargh!");


Find


if (!isset($_GET['templates'])) $output .= "<input type=\"submit\" name=\"send\" value=\"Send\" /> <label><input type=\"checkbox\" name=\"save\" checked='checked' />Save Copy In Outbox</label>    <input type=\"submit\" name=\"draft\" value=\"Save Draft\" /> ";


Replace with


if (!isset($_GET['templates'])) $output .= "<input type=\"submit\" name=\"send\" value=\"Send\" /> <label><input type=\"radio\" name=\"encrypt\" value="1" />Encrypt Message <input type=\"checkbox\" name=\"save\" checked='checked' />Save Copy In Outbox</label> <input type=\"submit\" name=\"draft\" value=\"Save Draft\" /> ";


Finally, run SQL


ALTER TABLE messages ADD COLUMN encrypted ENUM('yes','no') NULL DEFAULT 'no';

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