Open JWOverschot opened 6 years ago
I'm having the same problem!
Have an example of implementation code?
As the README sugsessed (https://github.com/nodenica/youtube-node#optional-parameters), I used this code:
const YouTube = require("youtube-node");
const yt= new YouTube();
yt.setKey(settings.youtubeApiKey);
yt.addParam("type", "video");
But I still get playlists in my results.
After searching for a bit, the search method calls the clearParams method which removes the type
property...
The pull request #40 should prevent the issue you are describing if it is merged.
Meanwhile, you can add the params in the search method parameters
yt.search(keyword, maxResults, { type: 'video' }, () => {
...
})
@Qayou Thanks! Thats seems to be working!
on https://developers.google.com/youtube/v3/docs/search/list
type video is valid. But it doesn't work, it still returns channels instead of only videos.
youTube.addParam('type', 'video')
Any idea what it could be?