Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getInfo author videoDetails lost(?) #789

Closed
KRooijackers opened this issue Nov 26, 2020 · 9 comments
Closed

getInfo author videoDetails lost(?) #789

KRooijackers opened this issue Nov 26, 2020 · 9 comments
Labels

Comments

@KRooijackers
Copy link

I created an MessageEmbed which showed some details of the song and author when the used called the function '$nowplaying'. While this function is still fully functional, some of the details went 'undefined'. I printed the getInfo videoDetails onto the console and found out that the author array (and media array) are no longer inside videoDetails. Last time I played around with the bot was 5 days ago and believe I was on v4.0.3. I updated ytdl-core to v4.1.0 today only now this 'undefined' thing started to happen.

    async execute(message, servers) {
        var server = servers[message.guild.id];

        ytdl.getInfo(server.queue[0]).then(function(info){
            const embed = new MessageEmbed();
            const { thumbnail, title, lengthSeconds, ownerProfileUrl, viewCount, category, publishDate, ownerChannelName, uploadDate, averageRating, video_url } = info.videoDetails;
            const { name, avatar, user_url, subscriber_count } = info.videoDetails.author;

            //console.log(info.videoDetails);

            embed.setTitle(title)
            .setDescription(`This masterpiece was created by ${actualWriter}. Be sure to check out this artist for more awesome songs!\n`)
            .addField('Views', viewCount, true)
            .addField('Subscribers', subscriber_count, true)
            .setThumbnail(thumbnail.thumbnails[thumbnail.thumbnails.length - 1].url)
            .setTimestamp(publishDate)
            .setFooter(name, avatar)

            message.channel.send(embed);
        });
    }

Wondering what is the reason behind this and if I can still retrieve this information in any way.

@WOZARDLOZARD
Copy link

It appears that all of the properties of videoDetails.author have been removed and now videoDetails.author is a string with only the author's name. Hopefully the author's properties can be added back soon though because they do provide some useful information.

@fent
Copy link
Owner

fent commented Nov 27, 2020

i was testing this out earlier, like an hour ago, and was indeed getting empty fields for author, media, relatedVideos. it was due to the endpoints that ytdl-core uses changing what they return. videos were at least still working, but not some fields.

but anyway, they seem to work again. let me know if this is working for you now

@KRooijackers
Copy link
Author

KRooijackers commented Nov 27, 2020

@fent FYI, I did not update ytdl-core since I posted this issue. If I should have, please tell me.

Anyway, I noticed indeed that there are (still) empty fields. I'm not sure if I even saw the empty fields when I last posted, because I think I didn't. Regardless, the issue still remains for me. Lemme know if I can help you by sending more details. I could send some results of the console log if that would help.

@WOZARDLOZARD
Copy link

but anyway, they seem to work again. let me know if this is working for you now

The videoDetails.author property is now returning an empty object ({}) for me... strange

@fent
Copy link
Owner

fent commented Nov 29, 2020

do you have a sample video where this happens?

@WOZARDLOZARD
Copy link

Seems like I'm running into this issue on every video, here's the link to a video that I just tested with: https://www.youtube.com/watch?v=jqkPqfOFmbY

@fent fent added the bug label Nov 30, 2020
@fent fent closed this as completed in 7a831c3 Nov 30, 2020
@WOZARDLOZARD
Copy link

I updated my ytdl-core to the latest version just now and I'm still getting an empty object for videoDetails.author. I tested with this video: https://www.youtube.com/watch?v=n8X9_MgEdCg

@KRooijackers
Copy link
Author

I also updated ytdl-core and I'm still having empty objects. Tested with for example https://www.youtube.com/watch?v=cKZU--qmwmE and https://www.youtube.com/watch?v=xzPiya-QfJA.

@FalledStars
Copy link

Hi, [object Object] does not mean the api get empty, and it means it get all author information but could not show all. Please try videoDetails.author.name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants