Advertisement
Guest User

Untitled

a guest
Aug 16th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. private function checkPlayer($url)
  2. {
  3.  
  4. $client = new GuzzleHttp\Client();
  5.  
  6. $i = $client->request('GET', $url, ['http_errors' => false]);
  7.  
  8. $sc = $i->getStatusCode();
  9.  
  10. $i = $i->getBody()->getContents();
  11.  
  12. if ($sc == 200) {
  13. if (str_contains($i, 'Sorry') || str_contains($i, 'exist !') || str_contains($i, 'deleted')) {
  14. return true;
  15. }
  16. }else{
  17. if ($sc == 404) {
  18. return true;
  19. }
  20. }
  21.  
  22. return false;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement