fork download
  1. <?php
  2. // TikTok video URL
  3. $tiktokUrl = "https://w...content-available-to-author-only...k.com/@maligoshik/video/7472584144510373125";
  4.  
  5. // Fetch the HTML content of the TikTok page
  6. $html = file_get_contents($tiktokUrl);
  7.  
  8. // Use a regular expression to extract the thumbnail URL from the meta tags
  9. preg_match('/<meta property="og:image" content="(.*?)"/', $html, $matches);
  10.  
  11. if (isset($matches[1])) {
  12. $thumbnailUrl = $matches[1];
  13. echo "<img src='$thumbnailUrl' alt='TikTok Video Thumbnail'>";
  14. } else {
  15. echo "Thumbnail not found.";
  16. }
  17. ?>
Success #stdin #stdout #stderr 0.03s 26440KB
stdin
Standard input is empty
stdout
Thumbnail not found.
stderr
PHP Warning:  file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home/v1z28w/prog.php on line 6
PHP Warning:  file_get_contents(https://...@maligoshik/video/7472584144510373125): failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home/v1z28w/prog.php on line 6