如何通过给定 url 获取 youtube 音频数据

How to get youtube audio data through given url

目前我正在做一个音频数据分析项目。

我想让用户输入 Youtube URL

并将 URL 的 youtube 音频数据返回到我的网站。

获取数据后,我想将它们存储在一维数组中以进行进一步的信号处理。

这个任务只能通过Javascript完成吗?

提前致谢。

顺便说一句,音频数据是这样的:(对于 example:wav 音频格式) [0.5,0.9,0.26,0.44,0.23,0.01,0.11,0.54,......]

看这里:https://developers.google.com/youtube/terms

II. Prohibitions
...

  1. separate, isolate, or modify the audio or video components of any YouTube audiovisual content made available through the YouTube API;

  2. promote separately the audio or video components of any YouTube audiovisual content made available through the YouTube API;

所以你不能把音频和视频分开。