node.js - 尝试从节点中的 YouTube 获取带有缩略图的播放列表
问题描述
我正在尝试从 youtube 获取播放列表。我只得到播放列表的 ID、标题和描述。这是我正在使用的代码。让我知道我还能做些什么来获取缩略图。
谢谢!
const youtubeVideoParams = `key=${apiKey}&channelId=UCEAH4aJ0QadOFn7yPEfWEHw&part=id,snippet&order=date&maxResults=20`;
app.get('/playlists', cacheMiddleware, (req, res) => {
fetch(`${googleApiUrl}playlists?${youtubeVideoParams}`).then(response => {
return response.json();
}).then(response => {
const playlists = response.items.map(({
id,
snippet
}) => ({
id: id,
title: snippet.title,
desc: snippet.description,
thumbnails: snippet.thumbnails,
})).reverse();
解决方案
推荐阅读
- database-design - 具有一致哈希 P2P 设计的高可用性数据库
- oracle - 带有 64 位版本的 Office 365 上的 MS Access 数据库因链接 Oracle 表而间歇性挂起
- javascript - 如果任何子对象(递归)匹配值,我如何在父对象上设置属性
- c - 线程不安全的伪随机数生成器
- file-upload - 使用 apache.wicket.ServletFileUpload 上传文件
- java - 我正在尝试使用 pd4ml 将 .jsp 转换为 .pdf 格式。当开始执行我的代码时,我在下面得到执行
- node.js - Node.js PDFkit 导致 ERR_CONNECTION_REFUSED
- python - Python Map函数,我可以迭代函数,而不是输入吗?
- webrtc - 谷歌 webrtc 原生实现是否支持 SFU?
- javascript - 无法将 Stripe 结帐集成到 Vue JS 应用程序中