Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Project U-232 (http://www.bvlist.com/forumdisplay.php?f=80)
-   -   bad data from tracker - bad bencoded data (http://www.bvlist.com/showthread.php?t=1205)

FAT 19th October 2008 10:24

bad data from tracker - bad bencoded data
 
hi..
all my users who seed with seedbox and torrentflux get this error.
is there a fix?
thx

Omen 23rd October 2008 19:29

This mistake occurred in me some solution would be good onto him

Ashur 5th November 2008 19:34

they need to import their browser cookies into torrentflux and it should work
i think found the solution somewhere on torrentflux forums long time ago so I hope this fix still works :)

kira 20th July 2016 01:31

I've a same problem error Tracker: [Could not parse bencoded data]
an idea please ?
:mad:

DND 20th July 2016 12:55

update benc.php file

kira 20th July 2016 23:03

I have no benc.php file, I am with u-232-v4 :tease:

UFFENO1 21st July 2016 00:15

include/class/class_bencodec.php

kira 21st July 2016 00:23

OK, and what should I change ?

joeroberts 21st July 2016 13:24

Quote:

Originally Posted by kira (Post 49099)
I have no benc.php file, I am with u-232-v4 :tease:

then why are you posting in the Template Shares section?

Napon 22nd July 2016 10:15

use this benc.php

Code:


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 hash_where_arr($name, $hash_arr) {
        $new_hash_arr = Array();
        foreach ($hash_arr as $hash) {
                $new_hash_arr[] = sqlesc((urldecode($hash)));
        }
        return $name." IN ( ".implode(", ",$new_hash_arr)." )";
}

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($s, 0, $pl + $l);
        if (strlen($v) != $l)
            return;
        return array(type => "string", value => $v, strlen => 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 => $v, strlen => 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 => $v, strlen => 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 => $v, strlen => strlen($ss), string => $ss);
}

?>


kira 22nd July 2016 10:55

THX man it works :friend:

Napon 22nd July 2016 23:23

nps glad i could help you out

Bigjoos 27th July 2016 18:33

Jeez, where do i begin. U-232 v4 uses class.bencdec.php, so takeupload, download and use that class. You come along and post some benc.php probably lifted out of TBdev 09 that is not compatible in any way, it will cause untold errors.

If you don't know nothing about U-232 structure then please refrain from posting garbage here napon, I'm more than capable of answering any support myself. For the record that bad bencoded data error is a client issue not a code issue therefore not my concern. Whats even more laughable is that a member kira says thanks it works :lol:. Trust me if your runningU-232 v4 as you have said, that code posted is useless, I don't replace stock default bencdec with much better code for the hell of it.

Napon 27th July 2016 20:36

Bigjoos it was not from the TBdev 09

Bigjoos 28th July 2016 20:42

Doesn't really matter what code its from napon, it just simply wouldn't work in U-232 V4, I get it your just trying to help, I'm not knocking that. Just be aware that U-232 has lots of non default code, its highly customized now and that benc.php file wont work without reverting all the class.bencdec.php code back to default, and that would be a backward step =]


All times are GMT +2. The time now is 04:34.

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