mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Scraping improvements (#1046)
This commit is contained in:
parent
c0194aaa54
commit
9ca9c72a08
2 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue