File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,17 +118,22 @@ export async function getSubscriptionsRecusive(part, nextPageToken?) {
118118// taken from https://webapps.stackexchange.com/a/101153
119119export const isYouTubeChannelId = ( id ) => / ^ U C [ \w - ] { 21 } [ A Q g w ] $ / . test ( id ) ;
120120export const getLive = ( id , cache ) =>
121- cache . tryGet ( `youtube:getLive:${ id } ` , async ( ) => {
122- const res = await exec ( ( youtube ) =>
123- youtube . search . list ( {
124- part : 'snippet' ,
125- channelId : id ,
126- eventType : 'live' ,
127- type : 'video' ,
128- } )
129- ) ;
130- return res ;
131- } ) ;
121+ cache . tryGet (
122+ `youtube:getLive:${ id } ` ,
123+ async ( ) => {
124+ const res = await exec ( ( youtube ) =>
125+ youtube . search . list ( {
126+ part : 'snippet' ,
127+ channelId : id ,
128+ eventType : 'live' ,
129+ type : 'video' ,
130+ } )
131+ ) ;
132+ return res ;
133+ } ,
134+ config . cache . routeExpire ,
135+ false
136+ ) ;
132137export const getVideoUrl = ( id : string ) => `https://www.youtube-nocookie.com/embed/${ id } ?controls=1&autoplay=1&mute=0` ;
133138
134139// Get the appropriate playlist ID with or without shorts
You can’t perform that action at this time.
0 commit comments