diff --git a/config.php.example b/config.php.example index fe4e344..5a259f0 100644 --- a/config.php.example +++ b/config.php.example @@ -11,8 +11,8 @@ // You can use any Invidious instance here "invidious_instance_for_video_results" => "https://invidious.snopyta.org", - "disable_bittorent_search" => false, - "bittorent_trackers" => "&tr=http://nyaa.tracker.wf:7777/announce&tr=udp://open.stealth.si:80/announce&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://exodus.desync.com:6969/announce&tr=udp://tracker.torrent.eu.org:451/announce", + "disable_bittorrent_search" => false, + "bittorrent_trackers" => "&tr=http://nyaa.tracker.wf:7777/announce&tr=udp://open.stealth.si:80/announce&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://exodus.desync.com:6969/announce&tr=udp://tracker.torrent.eu.org:451/announce", "disable_hidden_service_search" => false, diff --git a/docker/config.php b/docker/config.php index f82ee08..3eb1370 100644 --- a/docker/config.php +++ b/docker/config.php @@ -5,8 +5,8 @@ "language" => "${CONFIG_LANGUAGE}", "number_of_results" => ${CONFIG_NUMBER_OF_RESULTS}, "invidious_instance_for_video_results" => "${CONFIG_INVIDIOUS_INSTANCE}", - "disable_bittorent_search" => ${CONFIG_DISABLE_BITTORRENT_SEARCH}, - "bittorent_trackers" => "${CONFIG_BITTORRENT_TRACKERS}", + "disable_bittorrent_search" => ${CONFIG_DISABLE_BITTORRENT_SEARCH}, + "bittorrent_trackers" => "${CONFIG_BITTORRENT_TRACKERS}", "disable_hidden_service_search" => ${CONFIG_HIDDEN_SERVICE_SEARCH}, "instance_fallback" => ${CONFIG_INSTANCE_FALLBACK}, "request_cooldown" => ${CONFIG_RATE_LIMIT_COOLDOWN}, diff --git a/misc/search_engine.php b/misc/search_engine.php index cba668c..682282b 100644 --- a/misc/search_engine.php +++ b/misc/search_engine.php @@ -62,6 +62,13 @@ function load_opts() { $opts = require "config.php"; + # account for the old, misspelled options + if (isset($opts->disable_bittorent_search)) + $opts->disable_bittorrent_search = $opts->disable_bittorent_search; + + if (isset($opts->bittorent_trackers)) + $opts->bittorrent_trackers = $opts->bittorent_trackers; + $opts->request_cooldown ??= 25; $opts->cache_time ??= 25; @@ -124,7 +131,7 @@ return new VideoSearch($opts, $mh); case 3: - if ($opts->disable_bittorent_search) { + if ($opts->disable_bittorrent_search) { echo "
" . TEXTS["feature_disabled"] . "
"; break; }