public function getProvider()
 {
     return YoutubeApiDistributionPlugin::getProvider();
 }
 public function getType()
 {
     return YoutubeApiDistributionPlugin::getDistributionProviderTypeCoreValue(YoutubeApiDistributionProviderType::YOUTUBE_API);
 }
require_once KALTURA_ROOT_PATH . '/vendor/google-api-php-client-1.1.2/src/Google/autoload.php';
$partnerId = null;
if (isset($argv[1]) && is_numeric($argv[1])) {
    $partnerId = intval($argv[1]);
}
$oldCategories = array('Film' => 'Film & Animation', 'Autos' => 'Autos & Vehicles', 'Music' => 'Music', 'Animals' => 'Pets & Animals', 'Sports' => 'Sports', 'Travel' => 'Travel & Events', 'Games' => 'Gaming', 'Comedy' => 'Comedy', 'People' => 'People & Blogs', 'News' => 'News & Politics', 'Entertainment' => 'Entertainment', 'Education' => 'Education', 'Howto' => 'Howto & Style', 'Nonprofit' => 'Nonprofits & Activism', 'Tech' => 'Science & Technology');
$appId = YoutubeApiDistributionPlugin::GOOGLE_APP_ID;
$authConfig = kConf::get($appId, 'google_auth', null);
$googleClientId = isset($authConfig['clientId']) ? $authConfig['clientId'] : null;
$googleClientSecret = isset($authConfig['clientSecret']) ? $authConfig['clientSecret'] : null;
$options = array(CURLOPT_VERBOSE => true, CURLOPT_STDERR => STDOUT);
$client = new Google_Client();
$client->getIo()->setOptions($options);
$client->setClientId($googleClientId);
$client->setClientSecret($googleClientSecret);
$distributionProvider = YoutubeApiDistributionPlugin::getDistributionProviderTypeCoreValue(YoutubeApiDistributionProviderType::YOUTUBE_API);
$criteria = new Criteria();
$criteria->add(DistributionProfilePeer::STATUS, DistributionProfileStatus::DELETED, Criteria::NOT_EQUAL);
$criteria->add(DistributionProfilePeer::PROVIDER_TYPE, $distributionProvider);
if ($partnerId) {
    $criteria->add(DistributionProfilePeer::PARTNER_ID, $partnerId);
}
$criteria->addAscendingOrderByColumn(DistributionProfilePeer::ID);
$criteria->setLimit(100);
$demoCategories = null;
$distributionProfiles = DistributionProfilePeer::doSelect($criteria);
while ($distributionProfiles) {
    $lastId = 0;
    foreach ($distributionProfiles as $distributionProfile) {
        /* @var $distributionProfile YoutubeApiDistributionProfile */
        $lastId = $distributionProfile->getId();