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

length of search output not constrained by "max_results" #64

Open
ctlamb opened this issue Nov 7, 2018 · 8 comments
Open

length of search output not constrained by "max_results" #64

ctlamb opened this issue Nov 7, 2018 · 8 comments
Assignees
Labels

Comments

@ctlamb
Copy link

ctlamb commented Nov 7, 2018

Just a heads up:

search1 <- yt_search(term="drone")
nrow(search1)
[1] 572

search2 <- yt_search(term="drone",max_results=50)
nrow(search2)
[1] 572

Also, if there is the length of returned searches always constrained near 500? Some searches that I expect 1000's of hits ("wildlife, or "cats") only seem to produce 450, or 550 results?

@soodoku soodoku self-assigned this Nov 10, 2018
@soodoku soodoku added the bug label Nov 10, 2018
@soodoku
Copy link
Member

soodoku commented Nov 10, 2018

thanks for flagging this. will issue a patch soon.

@ctlamb
Copy link
Author

ctlamb commented Nov 10, 2018

Great thanks.

I have a quick question regarding more complex searches. I get comparable results in Tuber, YouTube API, and on the YouTube GUI when I search a single word. But when I want something more complex ( like “bear AND drone”) the Tuber results are much different (even if I try “bear drone”, “bear and drone”). Can you comment on this?

@soodoku
Copy link
Member

soodoku commented Nov 10, 2018

When you say YouTube GUI, do you mean searching right on YouTube.com? If so, that is perfectly understandable. Google there is trying to think about user intent and likely has a ML model. In the API, it is generally doing is this phrase there or not. But let's do this step by step.

@ctlamb
Copy link
Author

ctlamb commented Nov 10, 2018

OK thanks for the clarification. Yes I means YouTube.com. That makes sense about the ML model.

But we should expect the Tuber and API results to always be comparable? If I search “bead drone” I should get comparable results in each?

Are Boolean operators allowed? AND, OR?

@soodoku
Copy link
Member

soodoku commented Nov 10, 2018

Good q. See the API documentation here: https://developers.google.com/youtube/v3/docs/search/list

"Your request can also use the Boolean NOT (-) and OR (|) operators to exclude videos or to find videos that are associated with one of several search terms. For example, to search for videos matching either "boating" or "sailing", set the q parameter value to boating|sailing. Similarly, to search for videos matching either "boating" or "sailing" but not "fishing", set the q parameter value to boating|sailing -fishing. Note that the pipe character must be URL-escaped when it is sent in your API request. The URL-escaped value for the pipe character is %7C."

@ctlamb
Copy link
Author

ctlamb commented Nov 10, 2018

Excellent! This is very helpful. Thanks. Will try when I’m back at my computer and report back. Thanks again.

@ctlamb
Copy link
Author

ctlamb commented Nov 14, 2018

Thanks, this works well. Now what about "&" or "and". I understand from the API documentation I can get boating or sailing with boating|sailing, but what if I want boating and sailing?

With "boating and sailing", the API returns titles with boating (or boat) and sailing in the title. Tuber doesn't seem to, just titles that have one of the words, or none, maybe sailing in the title.

@j1wonkim
Copy link

I am wondering about the same thing about "&".

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

3 participants