joedawson / youtube

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

Why attaching thumbnail image is I got permissions error ? #140

Closed PetroGromovo closed 1 year ago

PetroGromovo commented 1 year ago

Using dawson/youtube plugin I got error :

Error calling PUT https://www.googleapis.com/upload/youtube/v3/thumbnails/set?videoId=cUubd0Ujwd4&uploadType=resumable&upload_id=ADPycdtm_VVPJSuqibB9mkCE7bYHlvq5DiZ294uzUHqCUGTeEktrL3y9ApgrQXguJGdCYSkzPBKZ4QH8wiwhi81M0QInAewRNHVL: (403) The authenticated user doesn't have permissions to upload and set custom video thumbnails.root@92bc0dade5fb:/var/www/PostsTagsCRUDTest_DOCKER_ROOT# In case when thumbPath attached to the request :

<?php
            $thumbPath = $uploadFile['thumbPath'] ?? '';
            if ( ! empty($thumbPath)) { // thumbnail image is attached - that raise the error
                $video = Youtube::upload($uploadFile['filenamePath'], [
                    'title' => $uploadFile['title'],
                    'description' => $uploadFile['description'],
                ], self::$privacyGroup)->withThumbnail($thumbPath);
            } else {  // but if thumbnailis not attached - I have no error and video is uploade ok
                $video = Youtube::upload($uploadFile['filenamePath'], [
                    'title' => $uploadFile['title'],
                    'description' => $uploadFile['description'],
                ], self::$privacyGroup);
            }

Which permissions have I to add and where ? On youtube side ?

"dawson/youtube": "^2.0.1",
"laravel/framework": "^10.8",

Thanks in advance!