web.php 626 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. header("Content-Type: application/json");
  3. chdir("../../");
  4. include "lib/frontend.php";
  5. $frontend = new frontend();
  6. /*
  7. Captcha
  8. */
  9. include "lib/captcha_gen.php";
  10. new captcha($frontend, false);
  11. [$scraper, $filters] = $frontend->getscraperfilters(
  12. "web",
  13. isset($_GET["scraper"]) ? $_GET["scraper"] : null
  14. );
  15. $get = $frontend->parsegetfilters($_GET, $filters);
  16. if(!isset($_GET["extendedsearch"])){
  17. $get["extendedsearch"] = "no";
  18. }
  19. try{
  20. echo json_encode(
  21. $scraper->web($get),
  22. JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
  23. );
  24. }catch(Exception $e){
  25. echo json_encode(["status" => $e->getMessage()]);
  26. }