mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-23 09:15:29 +01:00
parent
b5bb465cdc
commit
3f210c53f4
|
@ -139,18 +139,20 @@ export default class {
|
|||
// Start fetching extra details about videos
|
||||
videoDetailsPromises.push((async () => {
|
||||
// Unfortunately, package doesn't provide a method for this
|
||||
const {items: videoDetailItems} = await this.cache.wrap(
|
||||
async () => got(
|
||||
'https://www.googleapis.com/youtube/v3/videos',
|
||||
{
|
||||
const p = {
|
||||
searchParams: {
|
||||
part: 'contentDetails',
|
||||
id: items.map(item => item.contentDetails.videoId).join(','),
|
||||
key: this.youtubeKey,
|
||||
responseType: 'json',
|
||||
},
|
||||
},
|
||||
};
|
||||
const {items: videoDetailItems} = await this.cache.wrap(
|
||||
async () => got(
|
||||
'https://www.googleapis.com/youtube/v3/videos',
|
||||
p,
|
||||
).json() as Promise<{items: VideoDetailsResponse[]}>,
|
||||
p,
|
||||
{
|
||||
expiresIn: ONE_MINUTE_IN_SECONDS,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue