【问题标题】:Is there way to get the lets say top 5 comments of a youtube video with a command line utility on linux有没有办法在 linux 上使用命令行实用程序来获取 youtube 视频的前 5 条评论
【发布时间】:2020-05-13 10:32:05
【问题描述】:

我想获得 youtube 视频的顶级 cmets。 有没有办法使用可编写脚本的命令行实用程序来做到这一点,或者我需要使用 curl 和 API。

我想过用youtube-dl,但是好像没有这个功能。 有没有类似的工具可以做到这一点?

我还阅读了一些较早的问题,这些问题表明没有办法做到这一点(除了获取所有 cmets 并在本地搜索它们),因为它没有在 API 中实现。 所以我想知道这是否最近发生了变化。

question from 2011

question from 2015

【问题讨论】:

    标签: linux curl command-line youtube-api youtube-dl


    【解决方案1】:

    API 不会将 cmets 排序为“顶级 cmets”(除非您指的是顶级 cmets,这是默认设置),但您可以使用 wget 并解析输出文件。

    wget -O output "https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&maxResults=5&videoId=[VIDEO_ID]&order=time&textFormat=plainText&key=[API_KEY]"
    

    【讨论】:

      猜你喜欢
      • 2022-11-07
      • 2017-08-13
      • 2015-09-02
      • 2013-11-26
      • 1970-01-01
      • 1970-01-01
      • 2013-02-08
      • 2016-08-03
      • 2017-07-12
      相关资源
      最近更新 更多