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

addParam('type', 'video') doesn't filter out all videos #41

Open
JWOverschot opened this issue Nov 20, 2017 · 5 comments
Open

addParam('type', 'video') doesn't filter out all videos #41

JWOverschot opened this issue Nov 20, 2017 · 5 comments

Comments

@JWOverschot
Copy link

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?

@Delivator
Copy link

I'm having the same problem!

@paulomcnally
Copy link
Owner

Have an example of implementation code?

@Delivator
Copy link

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.

@pierre-charpentier
Copy link

pierre-charpentier commented Mar 21, 2018

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' }, () => {
    ...
})

@Delivator
Copy link

@qayou Thanks! Thats seems to be working!

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

No branches or pull requests

4 participants