mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-05-09 11:41:36 +02:00
parent
b5bb465cdc
commit
3f210c53f4
1 changed files with 10 additions and 8 deletions
|
@ -139,18 +139,20 @@ export default class {
|
||||||
// Start fetching extra details about videos
|
// Start fetching extra details about videos
|
||||||
videoDetailsPromises.push((async () => {
|
videoDetailsPromises.push((async () => {
|
||||||
// Unfortunately, package doesn't provide a method for this
|
// Unfortunately, package doesn't provide a method for this
|
||||||
|
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(
|
const {items: videoDetailItems} = await this.cache.wrap(
|
||||||
async () => got(
|
async () => got(
|
||||||
'https://www.googleapis.com/youtube/v3/videos',
|
'https://www.googleapis.com/youtube/v3/videos',
|
||||||
{
|
p,
|
||||||
searchParams: {
|
|
||||||
part: 'contentDetails',
|
|
||||||
id: items.map(item => item.contentDetails.videoId).join(','),
|
|
||||||
key: this.youtubeKey,
|
|
||||||
responseType: 'json',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
).json() as Promise<{items: VideoDetailsResponse[]}>,
|
).json() as Promise<{items: VideoDetailsResponse[]}>,
|
||||||
|
p,
|
||||||
{
|
{
|
||||||
expiresIn: ONE_MINUTE_IN_SECONDS,
|
expiresIn: ONE_MINUTE_IN_SECONDS,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue