Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Template Shares (http://www.bvlist.com/forumdisplay.php?f=26)
-   -   [FIX] TSSE Upload and Scrape (http://www.bvlist.com/showthread.php?t=2291)

Keiichi 15th July 2008 05:58

[FIX] TSSE Upload and Scrape
 
1 Attachment(s)
1. posible fix for upload ERROR:

Code:

What the hell did you upload? This is not a bencoded file!
benc.php

PHP Code:

<?
/***********************************************/
/*                                             */
/*    E-mail          : mrdecoder@hotmail.com  */
/*                                             */
/*              FearlesS-Releases              */
/*             One Name, One Legend            */
/*                                             */
/***********************************************/


function benc($obj) {
    if (!
is_array($obj) || !isset($obj["type"]) || !isset($obj["value"]))
    {
    return;
    }
    
    
$c $obj["value"];
    
    switch (
$obj["type"]) 
    {
    case 
"string":
        return 
benc_str($c);
    case 
"integer":
        return 
benc_int($c);
    case 
"list":
        return 
benc_list($c);
    case 
"dictionary":
        return 
benc_dict($c);
    default:
        return;
    }
}

function 
benc_str($s) {
    return 
strlen($s) . ":$s";
}

function 
benc_int($i) {
    return 
"i" $i "e";
}

function 
benc_list($a) {
    
$s "l";
    
    foreach (
$a as $e
    {
    
$s .= benc($e);
    }
    
    
$s .= "e";
    return 
$s;
}

function 
benc_dict($d) {
    
$s "d";
    
$keys array_keys($d);
    
sort($keys);
    
    foreach (
$keys as $k
    {
    
$v $d[$k];
    
$s .= benc_str($k);
    
$s .= benc($v);
    }
    
    
$s .= "e";
    return 
$s;
}

function 
bdec_file($f$ms) {

    
$fp fopen($f"rb");
    
    if (!
$fp)
    {
    return;
    }
    
    
$e fread($fp$ms);
    
fclose($fp);
    return 
bdec($e);
}

function 
bdec($s) {
    if (
preg_match('/^(\d+):/'$s$m)) 
    {
    {
    
$l $m[1];
    
$pl strlen($l) + 1;
    
$v substr($s$pl$l);
    
$ss substr($s0$pl $l);
    }
    
    if (
strlen($v) != $l)
    {
        return;
    }    
    
    return array(
type => "string"value => $vstrlen => strlen($ss), string => $ss);
    }
    
    if (
preg_match('/^i(\d+)e/'$s$m))
    {
    {
    
$v $m[1];
    
$ss "i" $v "e";
    }
    
    if (
$v === "-0")
    {
        return;
    }
    
    if (
$v[0] == "0" && strlen($v) != 1)
    {
        return;
    }    
        
    return array(
type => "integer"value => $vstrlen => strlen($ss), string => $ss);
    }
    
    switch (
$s[0]) {
    case 
"l":
        return 
bdec_list($s);
    case 
"d":
        return 
bdec_dict($s);
    default:
        return;
    }
}

function 
bdec_list($s) {

    if (
$s[0] != "l")
    {
    return;
    }
    
    
$sl strlen($s);
    
$i 1;
    
$v = array();
    
$ss "l";
    
    for (;;) 
    {    
    if (
$i >= $sl)
    {
        return;
    }
        
    if (
$s[$i] == "e")
    {
        break;
    }
    
    
$ret bdec(substr($s$i));
    
    if (!isset(
$ret) || !is_array($ret))
    {
        return;
    }    
        
    
$v[] = $ret;
    
$i += $ret["strlen"];
    
$ss .= $ret["string"];
    
    }
    
$ss .= "e";
    return array(
type => "list"value => $vstrlen => strlen($ss), string => $ss);
}

function 
bdec_dict($s) {

    if (
$s[0] != "d")
    {
    return;
    }
    
    
$sl strlen($s);
    
$i 1;
    
$v = array();
    
$ss "d";
    
    for (;;) 
    {
        if (
$i >= $sl)
        {
            return;
        }    
        
        if (
$s[$i] == "e")
        {
            break;
        }    
    
    
$ret bdec(substr($s$i));
    
    if (!isset(
$ret) || !is_array($ret) || $ret["type"] != "string")
    {
        return;
    }
        
    
$k $ret["value"];
    
$i += $ret["strlen"];
    
$ss .= $ret["string"];
    
    if (
$i >= $sl)
    {
        return;
    }    
        
    
$ret bdec(substr($s$i));
    
    if (!isset(
$ret) || !is_array($ret))
    {
        return;
    }    
        
    
$v[$k] = $ret;
    
$i += $ret["strlen"];
    
$ss .= $ret["string"];
    }
    
$ss .= "e";
    return array(
type => "dictionary"value => $vstrlen => strlen($ss), string => $ss);
}

  if (!
defined ('IN_SCRIPT_TSSEv51'))
  {
    exit (
'<font face=\"verdana\" size=\"2\" color=\"darkred\">Error! Direct initialization of this file is not allowed.</font>');
  }

  @
error_reporting (E_ALL & ~E_NOTICE);
  @
ini_set ("error_reporting"E_ALL & ~E_NOTICE);
  @
ini_set ("display_errors""0");
  @
ini_set ("display_startup_errors""0");
  @
ini_set ("ignore_repeated_errors""1");
  @
ini_set ("log_errors""1");
?>

2. TS 5.1 IOError in Azureus - Error in function gzip

scrape.php original

PHP Code:

<?
/***********************************************/
/*                                             */
/*    E-mail          : mrdecoder@hotmail.com  */
/*                                             */
/*              FearlesS-Releases              */
/*             One Name, One Legend            */
/*                                             */
/***********************************************/


  
function fast_db_connect ()
  {
    
$dbfile './config/DATABASE';
    if (!
file_exists ($dbfile))
    {
      exit (
'DATABASE Configuration file does not exists');
      return 
null;
    }

    
$data unserialize (@file_get_contents ($dbfile));
    if (!(
$connect mysql_connect ($data['mysql_host'], $data['mysql_user'], $data['mysql_pass'])))
    {
      exit (
'Error: Mysql Connection!');
      ;
    }

    if (!(
mysql_select_db ($data['mysql_db'], $connect)))
    {
      exit (
'Error: Mysql DB Selection!');
      ;
    }

    unset (
$data);
  }

  function 
sqlesc ($value)
  {
    if (
get_magic_quotes_gpc ())
    {
      
$value stripslashes ($value);
    }

    if (!
is_numeric ($value))
    {
      
$value '\'' mysql_real_escape_string ($value) . '\'';
    }

    return 
$value;
  }

  function 
hash_where ($name$hash)
  {
    return 
'' '(' $name ' = ' sqlesc ($hash) . ('' ' OR ' $name ' = ') . sqlesc (preg_replace ('/ *$/s'''$hash)) . ')';
  }

  function 
unesc ($x)
  {
    return (
get_magic_quotes_gpc () ? stripslashes ($x) : $x);
  }

  function 
hash_pad ($hash)
  {
    return 
str_pad ($hash20);
  }

  function 
benc_str ($s)
  {
    return 
strlen ($s) . ':' $s;
  }

  @
error_reporting (E_ALL & ~E_NOTICE);
  @
ini_set ('error_reporting'E_ALL & ~E_NOTICE);
  @
ini_set ('display_errors''0');
  
define ('S_VERSION''0.6 by xam');
  if (!isset (
$_GET['info_hash']))
  {
    exit (
'Permission denied!');
  }

  
fast_db_connect ();
  
$r 'd' benc_str ('files') . 'd';
  if (!(
$res mysql_query ('SELECT info_hash,seeders,times_completed,leechers FROM torrents WHERE ' hash_where ('info_hash'unesc ($_GET['info_hash'])) . ' LIMIT 1')))
  {
    exit (
'Mysql error!');
    ;
  }

  while (
$row mysql_fetch_assoc ($res))
  {
    
$r .= '20:' hash_pad ($row['info_hash']) . 'd' benc_str ('complete') . 'i' $row['seeders'] . 'e' benc_str ('downloaded') . 'i' $row['times_completed'] . 'e' benc_str ('incomplete') . 'i' $row['leechers'] . 'e' 'e';
  }

  
$r .= 'ee';
  
header ('Content-Type: text/plain');
  if ((isset (
$_SERVER['HTTP_ACCEPT_ENCODING']) AND $_SERVER['HTTP_ACCEPT_ENCODING'] == 'gzip'))
  {
    
header ('Content-Encoding: gzip');
    echo 
gzencode ($x9FORCE_GZIP);
  }
  else
  {
    echo 
$r;
  }

  unset (
$r);


Fix 1


PHP Code:

<?
/***********************************************/
/*                                             */
/*    E-mail          : mrdecoder@hotmail.com  */
/*                                             */
/*              FearlesS-Releases              */
/*             One Name, One Legend            */
/*                                             */
/***********************************************/


  
function fast_db_connect ()
  {
    
$dbfile './config/DATABASE';
    if (!
file_exists ($dbfile))
    {
      exit (
'DATABASE Configuration file does not exists');
      return 
null;
    }

    
$data unserialize (@file_get_contents ($dbfile));
    if (!(
$connect mysql_connect ($data['mysql_host'], $data['mysql_user'], $data['mysql_pass'])))
    {
      exit (
'Error: Mysql Connection!');
    }

    if (!(
mysql_select_db ($data['mysql_db'], $connect)))
    {
      exit (
'Error: Mysql DB Selection!');
    }

    unset (
$data);
  }

  function 
sqlesc ($value)
  {
    if (
get_magic_quotes_gpc ())
    {
      
$value stripslashes ($value);
    }

    if (!
is_numeric ($value))
    {
      
$value '\'' mysql_real_escape_string ($value) . '\'';
    }

    return 
$value;
  }

  function 
hash_where ($name$hash)
  {
    return 
'' '(' $name ' = ' sqlesc ($hash) . ('' ' OR ' $name ' = ') . sqlesc (preg_replace ('/ *$/s'''$hash)) . ')';
  }

  function 
unesc ($x)
  {
    return (
get_magic_quotes_gpc () ? stripslashes ($x) : $x);
  }

  function 
hash_pad ($hash)
  {
    return 
str_pad ($hash20);
  }

  function 
benc_str ($s)
  {
    return 
strlen ($s) . ':' $s;
  }
  
  @
error_reporting (E_ALL & ~E_NOTICE);
  @
ini_set ('error_reporting'E_ALL & ~E_NOTICE);
  @
ini_set ('display_errors''0');
  
define ('S_VERSION''0.6 by xam');
  if (!isset (
$_GET['info_hash']))
  {
    exit (
'Permission denied!');
  }

  
fast_db_connect ();
  
$r 'd' benc_str ('files') . 'd';
  if (!(
$res mysql_query ('SELECT info_hash,seeders,times_completed,leechers FROM torrents WHERE ' hash_where ('info_hash'unesc ($_GET['info_hash'])) . ' LIMIT 1')))
  {
    exit (
'Mysql error!');
  }

  while (
$row mysql_fetch_assoc ($res))
  {
    
$r .= '20:' hash_pad ($row['info_hash']) . 'd' benc_str ('complete') . 'i' $row['seeders'] . 'e' benc_str ('downloaded') . 'i' $row['times_completed'] . 'e' benc_str ('incomplete') . 'i' $row['leechers'] . 'e' 'e';
  }

  
$r .= 'ee';
  
  if ((isset (
$_SERVER['HTTP_ACCEPT_ENCODING']) AND $_SERVER['HTTP_ACCEPT_ENCODING'] == 'gzip')) {
   
header('Content-Type: text/plain');
   
header('Content-Encoding: gzip');
   echo 
gzencode($r9FORCE_GZIP);
  }
  else
   
header('Content-Type: text/plain'); {
  echo 
$r;
  }
  unset(
$r);

?>

Fix 2

PHP Code:

<?
/***********************************************/
/*                                             */
/*    E-mail          : mrdecoder@hotmail.com  */
/*                                             */
/*              FearlesS-Releases              */
/*             One Name, One Legend            */
/*                                             */
/***********************************************/


  
function fast_db_connect ()
  {
    
$dbfile './config/DATABASE';
    if (!
file_exists ($dbfile))
    {
      exit (
'DATABASE Configuration file does not exists');
      return 
null;
    }

    
$data unserialize (@file_get_contents ($dbfile));
    if (!(
$connect mysql_connect ($data['mysql_host'], $data['mysql_user'], $data['mysql_pass'])))
    {
      exit (
'Error: Mysql Connection!');
      ;
    }

    if (!(
mysql_select_db ($data['mysql_db'], $connect)))
    {
      exit (
'Error: Mysql DB Selection!');
      ;
    }

    unset (
$data);
  }

  function 
sqlesc ($value)
  {
    if (
get_magic_quotes_gpc ())
    {
      
$value stripslashes ($value);
    }

    if (!
is_numeric ($value))
    {
      
$value '\'' mysql_real_escape_string ($value) . '\'';
    }

    return 
$value;
  }

  function 
hash_where ($name$hash)
  {
    return 
'' '(' $name ' = ' sqlesc ($hash) . ('' ' OR ' $name ' = ') . sqlesc (preg_replace ('/ *$/s'''$hash)) . ')';
  }

  function 
unesc ($x)
  {
    return (
get_magic_quotes_gpc () ? stripslashes ($x) : $x);
  }

  function 
hash_pad ($hash)
  {
    return 
str_pad ($hash20);
  }

  function 
benc_str ($s)
  {
    return 
strlen ($s) . ':' $s;
  }

  @
error_reporting (E_ALL & ~E_NOTICE);
  @
ini_set ('error_reporting'E_ALL & ~E_NOTICE);
  @
ini_set ('display_errors''0');
  
define ('S_VERSION''0.6 by xam');
  if (!isset (
$_GET['info_hash']))
  {
    exit (
'Permission denied!');
  }

  
fast_db_connect ();
  
$r 'd' benc_str ('files') . 'd';
  if (!(
$res mysql_query ('SELECT info_hash,seeders,times_completed,leechers FROM torrents WHERE ' hash_where ('info_hash'unesc ($_GET['info_hash'])) . ' LIMIT 1')))
  {
    exit (
'Mysql error!');
    ;
  }

  while (
$row mysql_fetch_assoc ($res))
  {
    
$r .= '20:' hash_pad ($row['info_hash']) . 'd' benc_str ('complete') . 'i' $row['seeders'] . 'e' benc_str ('downloaded') . 'i' $row['times_completed'] . 'e' benc_str ('incomplete') . 'i' $row['leechers'] . 'e' 'e';
  }

  
$r .= 'ee';
  
header ('Content-Type: text/plain');

echo 
$r;
unset (
$r);
?>

These fixed are for the 4.3 TS, 5.1, 5.4 maybe 5.6
my testing with errors

Attachment 1154

Ashur 27th June 2009 18:04

wow this is awesome now I got scrape working and CPU usage dropped down
awesome :D

PRODIGY 27th June 2009 21:12

it doesnt work for v5.6...can somebody help me?
i get the message
Code:

What the hell did you upload? This is not a bencoded file!

rSt0n3 28th June 2009 13:33

bencoded file
 
i have the same problem...

Code:

What the hell did you upload? This is not a bencoded file!
i suposed that bencoded file has to do with benc.php, so i edited benc.php to be like that on the first post...
unfortunately it doesn't work...can anybody help me ???

Terminator 28th June 2009 14:26

works like a charm for us :coffee:

many thnx for this awesome revolutionary work!

cheers :drink:

fireman 30th June 2009 06:24

Quote:

Originally Posted by Keiichi (Post 2617)
These fixed are for the 4.3 TS, 5.1, 5.4 maybe 5.6
my testing with errors

The scrape works great however if i change benc file to whats list I get a message something like direct utilization of this file is not allowed and i tried to upload an external torrent when using this now the original benc file worked fine for me does anyone else have input on this

Ashur 30th June 2009 06:41

well if you got the original benc working then don't mess with it
i had major issues with scrape so this resolved it so I'm happy about that

mmisu120000 2nd July 2009 00:39

Quote:

Originally Posted by fireman (Post 12851)
The scrape works great however if i change benc file to whats list I get a message something like direct utilization of this file is not allowed and i tried to upload an external torrent when using this now the original benc file worked fine for me does anyone else have input on this

in benc.php there is a line where says :
PHP Code:

if (!defined ('IN_SCRIPT_TSSEv51')) 

now, if you have TSSE 5.3, 5.4, 5.4.1, you should replace it with:
PHP Code:

if (!defined ('IN_SCRIPT_TSSEv53')) 

and, if you have the 5.6 version:
PHP Code:

if (!defined ('IN_SCRIPT_TSSEv56')) 


sieucan 17th September 2009 11:17

when i active seo setting, scrape didn't working???
can somebody help me?

informatic 17th September 2009 22:05

Quote:

Originally Posted by sieucan (Post 15715)
when i active seo setting, scrape didn't working???
can somebody help me?

That's funny. Scrape works perfectly for me with SEO on. If it gives you problem, then it might be better to have it off. Besides, the SEO isn't entirely perfect, still a lot of links and etc which aren't "masked".

chakalster 17th October 2009 12:33

Quote:

Originally Posted by rSt0n3 (Post 12758)
i have the same problem...

Code:

What the hell did you upload? This is not a bencoded file!
i suposed that bencoded file has to do with benc.php, so i edited benc.php to be like that on the first post...
unfortunately it doesn't work...can anybody help me ???

İ HAVE SAME PROBLEM TOO. i edited benc.php and now
it says : Error! Direct initialization of this file is not allowed.

Nightcrawler 17th October 2009 13:54

Quote:

Originally Posted by chakalster (Post 16586)
İ HAVE SAME PROBLEM TOO. i edited benc.php and now
it says : Error! Direct initialization of this file is not allowed.

Error! Direct initialization of this file is not allowed. indicates the file is not for the same version so you need to find the part that says

Code:

if (!defined ('IN_SCRIPT_TSSEv5x'))


replace the version with yours if 5.6=

Code:

if (!defined ('IN_SCRIPT_TSSEv56'))
This has already been said b4 so plz use the search next time :)

chakalster 17th October 2009 23:06

:S
 
:wallbash: i check it..

its already
Code:

if (!defined ('IN_SCRIPT_TSSEv56'))
and the error is only:
Code:

Error! Direct initialization of this file is not allowed.


not any more..

is 5.4.1 better than this?
:S


underx 19th January 2010 12:57

After installing succesfully TSSE 5.6 I got this error message when I try to upload torrent :
Quote:

What the hell did you upload? This is not a bencoded file!
Then I changed benc.php with code in the first page !

Then I got another Error message:
Quote:

Error! Direct initialization of this file is not allowed.
Then I changed
Quote:

if (!defined ('IN_SCRIPT_TSSEv51'))
to
Quote:

if (!defined ('IN_SCRIPT_TSSEv56'))
After that when when I fill all fields in the torrent upload page I got a white page !!!
Please someone help me !

EDIT: SOLVED

but now I get in my client (utorrent)
(I redownloaded the torrent and it update passkey)
Code:

Tracker sending invalid data:

nikosuk 12th May 2010 15:35

Zero Seeders
 
Hello,

None of the torrents show seeders in the client
The website recognises seeds and peers, shows the peer list, but no seeders appear in the client

I have tried using utorrent , azureus ..bircomet, older versions and current.
I have tried playing around with site settings, disabled mods and options, again nothing.

Still zero seeds.. while the files transfer normally, and ratio seems to be working fine too

How do i Apply this mod? i have edited benc.php to
PHP Code:

 if (!defined ('IN_SCRIPT_TSSEv56')) 

Which one should i use? all files? sorry if i am beeing dumm, but i dont seem to understand how to apply it


Any help please?
Thanks

hello, sorry if i am bumping this, but nobody else has the same problem like me?

I upload and download normally (ratio counts) but the utorrent shows no Seeds..

Please any suggestions?

Thank you

Conjo 22nd June 2010 18:39

Quote:

Originally Posted by nikosuk (Post 23006)
Hello,

None of the torrents show seeders in the client
The website recognises seeds and peers, shows the peer list, but no seeders appear in the client

I have tried using utorrent , azureus ..bircomet, older versions and current.
I have tried playing around with site settings, disabled mods and options, again nothing.

Still zero seeds.. while the files transfer normally, and ratio seems to be working fine too

How do i Apply this mod? i have edited benc.php to
PHP Code:

 if (!defined ('IN_SCRIPT_TSSEv56')) 

Which one should i use? all files? sorry if i am beeing dumm, but i dont seem to understand how to apply it


Any help please?
Thanks

hello, sorry if i am bumping this, but nobody else has the same problem like me?

I upload and download normally (ratio counts) but the utorrent shows no Seeds..

Please any suggestions?

Thank you


Same here...

Looking to solve this for a long time...

PS. This happens also width the licenced (original:lol:) version.

Nightcrawler 22nd June 2010 18:53

I made a working scrape here http://bvlist.com/other-downloads/47...-new-post.html

Hyperjr 12th October 2010 22:20

Quote:

Originally Posted by Ashur (Post 12727)
wow this is awesome now I got scrape working and CPU usage dropped down
awesome :D

Best Ashur,

I have a question do you know how i can make the Blank Takeupload.php page to work. because after i wanted to upload a torrent. it totally blank and the Scrape.php gives a Error: Invalid hash!

Can u help me please im Using TSSE 5.4 Thank u ,

Im from the netherlands i will send you a donation if you can help me with the code

Namaste

nany2207 21st November 2011 01:03

thank you !!!!!!!!11

Darkness 24th November 2011 00:07

Hello
 
Quote:

Originally Posted by mmisu120000 (Post 12922)
in benc.php there is a line where says :
PHP Code:

if (!defined ('IN_SCRIPT_TSSEv51')) 

now, if you have TSSE 5.3, 5.4, 5.4.1, you should replace it with:
PHP Code:

if (!defined ('IN_SCRIPT_TSSEv53')) 

and, if you have the 5.6 version:
PHP Code:

if (!defined ('IN_SCRIPT_TSSEv56')) 


Man I don`t have that line in my benc.php and, in my client is appear no seeder but in tracker it`s ok. I forget to tell you my source is TS SE v5.6 if you can tell me how to fix that I`ll be very happy. Thanks allot folks, without you guys I`m nothing :chch:

x360zone 24th November 2011 10:23

same old
 
the source work the issue is the people trying to create a tracker with little experience. scrape works fine i have private tracker runs no issues
i have external tracker which runs no issues i have 3 back up sites all working scrapes no issues so as i said before if oyu cant get this source to work time to hang up your keyboard., free or shitty hosting dont cut it for the 500 th time

eckeO5 14th January 2012 13:04

x360zone… i feel with ya:friend:

filth 9th June 2012 23:04

What the hell did you upload? This is not a bencoded file

Same error even after replacing benc.php .Any solution?

LE: My mistake, i uploaded benc.php to main directory :)) . Once I put it to "include" directory, it works fine.

David244us 12th August 2012 22:32

This all works great for me when i hit the browse torrents button, I have the last 5 torrents scrolling at the top and thats where it doesn't say any seeders or leechers. Is that possible to fix? thanks everyone


All times are GMT +2. The time now is 11:15.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.