FastPHP adlı üyeden alıntı: mesajı görüntüle
$kod = $_GET['watch'];
kısmını
$kod = $_GET['watch']; if (strlen($kod) != 11 && preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\/)[^&\n]+|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#", $kod, $matches)) { ; $kod = $matches[1]; }
şeklinde değiştir
Şu şekilde yaptım hocam hata verdi

<?php $kod = $_GET['watch']; if (strlen($kod) != 11 && preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\/)[^&\n]+|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#", $kod, $matches)) { ; $kod = $matches[1]; } $veri = file_get_contents("https://www.youtube.com/watch?v=$kod"); preg_match('#<meta property="og:title" content="(.*?)">#ism',$veri,$t); $title = trim($t[1]); ?>
Site içeriğinde kullandığım kod