是否有一个网址可以让我在 YouTube 上搜索“foo”,并返回带有视频列表的 JSON?
YouTube JSON API 页面可以帮助您。
API 页面上的一些研究指出 http://gdata.youtube.com/feeds/api/videos?q=foo&alt=json 就是您所需要的...
最新更新:
https://www.googleapis.com/youtube/v3/search?part=snippet&q=SEARCHPARAMATER&maxResults=25&key=
key
通过使用此 URL,您将能够提供搜索参数并获取所需的 JSON。
yt-dlp可以帮助您。
yt-dlp --print-json ytsearch:'foo' --get-id --get-title --get-duration --get-description
然后你可以将命令的输出重定向到一个文件,这将是最好的选择,你也可以使用lib而不是命令行。