From cdf958d29333d448f4521f4d2faa2592b58e9b27 Mon Sep 17 00:00:00 2001 From: lolcat Date: Sun, 10 Aug 2025 21:55:15 -0400 Subject: fix wikipedia crash --- api/v1/images.php | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 api/v1/images.php (limited to 'api/v1/images.php') diff --git a/api/v1/images.php b/api/v1/images.php new file mode 100644 index 0000000..de2c5a9 --- /dev/null +++ b/api/v1/images.php @@ -0,0 +1,39 @@ + "The server administrator disabled the API!"]); + return; +} + +include "lib/frontend.php"; +$frontend = new frontend(); + +/* + Captcha +*/ +include "lib/bot_protection.php"; +$null = null; +new bot_protection($null, $null, $null, "images", false); + +[$scraper, $filters] = $frontend->getscraperfilters( + "images", + isset($_GET["scraper"]) ? $_GET["scraper"] : null +); + +$get = $frontend->parsegetfilters($_GET, $filters); + +try{ + echo json_encode( + $scraper->image($get), + JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_INVALID_UTF8_IGNORE + ); + +}catch(Exception $e){ + + echo json_encode(["status" => $e->getMessage()]); +} -- cgit v1.2.3