File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import ytdl_dlp from './yt-dlp.js' ;
22import logger from './logger.js' ;
33import yts from 'play-dl' ;
4- import { YouTubeVideo } from '../@types/index.js' ;
4+ import { YouTubeVideo , YTResponse } from '../@types/index.js' ;
55
66export class Youtube {
77 async getVideoInfo ( url : string ) : Promise < YouTubeVideo | null > {
88 try {
9- const videoData = await ytdl_dlp ( url , { dumpSingleJson : true , noPlaylist : true } ) ;
9+ const videoData = await ytdl_dlp ( url , { dumpSingleJson : true , noPlaylist : true } ) as YTResponse ;
1010
1111 if ( typeof videoData === 'object' && videoData !== null && videoData . id && videoData . title ) {
1212 return {
1313 id : videoData . id ,
1414 title : videoData . title ,
1515 formats : [ ] ,
1616 videoDetails : {
17- isLiveContent : videoData . is_live === true || videoData . live_status === 'is_live'
17+ isLiveContent : videoData . is_live === true || ( videoData as any ) . live_status === 'is_live'
1818 }
1919 } ;
2020 }
You can’t perform that action at this time.
0 commit comments