YouTube Data API v3 又一次没有提供基本功能。
我建议你试试我的open-sourceYouTube operational API。事实上,通过获取https://yt.lemnoslife.com/videos?part=musics&id=VIDEO_ID,您将获得item["musics"]中视频中包含的音乐。
The YouTube video you shared Ehoe35hTbuY 是一个很好的视频来测试我的 API 的这个功能,因为它包含 10 首音乐。使用此视频 ID,您将获得:
{
"kind": "youtube#videoListResponse",
"etag": "NotImplemented",
"items": [
{
"kind": "youtube#video",
"etag": "NotImplemented",
"id": "Ehoe35hTbuY",
"musics": [
{
"id": "JGwWNGJdvx8",
"title": "Shape of You",
"licenses": "WMG; LatinAutor - Warner Chappell, BMG Rights Management (US), LLC, Warner Chappell, UMPG Publishing, AMRA, LatinAutorPerf, ASCAP, MINT_BMG, Spirit Music Publishing, BMI - Broadcast Music Inc., Abramus Digital, CMRRA, Sony Music Publishing, LatinAutor, LatinAutor - UMPG, AMRA BR, SOLAR Music Rights Management, UNIAO BRASILEIRA DE EDITORAS DE MUSICA - UBEM, ARESA, LatinAutor - SonyATV, and 13 Music Rights Societies"
},
{
"id": "nSDgHBxUbVQ",
"title": "Photograph",
"licenses": "WMG (on behalf of East West Records UK Ltd); Sony Music Publishing, CMRRA, UNIAO BRASILEIRA DE EDITORAS DE MUSICA - UBEM, LatinAutor, BMI - Broadcast Music Inc., LatinAutor - SonyATV, AMRA BR, LatinAutorPerf, Spirit Music Publishing, SOLAR Music Rights Management, and 15 Music Rights Societies"
},
...
]
}
]
}
我的端点也适用于包含单个音乐的视频,例如 DUT5rEU6pqM。
其他字段artist和writers仍然是work-in-progress。