SuspiciousLookingOwl / youtubei

Get Youtube data such as videos, playlists, channels, video information & comments, related videos, up next video, and more!
https://suspiciouslookingowl.github.io/youtubei
MIT License
240 stars 50 forks source link

Undefined sub count :( #38

Closed SupertigerDev closed 3 years ago

SupertigerDev commented 3 years ago

Describe the bug item.channel.subscriberCount returns undefined when searching for videos.

To Reproduce Steps to reproduce the behavior:

const results = await client.search("Overwatch").then(items => {
    return items.forEach(item => {
        if (item.constructor.name === "VideoCompact") console.log({subCount: item.channel.subscriberCount});
    });
})
console.log(results);

Expected behavior A clear and concise description of what you expected to happen. Show me the sub counts instead of saying "undefined"

SuspiciousLookingOwl commented 3 years ago

This is expected, there are no subscriber count data available from the video search result, only id, name, and avatar url image

SupertigerDev commented 3 years ago

ahh, i see. Thanks!

SupertigerDev commented 3 years ago

BTW, even when using the getVideo function, subcount is still undefined :/

SuspiciousLookingOwl commented 3 years ago

Yea somehow I missed that, will be fixed on next version