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

Seed time — 2023-08-06 17:05:33 in General Chat
It makes no difference what GET parameters the seedbox sends compared to a typical client PC. Its the exact same parameters that are read from /announce and stored into database table.

Seedboxes (rtorrent/libtorrent) respect the typical intervals, supports the interval extensions (im not sure if TTv3 does), and should offer no issues.

Bad coding.

I did this for all my endpoints.

/index/<whatever it is>/
/user<same idea>/

etc etc
Make your empty parameters to ALLOW NULL, that way it auto-fills with a default value with the absence of filled parameters. This is make much shorter queries, will handle issues by itself, and will be easier to follow the SQL from a birds eye view.
Error sql — 2023-07-25 15:41:38 in v3 Support
Are you using my v4 or TTxx announce file?
Error sql — 2023-07-23 01:15:16 in v3 Support
This is classic overflow behavior.

What happens, is if for some reason 1 or more values end up representing a negative value, and if not handled will produce a problem in most languages when expecting a non-negative integer.


$upthis = max(0, $data['uploaded'] - $peer_row['uploaded']);
$downthis = max(0, $data['downloaded'] - $peer_row['downloaded']);


This is how I handle it.
presentation too long — 2023-07-14 17:24:55 in v2.08 Support
Sounds like a htmlentities issue. TTv3 never considered this, and it should of for security and preventing table corruption.

What you can do is get into torrents-upload.php and look for the INSERT statement, but focus on $body variable or whatever its called, and wrap it with htmlentities.

example:

$descr = htmlentities($_POST['descr'])

torrents-details:

html_entity_decode($row['descr'])

These do not account for sanitizing. Its just to deal with entities.

The reason is, internally in MySQL the engine performs read/write operations using backticks ` (actually called a grave accent).

So often what happens, is a foreign language will also contain the same ` in format. What this causes is a table crash.

Because now `a is now overriding the SELECT `blah` FROM table - and confusing the engine causing a failure.

Your MySQL log will probably tell you this right away. You should always review your database logs, dont rely on TTv3 - get into the real logs. Thats where the clarity will unfold toward resolution.
presentation too long — 2023-07-13 17:12:51 in v2.08 Support
What you need to do is change torrents.descr from VARCHAR(255) to LONGTEXT.

VARCHAR has a char limit of 255. Your description (text file) is actually 13782 chars.

This will never work. You need to change the column type to LONGTEXT if you want long descriptions like these.

Use LONGTEXT instead of TEXT to futureproof your description content.
up
In general, if you require more advanced socket functionalities or need to work with different types of sockets (TCP, UDP, Unix domain sockets), stream_socket_client provides more flexibility.

However, if you have a simple use case and only need to establish a TCP/IP socket connection, fsockopen can be a more straightforward option.

Allows connection retry (3 times / peer), TLS options, async (non-blocking) and flexible.
This returns a string "yes" or "no".

PHP 7.4+

function getConnectable(string $ip, int $port): string
{
$options = array(
'ssl' => array(
'verify_peer' => true,
'verify_peer_name' => true,
'allow_self_signed' => false,
'disable_compression' => true
),
'socket' => array(
'backlog' => 128,
'bindto' => '0:0'
),
);

$context = stream_context_create($options);
$timeout = 5;

$retryAttempts = 3;
$retryDelay = 1; // in seconds

$connected = false;
$attempt = 1;

while (!$connected && $attempt <= $retryAttempts) {
$socketerr = "Attempt $attempt";
$socket = @stream_socket_client("tcp://$ip:$port", $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT, $context);

if (is_resource($socket)) {
$sockets = array($socket);
$write = array($socket);
$except = array();

$numChanged = stream_select($sockets, $write, $except, $timeout);

if ($numChanged === false) {
$socketerr = "Error occurred during stream_select";
} else if ($numChanged === 0) {
$socketerr = "Connection timed out";
} else {
$connected = true;
$socketerr = "Connection successful";
}
} else {
$socketerr = "Connection failed: $errstr (Error $errno)";
}

if (!$connected && $attempt < $retryAttempts) {
sleep($retryDelay);
}

$attempt++;
}

// errors: $socketerr
return $connected ? 'yes' : 'no';
}


Usage:
$connectable = getConnectable($ip, $port);
Try this:


SELECT DISTINCT (SELECT COUNT(id) FROM torrents WHERE owner = u.id) AS total,
u.modcomment, u.username
FROM torrents t
LEFT JOIN users u ON u.id= t.owner
WHERE t.owner = u.id
AND t.added >= DATE_SUB(CURRENT_DATE, INTERVAL 2 DAY)


Sub-query, because you reduce your dataset if you call on a direct count statement. And use COUNT(id) to use a primary index, which is faster as the user table grows, includes correct calculation for determining the criteria against all users found. DISTINCT because we filter duplicate rows in absence of GROUP BY, just for demonstration.
doesn't show/hide just modifiy the fields type attribute to from 'text' to 'password', and vise versa?


<!DOCTYPE html>
<html>
<head>
 <title>Toggle Input Type</title>
 <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
 <form>
   <input type="text" id="myInput" />
   <br />
   <button id="toggleBtn">Toggle</button>
 </form>

 <script>
   $(document).ready(function() {
     $("#toggleBtn").click(function(e) {
 e.preventDefault();
       var inputType = $("#myInput").attr("type");

       if (inputType === "text") {
         $("#myInput").attr("type", "password");
       } else if (inputType === "password") {
         $("#myInput").attr("type", "text");
       }
     });
   });
 </script>
</body>
</html>
Good choice!
I like your design style. I use top/bottom borders too in a container with a border-radius, makes for a clean look. Looks good! 👍
Icon on file list — 2023-06-27 14:57:16 in Old v2 Tpoics
I started giving notice on certain file types too, best to keep users safe
Icon on file list — 2023-06-25 18:37:07 in Old v2 Tpoics
This should be a lot faster with less checking involved


if ($ext !== false) {
 switch ($ext) {
   case 'mp3':
   case 'FMP3':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/mp3.png>";
     break;
   case 'flac':
   case 'FLAC':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/flac.png>";
     break;
   case 'mp4':
   case 'MP4':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/mp4.png>";
     break;
   case 'm3u':
   case 'M3U':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/m3u.png>";
     break;
   case 'pdf':
   case 'PDF':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/pdf.png>";
     break;
   case 'jpg':
   case 'JPG':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/jpg.png>";
     break;
   case 'png':
   case 'PNG':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/png.png>";
     break;
   case 'txt':
   case 'TXT':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/txt.png>";
     break;
   case 'lng':
   case 'LNH':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/lng.png>";
     break;
   case 'btskin':
   case 'BTSKIN':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/btskin.png>";
     break;
   case 'epub':
   case 'EPUB':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/epub.png>";
     break;
   case 'bmp':
   case 'BMP':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/bmp.png>";
     break;
   case 'conf':
   case 'CONF':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/conf.png>";
     break;
   case 'dll':
   case 'DLL':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/dll.png>";
     break;
   case 'ini':
   case 'INI':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/ini.png>";
     break;
   case 'dat':
   case 'DAT':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/dat.png>";
     break;
   case 'apk':
   case 'APK':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/apk.png>";
     break;
   case '7z':
   case '7Z':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/7z.png>";
     break;
   case 'zip':
   case 'ZIP':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/zip.png>";
     break;
   case 'rar':
   case 'RAR':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/rar.png>";
     break;
   case 'exe':
   case 'EXE':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/exe.png>";
     break;
   case 'iso':
   case 'ISO':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/iso.png>";
     break;
   case 'mkv':
   case 'MKV':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/mkv.png>";
     break;
   case 'avi':
   case 'AVI':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/avi.png>";
     break;
   case 'url':
   case 'URL':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/url.png>";
     break;
   case 'NFO':
   case 'nfo':
   case 'NFO':
     $filetype_icon = "<img width=100 height=30 src=/images/Torrents/nfo.png>";
     break;
   default:
     // Handle unknown file extensions
     break;
 }
}


EDIT: I got confused with first page, it appeared as new when it jumped. Disregard *
Server Load help — 2023-06-24 17:03:04 in General Chat
Monitor the usage clicking different links with the comment on your console / SSH

top -P

that should work any Linux/BSD system. Monitor the database server usage % and memory usage, but this really depends on your traffic too.

TORRENT SEARCH — 2023-06-24 15:19:39 in v2.08 Support
Search is hard to get right. I got it pretty accurate while other scripts that match (autocomplete) fail on ® or ™

It's always been dodgy but moreless working as expected. There is probably a library that can plug into the search.php file but no need as we can just make our own, and add anything we want to it in the process.
Scrape UPD INFOHASH — 2023-06-19 17:36:45 in v3 Mods Requests
This would only make sense if the data is in blob format, in which case you parse with a SELECT statement, decode the field, and work with the bdecoded data that way.
Debts of seed — 2023-06-17 21:32:31 in v2.08 Support
Oh that makes more sense!
Debts of seed — 2023-06-17 17:38:24 in v2.08 Support
I cant follow this correctly. I want to assume you guys are talking about the peer table removed when torrent stopped, when started again (seeding) -- what happens exactly?

Events in a nutshell:

Paused - Denying connections from other peers by using a WHERE clause where peers are read from table. A "event" column is needed to do this effectively in peers table. You read/write to that event.

Stopped - Remove row from peers table. Insert when client starts/resumes seeding. Client will repopulate the data @ the tracker announcement, whether it is completed or still downloading. So the peer row will get its values already.

This is to say, you check if seeder or not

$seeder = (int) $_GET['left'] === 0 ? 'yes' : 'no';


Every client reports left key. When you start a torrent, your left key is the total bytes of the torrent. As you download, this reduces based on the bytes downloaded. When this reaches 0, its completed. So you update the table accordingly.

Its all pretty simple. I live in my announce file lol so I can always help here.

.
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