Scraping improvements (#1046)

This commit is contained in:
Cønstantine Kovalensky 2023-11-06 12:00:24 +04:00 committed by GitHub
commit 9ca9c72a08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -72,13 +72,13 @@ if (!empty($info_hash_count)) {
if (!empty($rowset)) {
foreach ($rowset as $scrapes) {
$info_hash_scrape = !empty($scrapes['info_hash_v2']) ? $scrapes['info_hash_v2'] : $scrapes['info_hash'];
$info_hash_scrape = in_array(urlencode($scrapes['info_hash']), $info_hash_array[1]) ? $scrapes['info_hash'] : substr($scrapes['info_hash_v2'], 0, 20);
$torrents['files'][$info_hash_scrape] = [
'complete' => (int)$scrapes['seeders'],
'downloaded' => (int)$scrapes['complete_count'],
'incomplete' => (int)$scrapes['leechers']
];
CACHE('tr_cache')->set(SCRAPE_LIST_PREFIX . bin2hex(substr($info_hash_scrape, 0, 20)), array_slice($torrents['files'], -1, null, true), SCRAPE_LIST_EXPIRE);
CACHE('tr_cache')->set(SCRAPE_LIST_PREFIX . bin2hex($info_hash_scrape), array_slice($torrents['files'], -1, null, true), SCRAPE_LIST_EXPIRE);
}
}
}

View file

@ -95,8 +95,8 @@ $bb_cfg['gzip_compress'] = false; // compress output
// Tracker
$bb_cfg['announce_interval'] = 1800; // Announce interval (default: 1800)
$bb_cfg['scrape_interval'] = 100; // Scrape interval (default: 100)
$bb_cfg['max_scrapes'] = 20; // Allowed number of info-hashes for simultaneous scraping (default: 20)
$bb_cfg['scrape_interval'] = 80; // Scrape interval (default: 100)
$bb_cfg['max_scrapes'] = 150; // Allowed number of info-hashes for simultaneous scraping (default: 150)
$bb_cfg['passkey_key'] = 'uk'; // Passkey key name in GET request
$bb_cfg['ignore_reported_ip'] = false; // Ignore IP reported by client
$bb_cfg['verify_reported_ip'] = true; // Verify IP reported by client against $_SERVER['HTTP_X_FORWARDED_FOR']