特定チャンネルの動画情報だったりプレイリスト一覧を取得したいとき、YouTubeAPIv3を使うと思います。
PHPだと、ComposerとかでGoogle公式ライブラリを使うのもいいですが特定の動画の場合はもっとかんたんに動画情報を取得できます。
具体的にはAPIから動画情報が格納されているJSONを呼び出します。
以上!
JSONのURL構造
https://www.googleapis.com/youtube/v3/videos?id=[動画ID]&key=[APIKey]&part=snippet,contentDetails,statistics,status
[APIKey]にはGoogleAPIから取得したAPIキーを入力してください。
キーの取得方法はネットに溢れかえってるんで自分で調べてください。
サンプルコード
YouTubeAPIv3から特定動画のタイトルを取得してみます。
yt.php
$api_key = "APIキーを入力"
$video_id = "動画IDを入力"
$url = "https://www.googleapis.com/youtube/v3/videos?id=$video_id&key=$api_key&part=snippet,contentDetails,statistics,status";
$json = file_get_contents($url);
$getData = json_decode( $json , true);
foreach((array)$getData['items'] as $key => $gDat){
$title = $gDat['snippet']['title'];
}
// タイトルをechoする
echo $title;