Advertisement
rhcp011235

Untitled

Sep 26th, 2024
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. <?php
  2.  
  3. // Download MKBHD wallpapers
  4. // @john011235
  5. error_reporting(E_ERROR | E_PARSE);
  6.  
  7. if (!file_exists('./mkbhd_walls/')) {
  8.     mkdir('./mkbhd_walls', 0777, true);
  9. }
  10.  
  11.  
  12. $walls = file_get_contents('https://storage.googleapis.com/panels-api/data/20240916/media-1a-i-p~s');
  13. $decoded_json = json_decode($walls, false);
  14.  
  15. $wallpapers = $decoded_json->data;
  16. $i = 0;
  17.  
  18. foreach($wallpapers as $wallpaper)
  19. {
  20.     if ($wallpaper->dhd == "") continue;
  21.     $url = $wallpaper->dhd;
  22.     $image = file_get_contents($url);
  23.     file_put_contents("./mkbhd_walls/wall_$i.jpg", $image);
  24.     $i++;
  25. }
  26.  
  27.  
  28. ?>
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement