Closed KareemH closed 4 years ago
It should return string, i figured out what causes this but i'm not going to release any update for it for now because i'm still working on improving getVideo()
scrapping.
For now you can do something like this to check whether thumbnail is string or not
var videos = scrapeYt.search("something");
for (video of videos) {
var thumbnailUrl = "";
if (typeof video.thumbnail === "string") {
thumbnailUrl = video.thumbnail;
} else {
thumbnailUrl = video.thumbnail.url
}
console.log(thumbnailUrl);
}
Fixed on 2c504e2fad67195ee51310ffda9b03ea72ccd481 Updated at npm (v1.0.13)
Thanks for reporting this!
I want to store the thumbnail url (which I presume is a string) into my database, and the field of where I store the thumbnail is type String
However, I receive this error
Interestingly, some songs are able to store the thumbnail url as a string (coverImage field)......