diff --git a/.env b/.env index b533600..3b3ce3a 100644 --- a/.env +++ b/.env @@ -64,4 +64,6 @@ APP_YGGDRASIL=1 APP_TRACKERS=http://[201:23b4:991a:634d:8359:4521:5576:15b7]:2023/announce|http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/announce|http://[316:c51a:62a3:8b9::5]/announce +APP_CRAWLERS=30a:5fad::e + APP_TORRENT_FILE_SIZE_MAX=1024000 \ No newline at end of file diff --git a/config/services.yaml b/config/services.yaml index c1ed9ce..7e673e1 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -9,6 +9,7 @@ parameters: app.key: '%env(APP_KEY)%' app.pagination: '%env(APP_PAGINATION)%' app.trackers: '%env(APP_TRACKERS)%' + app.crawlers: '%env(APP_CRAWLERS)%' app.locales: '%env(APP_LOCALES)%' app.themes: '%env(APP_THEMES)%' app.locale: '%env(APP_LOCALE)%' diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index e5865dd..c6a9213 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -1564,6 +1564,12 @@ class TorrentController extends AbstractController ); } + // Block crawler requests + if (in_array($request->getClientIp(), explode('|', $this->getParameter('app.crawlers')))) + { + throw $this->createNotFoundException(); + } + // Init torrent if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) { @@ -1643,6 +1649,12 @@ class TorrentController extends AbstractController ); } + // Block crawler requests + if (in_array($request->getClientIp(), explode('|', $this->getParameter('app.crawlers')))) + { + throw $this->createNotFoundException(); + } + // Init torrent if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) { @@ -1764,6 +1776,12 @@ class TorrentController extends AbstractController ); } + // Block crawler requests + if (in_array($request->getClientIp(), explode('|', $this->getParameter('app.crawlers')))) + { + throw $this->createNotFoundException(); + } + // Init torrent if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) {