Btiteam / XBTIT Forum

xbtit => XBTIT Support => Topic started by: tojoaijo on September 26, 2017, 01:58:30 pm

Title: Announce tracker
Post by: tojoaijo on September 26, 2017, 01:58:30 pm
Hi everybody,

Is there a possibility to add directly the "PID" of the uploader on the * url of the tracker in the page of the upload?

Thank you
Title: Re: Announce tracker
Post by: bhorer_alo on September 26, 2017, 04:27:06 pm
Is there a possibility to add directly the "PID" of the uploader on the * url of the tracker in the page of the upload?

do you want it like:
If a new torrent is uploaded, the uploader doesn't have to re-download the torrent?. Yes, possible.
Title: Re: Announce tracker
Post by: tojoaijo on September 27, 2017, 08:02:55 am
Yes, I want this  :)
Title: Re: Announce tracker
Post by: bhorer_alo on September 27, 2017, 01:50:41 pm
I'll get back to you on that
Title: Re: Announce tracker
Post by: tojoaijo on September 27, 2017, 02:38:03 pm
Many thanks, I have send you an message
Title: Re: Announce tracker
Post by: bhorer_alo on September 27, 2017, 11:22:21 pm
To allow creating and uploading a torrent with an uploader's pid; and helping the system to recognize the torrent as an internal torrent, here's what you have to do.

Code: (php) [Select]
<?php
##upload.php:##

#find:
if (isset($_FILES["torrent"]))

#add before:

// pid code begin
$row =get_result("SELECT pid FROM {$TABLE_PREFIX}users WHERE id=".$CURUSER['uid'],true,$btit_settings['cache_duration']);
$pid=$row[0]["pid"];
if (!
$pid)
{
    
$pid=md5(uniqid(rand(),true));
    
do_sqlquery("UPDATE {$TABLE_PREFIX}users SET pid='".$pid."' WHERE id='".$CURUSER['uid']."'");
    if (
$XBTT_USE)
        
do_sqlquery("UPDATE xbt_users SET torrent_pass='".$pid."' WHERE uid='".$CURUSER['uid']."'");
}
foreach (
$TRACKER_ANNOUNCEURLS as $taurl)
   
$announcePlus[]= $taurl"?pid=$pid";
   
//------------------------------------------------------------------------------------------

#find:
if (in_array($array["announce"],$TRACKER_ANNOUNCEURLS) && $DHT_PRIVATE)
   
#replace:
if ( (in_array($array["announce"],$TRACKER_ANNOUNCEURLS) || in_array($array["announce"],$announcePlus)) && $DHT_PRIVATE )
   
//------------------------------------------------------------------------------------------

#find:
if (!in_array($announce,$TRACKER_ANNOUNCEURLS) && $EXTERNAL_TORRENTS==false)
   
#replace:
if ( (!in_array($announce,$TRACKER_ANNOUNCEURLS) || !in_array($announce,$announcePlus)) && $EXTERNAL_TORRENTS==false)
   
//------------------------------------------------------------------------------------------

#find:
if (in_array($announce,$TRACKER_ANNOUNCEURLS)){
   
#replace:
if (in_array($announce,$TRACKER_ANNOUNCEURLS) || in_array($announce,$announcePlus)){
      
//------------------------------------------------------------------------------------------

#find:
if (in_array($array["announce-list"][$i][0],$TRACKER_ANNOUNCEURLS))
   
#replace:
if (in_array($array["announce-list"][$i][0],$TRACKER_ANNOUNCEURLS) || in_array($array["announce-list"][$i][0],$announcePlus))
      
//------------------------------------------------------------------------------------------

#find:
if (!in_array($announce,$TRACKER_ANNOUNCEURLS))
   
#replace:
if (!in_array($announce,$TRACKER_ANNOUNCEURLS) || !in_array($announce,$announcePlus))

   
//------------------------------------------------------------------------------------------

#find:
      
foreach ($TRACKER_ANNOUNCEURLS as $taurl)
         
#replace:
      
foreach ($announcePlus as $taurl)
//------------------------------------------------------------------------------------------


Tested with xbtit beta version from github. I've attached my details.php with this reply.
Title: Re: Announce tracker
Post by: tojoaijo on September 28, 2017, 08:10:23 am
Many thanks, I will test it and I'll be back to you.
But just, can you give the link of the xbtit beta on github or it is like this https://github.com/btiteam/xbtit ?
Title: Re: Announce tracker
Post by: bhorer_alo on September 28, 2017, 09:05:19 am
Many thanks, I will test it and I'll be back to you.
But just, can you give the link of the xbtit beta on github or it is like this https://github.com/btiteam/xbtit ?
you have the correct link.
if you want stable releases of xbtit, check:
https://github.com/btiteam/xbtit/releases
Title: Re: Announce tracker
Post by: tojoaijo on October 05, 2017, 11:07:59 am
thank's for your code, it's working :)
Title: Re: Announce tracker
Post by: bhorer_alo on October 05, 2017, 04:26:57 pm
awesome!
Title: Re: Announce tracker
Post by: tojoaijo on October 19, 2017, 08:25:26 am
Hi bhorer_alo

I need to adapt the code with xbtt as backend, can you help me?
Title: Re: Announce tracker
Post by: bhorer_alo on October 23, 2017, 09:26:42 pm
The idea is the same for xbtt. Please try yourself at first. I'll help you when you are stuck
Title: Re: Announce tracker
Post by: tojoaijo on October 26, 2017, 09:35:07 am
I have do this:

-before:
Code: [Select]
if (isset($_FILES["torrent"]))
I changed:
Code: [Select]
foreach ($TRACKER_ANNOUNCEURLS as $taurl)
$announcePlus[]= $taurl. "?pid=$pid";

to this:
Code: [Select]
foreach ($TRACKER_ANNOUNCEURLS as $taurl)
        if ($XBTT_USE)
                $announcePlus[] = $XBTT_URL."/$pid/announce";
        else
                $announcePlus[]= $taurl. "?pid=$pid";

and now the system work but after I upload the file on the website, I have this Mysql error (see attachment)
but I'll go back to torrent list, the file is there and I can leech the file successfully
And I checked my database, I noticed that the table "xbtit_files" was not updated the peer list (leecher, seeder and completed), it just marqued "0" (see attachment)
Or on the table "xbt_files", the peers was updated successfully (see attachment)
Title: Re: Announce tracker
Post by: tojoaijo on November 21, 2017, 08:55:48 am
Hi bhorer_alo,
Have a new about this problem on XBTT?
Thanks
Title: Re: Announce tracker
Post by: LukePen on January 06, 2018, 10:24:23 am
Hi bhorer_alo,
Have a new about this problem on XBTT?
Thanks

Yeah, any updates?