Here's the code I'm using:
const ytdl = require("ytdl-core")
ytdl.getInfo("cFJSV2dj0ps").then(info => {
console.log(info.video_id)
})
It logs this:
undefined
In index.d.ts, the type videoInfo is supposed to have a property named video_id, but the actual response does not have this property.
I have some old code that used to use the video_id property, but this code does not work anymore because the property seems to have vanished at some point.
Could you add video_id back, please?
Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.64. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
I can also add that there was also a property named title and now it also disappeared.
I had the same issue, but found it's nested in the object with a slightly different name: player_response.videoDetails.videoId. The title is also there too player_response.videoDetails.title
@meneses-pt — The title issue was fixed a couple of days ago. Update.
@matt2legit — thanks, I guess I'll use that for now.
I had the same issue, but found it's nested in the object with a slightly different name:
player_response.videoDetails.videoId. The title is also there tooplayer_response.videoDetails.title
yeah this. i'm going to add backwards compatibility for some properties that are no longer present in the root info object. but use info.player_response.videoDetails for more consistency in the future.
Most helpful comment
Issue-Label Bot is automatically applying the label
bugto this issue, with a confidence of 0.64. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!Links: app homepage, dashboard and code for this bot.