joedawson / youtube

Upload a video to a single YouTube channel with Laravel 5.
MIT License
175 stars 105 forks source link

1605 Quotas for each video #109

Closed badrshs closed 4 years ago

badrshs commented 5 years ago

Hi , as you know youtube reduced the number of Quotas from 3.000.000 to 10.000 when i'm trying to upload 1 video to youtube it cost me 1605 Quotas 🤔🤔 is that normal ? as i understand each request should cost 1 Quota or something around that but 1605 is very big number . what could be the issue here ?

this is my testing code

 public function upload()
    {
        $video = \Youtube::upload("image/output.mp4", [
            'title' => $this->YoutubeTitle,
            'description' =>$this->description,
            'tags' => explode(",", $this->tags),
            'category_id' => 10
        ]);
        $link = $video->getVideoId();
        return "https://www.youtube.com/watch?v=$link";

    }
joedawson commented 5 years ago

I'm not sure how Google determine what they consider a quota. However there should only be a maximum of 3 requests to Google.

Again, not sure what Google would consider these requests to cost in terms of quotas.

1605 does seem like a large number. However I'm not sure when I was using this package, what sort of usage it had. Are you still experiencing this issue?

Thanks

badrshs commented 5 years ago

Hi , Thank you for your help , I got the answer . unfortunately it's new google policy for using there api service . 1600 for each uploaded video . each day we have maximum 10000 Q So 6 videos are the maximum to upload everyday which is soo low :( . i'm not sure but as i remember it was 3 Million Q each day

Calculating quota usage

Google calculates your quota usage by assigning a cost to each request, but the cost is not the same for each request. Two primary factors influence a request quota cost:

Different types of operations have different quota costs.

A simple read operation that only retrieves the ID of each returned resource has a cost of approximately 1 unit.
A write operation has a cost of approximately 50 units.
A video upload has a cost of approximately 1600 units.

more details : https://developers.google.com/youtube/v3/getting-started#calculating-quota-usage thank you .