web.php 657 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. $null = null;
  11. new captcha($null, $null, $null, "web", false);
  12. [$scraper, $filters] = $frontend->getscraperfilters(
  13. "web",
  14. isset($_GET["scraper"]) ? $_GET["scraper"] : null
  15. );
  16. $get = $frontend->parsegetfilters($_GET, $filters);
  17. if(!isset($_GET["extendedsearch"])){
  18. $get["extendedsearch"] = "no";
  19. }
  20. try{
  21. echo json_encode(
  22. $scraper->web($get),
  23. JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
  24. );
  25. }catch(Exception $e){
  26. echo json_encode(["status" => $e->getMessage()]);
  27. }