fork download
  1. <?php
  2. $url = 'https://f...content-available-to-author-only...l.site/';
  3. $ch = curl_init($url);
  4.  
  5. // Options de cURL
  6. CURLOPT_RETURNTRANSFER => true,
  7. CURLOPT_FOLLOWLOCATION => true,
  8. CURLOPT_SSL_VERIFYPEER => true,
  9. CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
  10. CURLOPT_REFERER => 'https://www.google.com/',
  11. CURLOPT_ENCODING => '',
  12. CURLOPT_HTTPHEADER => [
  13. 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
  14. 'Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.5,en;q=0.3',
  15. 'Connection: keep-alive'
  16. ]
  17. ]);
  18.  
  19. $html = curl_exec($ch);
  20. $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  21.  
  22. if ($http_code == 200 && $html !== false) {
  23. // Regex pour extraire l'URL spécifique
  24. $pattern = '/<a href="(.*?)\/" class="action-button"/';
  25.  
  26. if (preg_match($pattern, $html, $matches)) {
  27. $extractedUrl = $matches[1];
  28. header("Content-Type: text/plain; charset=UTF-8");
  29. echo "URL extraite : " . $extractedUrl;
  30. } else {
  31. echo "Aucune URL trouvée avec le pattern spécifié";
  32. }
  33. } else {
  34. echo "Erreur lors du chargement de la page. Code HTTP: $http_code";
  35. if (curl_errno($ch)) {
  36. echo "\nErreur cURL: " . curl_error($ch);
  37. }
  38. }
  39. ?>
Success #stdin #stdout #stderr 0.03s 26504KB
stdin
Standard input is empty
stdout
Erreur lors du chargement de la page. Code HTTP: 0
stderr
PHP Warning:  curl_errno(): supplied resource is not a valid cURL handle resource in /home/QAtO5L/prog.php on line 37