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
Torrent Trader PDO/MVC 2021 Pre-Release
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / M-BiTsy / M-BiTsy Support

2020-11-16 20:13:23
I’ll be taking another shot at public torrent scraping, I need it by this weekend so should be of result. Seems we get a working solution, and it goes down over time. Maybe a public tracker list is needed for this script.
2020-11-16 20:19:30
"coco, post: 69559, member: 20298":

I don't know what's going on but still the same error.
I changed line 415 in Account.php
$sql = "INSERT INTO users (username, password, secret, email, status, added, last_access, age, country, gender, client, stylesheet, language, class, ip) VALUES (" . implode(",", array_map("sqlesc", array($wantusername, $wantpassword, $secret, $email, $status, get_date_time(), get_date_time(), $age, $country, $gender, $client, $config["default_theme"], $config["default_language"], $signupclass, getip()))) . ")";
               $ins_user = DB::run($sql);
               $id = DB::lastInsertId();


with this
$ins_user = DB::run("INSERT INTO users
(username, password, secret, email, status, added, last_login, last_access, age, country, gender, client, stylesheet, language, class, ip)
VALUES
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
[$wantusername, $wantpassword, $secret, $email, $status, get_date_time(), get_date_time(), get_date_time(), $age, $country, $gender, $client, $config["default_theme"], $config["default_language"], $signupclass, getip()]);
$id = DB::lastInsertId()


in address bar https://xxxxxxx.xxx/exceptions/error
error_log and exception_log.txt files are empty

And also this line $config['SITEURL'] = '[url='http://localhost/pdo;']http://localhost/pdo';[/url] //Main Site URL how it should be?
In main config is $config['SITEURL'] = 'https://xxxxxxx.xxx'; //Main Site URL without pdo, if you add it many redirects start


Thank you  m-jay


I dont see the need for array_map() here as the statement is designed to call array keys regardless, no need for a callback I believe. Go vanilla on this one and bind the array keys like you normally would. Also think array_push may be useful for handling those keys.

“The number of parameters that the callback function accepts should match the number of arrays passed to array_map()”

might be the issue. This sounds a lot like a finicky PHP version where this function may change upon releases.

Also.. “...If the arrays are of unequal length, shorter ones will be extended with empty elements to match the length of the longest.” Will produce a problem if the column is not ALLOW NULL.

2 possible issues here. That query is too complex for what it’s doing, and it’s not doing much in terms of additional steps or parsing.

I would write a solution if I was at home ?
2020-11-16 21:18:53
"STorrents2020, post: 69561, member: 20382":

I’ll be taking another shot at public torrent scraping, I need it by this weekend so should be of result. Seems we get a working solution, and it goes down over time. Maybe a public tracker list is needed for this script.



it was a very quick response from you mate,
most use the following opentrackers:


udp://tracker.opentrackr.org:1337/announce
udp://9.rarbg.to:2990
udp://tracker.coppersurfer.tk:6969/announce
udp://eddie4.nl:6969/announce
udp://9.rarbg.me:2720
udp://tracker.leechers-paradise.org:6969/announce
[URL unfurl="true"]http://tracker.trackerfix.com:80/announce[/url]
udp://tracker.zer0day.to:1337/announce

etc etc ...

hope you resolve some problems with that

Regards


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2020-11-16 22:33:58
"Botanicar, post: 69563, member: 19833":

it was a very quick response from you mate,
most use the following opentrackers:


udp://tracker.opentrackr.org:1337/announce
udp://9.rarbg.to:2990
udp://tracker.coppersurfer.tk:6969/announce
udp://eddie4.nl:6969/announce
udp://9.rarbg.me:2720
udp://tracker.leechers-paradise.org:6969/announce
[URL unfurl="true"]http://tracker.trackerfix.com:80/announce[/url]
udp://tracker.zer0day.to:1337/announce

etc etc ...

hope you resolve some problems with that

Regards


Good work. I also have a master list that is updated weekly, we can compare and ping each one to find out which one is alive.

I feed this list to my active torrents in my seedbox and I get upwards of 57mbps on some torrents ?

I’ve written a script that fetches a complete text list of urls from the website that has these urls so no need to even visit that site, just run the script and you get 100% updated trackers!

It scrapes the front page for the list, which we can easilyparse these into a array and read from that. Will be a little extra overhead, but it should be reliable.
2020-11-17 03:02:26
In this script I wrote months ago, it works like this (so you want DOM extension installed for PHP if absent)


// Mass check life on public announce URLs  

include_once('simple_html_dom.php');

// Create DOM from URL
$html = file_get_html('http://www.torrenttrackerlist.com/torrent-tracker-list/');

// find all trackers on URL
foreach($html->find('pre.prettyprint') as $e)

$geturls = $e->innertext;

// Format rendered tracker list
$trackerlist = str_replace('announce', 'announce<br>', $geturls);

echo $trackerlist;


It's worth adding this to the above code, too ensure you have DOM enabled before include_once()


if (!class_exists('DOMDocument') {
   die('DOM not enabled. This will not work.');
}


Full ZIP attached ;)
GrabTrackerList-ST.zip
Download
2020-11-17 12:21:32
On the next update the scraper is working (on some setups) it seems to be a setting in php.ini if you have any thoughts [USER=20382]@STorrents2020[/USER]  in check.php theres one setting for external I checked that and that's not it
Maybe a firewall, for that query I'll have a closer look when I get in
2020-11-17 15:13:56
I don’t see why this is so difficult, all we are doing is fetching query data for a URL parameter based on the info hash. Just sounds like domains/IP announces are problematic.
2020-11-17 15:53:27
I had a go with this mate bit more modern
[URL unfurl="true"]https://github.com/medariox/scrapeer[/url]

With that it was again tempermental - again a  setting something to do with the function socket_create() -   sockets is enabled

It would explain why it stopped working on different versions it's not code its server/host side im sure - xammp runs scraping perfect every time now on update I'm working on at minute with the old mod from here  :unsure:
2020-11-18 05:42:20
"m-jay, post: 69568, member: 20288":

I had a go with this mate bit more modern
[URL unfurl="true"]https://github.com/medariox/scrapeer[/url]

With that it was again tempermental - again a  setting something to do with the function socket_create() -   sockets is enabled

It would explain why it stopped working on different versions it's not code its server/host side im sure - xammp runs scraping perfect every time now on update I'm working on at minute with the old mod from here  :unsure:


Leave it to me on my ST platform. I'll get it going..
2020-11-19 15:04:33
I will be testing against a array of tracker urls and testing exactly 5 public torrents with DHT enabled and announce-list populated for best results.

NOTE to those reading: This has been a battle for a long time throughout the history of TorrentTrader and other tracker scripts as well. We will be wrapping this up finally, once and for all. Work will begin head-on on Saturday.

I will be testing several classes as well as compatibility towards those 5 selected torrents. [USER=20288]@m-jay[/USER] if you like me to move this most let me know.
2020-11-19 21:31:42
TorrentTrader is the only torrent script that had a working "scraper" that I know, most have formed their backbone based on their own torrent announce and did not work at all with "open trackers"

Thanks @STorrents2020 for all the time you spend solving this "mystery" and Mounth Everest of the problem


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2020-11-20 15:02:02
Thanks man, Simply supporting UDP protocol with info hash as GET parameter.
2020-12-14 08:57:16
added note to first post  the code has changed a lot so github is far behind until next month ,
and a quick look at the admin side the admincp will preferably go everything will be split like the adduser section this will end up on profile controller inline

the controller methods (the query should be in the model)
    public function adduser()
   {
       if ($_SESSION["class"] < "7") {
           show_error_msg("Error", "Sorry you do not have the rights to view this page!", 1);
       }
       $data = [];
       $this->view('admin/adduser', $data);
   }

   public function addeduserok()
   {
       if ($_SERVER["REQUEST_METHOD"] == "POST") {
           if ($_POST["username"] == "" || $_POST["password"] == "" || $_POST["email"] == "") {
               show_error_msg("Error", "Missing form data.");
           }
           if ($_POST["password"] != $_POST["password2"]) {
               show_error_msg("Error", "Passwords mismatch.");
           }
           $username = $_POST["username"];
           $password = $_POST["password"];
           $email = $_POST["email"];
           $secret = mksecret();
           $passhash = md5($password);
           $secret = $secret;
           $count = get_row_count("users", "WHERE username=$username");
           if (!$count !=0) {
           show_error_msg("Error", "Unable to create the account. The user name is possibly already taken.");
           Redirect::to(URLROOT . "/admincp");
           die;
           }
           DB::run("INSERT INTO users (added, last_access, secret, username, password, status, email) VALUES (?,?,?,?,?,?,?)", [get_date_time(), get_date_time(), $secret, $username, $passhash, 'confirmed', $email]);
           Redirect::autolink(URLROOT . "/admincp", Lang::T("COMPLETE"));
       }
   }


the template (bootstrap)

<?php
Style::adminheader("Add User");
Admincp::adminnavmenu1();
Style::begin("Add User");
?>
   <center><b>Add user</b></center>
   <div class="form-group">
   <form method=get action=?>
   <input type=hidden name=action value=users>
   Search Users: <input type=text size=30 name=search>
   <input type=submit value='Search'>
   </form>
   <form method=post action='<?php echo URLROOT; ?>/admincp/addeduserok'>
   <div class="form-group">
       <label for="name">Username</label>
       <input id="name" type="text" class="form-control" name="username" minlength="3" maxlength="25" required autofocus>
   </div>
   <div class="form-group">
       <label for="name">Password</label>
       <input id="name" type="text" class="form-control" name="password" minlength="3" maxlength="25" required autofocus>
   </div>
   <div class="form-group">
       <label for="name">Re-type password</label>
       <input id="name" type="text" class="form-control" name="password2" minlength="3" maxlength="25" required autofocus>
   </div>
   <div class="form-group">
       <label for="name">E-mail</label>
       <input id="name" type="text" class="form-control" name="email" minlength="3" maxlength="25" required autofocus>
   </div>
   <div class="form-group">
   <div class="form-group no-margin">
       <button type="submit" class="btn btn-primary btn-block">Okay</button>
   </div>
   </form>
   </div>
   </div>
<?php
Style::end();
Style::adminfooter();



image is from mobile device
Untitled.png
Untitled.png
2020-12-15 20:20:21
"m-jay, post: 69700, member: 20288":

added note to first post  the code has changed a lot so github is far behind until next month ,
and a quick look at the admin side the admincp will preferably go everything will be split like the adduser section this will end up on profile controller inline

the controller methods (the query should be in the model)
    public function adduser()
   {
       if ($_SESSION["class"] < "7") {
           show_error_msg("Error", "Sorry you do not have the rights to view this page!", 1);
       }
       $data = [];
       $this->view('admin/adduser', $data);
   }

   public function addeduserok()
   {
       if ($_SERVER["REQUEST_METHOD"] == "POST") {
           if ($_POST["username"] == "" || $_POST["password"] == "" || $_POST["email"] == "") {
               show_error_msg("Error", "Missing form data.");
           }
           if ($_POST["password"] != $_POST["password2"]) {
               show_error_msg("Error", "Passwords mismatch.");
           }
           $username = $_POST["username"];
           $password = $_POST["password"];
           $email = $_POST["email"];
           $secret = mksecret();
           $passhash = md5($password);
           $secret = $secret;
           $count = get_row_count("users", "WHERE username=$username");
           if (!$count !=0) {
           show_error_msg("Error", "Unable to create the account. The user name is possibly already taken.");
           Redirect::to(URLROOT . "/admincp");
           die;
           }
           DB::run("INSERT INTO users (added, last_access, secret, username, password, status, email) VALUES (?,?,?,?,?,?,?)", [get_date_time(), get_date_time(), $secret, $username, $passhash, 'confirmed', $email]);
           Redirect::autolink(URLROOT . "/admincp", Lang::T("COMPLETE"));
       }
   }


the template (bootstrap)

<?php
Style::adminheader("Add User");
Admincp::adminnavmenu1();
Style::begin("Add User");
?>
   <center><b>Add user</b></center>
   <div class="form-group">
   <form method=get action=?>
   <input type=hidden name=action value=users>
   Search Users: <input type=text size=30 name=search>
   <input type=submit value='Search'>
   </form>
   <form method=post action='<?php echo URLROOT; ?>/admincp/addeduserok'>
   <div class="form-group">
       <label for="name">Username</label>
       <input id="name" type="text" class="form-control" name="username" minlength="3" maxlength="25" required autofocus>
   </div>
   <div class="form-group">
       <label for="name">Password</label>
       <input id="name" type="text" class="form-control" name="password" minlength="3" maxlength="25" required autofocus>
   </div>
   <div class="form-group">
       <label for="name">Re-type password</label>
       <input id="name" type="text" class="form-control" name="password2" minlength="3" maxlength="25" required autofocus>
   </div>
   <div class="form-group">
       <label for="name">E-mail</label>
       <input id="name" type="text" class="form-control" name="email" minlength="3" maxlength="25" required autofocus>
   </div>
   <div class="form-group">
   <div class="form-group no-margin">
       <button type="submit" class="btn btn-primary btn-block">Okay</button>
   </div>
   </form>
   </div>
   </div>
<?php
Style::end();
Style::adminfooter();



image is from mobile device


Request vars are wide open and unsanitized, is this performed elsewhere (models or views)? I recommend checking a key dictionary or making use of filter module and suppress warnings with isset, etc. Those and/or conditions can then just call $data[] only once, while checking all.
2020-12-16 21:37:09
making my way through all html, fine tuning controllers - here is a look at the friends controller in bootstrap, tablet and mobile view
Untitled.png
Untitled.png
Untitled1.png
Untitled1.png
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