videos.php 557 B

1234567891011121314151617181920212223242526272829303132
  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. "videos",
  13. isset($_GET["scraper"]) ? $_GET["scraper"] : null
  14. );
  15. $get = $frontend->parsegetfilters($_GET, $filters);
  16. try{
  17. echo json_encode(
  18. $scraper->video($get),
  19. JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
  20. );
  21. }catch(Exception $e){
  22. echo json_encode(["status" => $e->getMessage()]);
  23. }