def __init__(self, url, progress_hook):
self._url = url
self._progress_hook = progress_hook
self._INFO_OPTS = {
'logger': YoutubeDLLogger(),
'socket_timeout': 10
}
ydl = ytdl.YoutubeDL(self._INFO_OPTS)
self._progress_hook({
'status': 'getting_information'
})
self._info = ydl.extract_info(self._url, download=False)
self._progress_hook({
'status': 'information_downloaded',
'type': 'playlist' if self.is_playlist() else 'video'
})
评论列表
文章目录