dsjbest2015 2015-01-08 08:50
浏览 86
已采纳

如何从youtube视频获取视频标签?

Hi I want to get tags of video from youtube video url, I have searched in google but mostly I get answer that "YouTube's API can no longer be used to retrieve tags".

So is there any way that I can get video tags from youtube video using php or any api?

  • 写回答

3条回答 默认 最新

  • dongnao2048 2015-01-08 11:00
    关注

    For example for URL : http://www.youtube.com/watch?v=LIjs3-8cZVA

    $connect = file_get_contents("http://www.youtube.com/watch?v=LIjs3-8cZVA");
    preg_match_all('|<meta property="og\:video\:tag" content="(.+?)">|si', $connect, $tags, PREG_SET_ORDER);
    foreach ($tags as $tag) {
        echo $tag[1] . "<br>";
    }
    

    I hope it helps.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记