mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-29 08:27:23 +08:00
improve torrent download url
This commit is contained in:
@@ -609,7 +609,7 @@ function isRunningInConsole(): bool
|
|||||||
return php_sapi_name() == 'cli';
|
return php_sapi_name() == 'cli';
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_base_announce_url()
|
function get_tracker_schema_and_host(): array
|
||||||
{
|
{
|
||||||
global $https_announce_urls, $announce_urls;
|
global $https_announce_urls, $announce_urls;
|
||||||
$httpsAnnounceUrls = array_filter($https_announce_urls);
|
$httpsAnnounceUrls = array_filter($https_announce_urls);
|
||||||
@@ -637,5 +637,5 @@ function get_base_announce_url()
|
|||||||
$base_announce_url = $announce_urls[0];
|
$base_announce_url = $announce_urls[0];
|
||||||
}
|
}
|
||||||
do_log($log);
|
do_log($log);
|
||||||
return $ssl_torrent . $base_announce_url;
|
return compact('ssl_torrent', 'base_announce_url');
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -65,7 +65,9 @@ if (@ini_get('output_handler') == 'ob_gzhandler' AND @ob_get_length() !== false)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$base_announce_url = get_base_announce_url();
|
$trackerSchemaAndHost = get_tracker_schema_and_host();
|
||||||
|
$ssl_torrent = $trackerSchemaAndHost['ssl_torrent'];
|
||||||
|
$base_announce_url = $trackerSchemaAndHost['base_announce_url'];
|
||||||
|
|
||||||
$res = sql_query("SELECT torrents.name, torrents.filename, torrents.save_as, torrents.size, torrents.owner, torrents.banned, categories.mode as search_box_id FROM torrents left join categories on torrents.category = categories.id WHERE torrents.id = ".sqlesc($id)) or sqlerr(__FILE__, __LINE__);
|
$res = sql_query("SELECT torrents.name, torrents.filename, torrents.save_as, torrents.size, torrents.owner, torrents.banned, categories.mode as search_box_id FROM torrents left join categories on torrents.category = categories.id WHERE torrents.id = ".sqlesc($id)) or sqlerr(__FILE__, __LINE__);
|
||||||
$row = mysql_fetch_assoc($res);
|
$row = mysql_fetch_assoc($res);
|
||||||
|
|||||||
Reference in New Issue
Block a user