yt icon indicating copy to clipboard operation
yt copied to clipboard

Reaching 10000 quotas request with 100 for Yt::Collections::Videos.new.where(q: "title ", max_results: 1).first

Open gkosmo opened this issue 4 years ago • 2 comments

I have a Quota for 10.000 queries a day, but it seems weird that Yt::Collections::Videos.new.where(q: "title ", max_results: 1).first reaches it after 100 requests. Is there another way to do a search request that doesn't do that much queries ?

gkosmo avatar May 31 '21 14:05 gkosmo

I am facing the same issue. I am trying to identify where that 100 quota consumption comes from. Based on the data provided here https://developers.google.com/youtube/v3/determine_quota_cost, I think the query the gem does refer to search -> list that has a cost of 100.

JCcanizares avatar Aug 11 '21 13:08 JCcanizares

Can you show us the curl commands when you do Yt::Collections::Videos.new.where(q: "title ", max_results: 1).first? You can see them if you set log level "devel"

kangkyu avatar Jun 16 '22 20:06 kangkyu

Yt::Collections::Videos.new(auth: account).where(q: "title ", max_results: 1).first

I just tried this (I was curious) and it made only 1 request as below. I couldn't get 100 requests @gkosmo

curl -X GET -H "content-length: 0" -H "user-agent: Yt::Request (gzip)" -H "authorization: Bearer ya29.token"
 "https://www.googleapis.com/youtube/v3/search?maxResults=1&order=date&part=snippet&q=title+&type=video"

kangkyu avatar Sep 27 '23 06:09 kangkyu

closing for now. feel free to reopen if anything.

kangkyu avatar Oct 03 '23 08:10 kangkyu