and sorry for my English :)
I need to upload videos to youtube channel from console script (cron)
In offcial php code samples (https://developers.google.com/youtube/v3/code_samples/php) author offer to use OAuth, it's work, but it's need to use browser for auth and redirect uri (web script) it's not good for me, because I use console script without gui and webserver.
I think I want to use server key without oauth2, but I newbee :) And oauth allows to choose channel (I have a many channels on my google account)
Can you help me and write code about:
require_once 'include/Google/autoload.php';
require_once 'include/Google/Client.php';
require_once 'include/Google/Service/YouTube.php';
session_start();
$key = "MY_SERVER_KEY_HERE";
$client = new Google_Client();
$client->setDeveloperKey($key);
$client->setScopes('https://www.googleapis.com/auth/youtube');
$videoPath = "./video.mp4";
$snippet = new Google_Service_YouTube_VideoSnippet();
$snippet->setTitle("Test title");
$snippet->setDescription("Test description");
$snippet->setTags(array("tag1", "tag2"));
$snippet->setCategoryId("22");
$status = new Google_Service_YouTube_VideoStatus();
$status->privacyStatus = "public";
$video = new Google_Service_YouTube_Video();
$video->setSnippet($snippet);
$video->setStatus($status);
$youtube = new Google_Service_YouTube($client);
$insertRequest = $youtube->videos->insert("status,snippet", $video);