CodeIgniter将视频从本地主机上传到YouTube

问题描述 投票:0回答:1

我正在尝试将视频从本地服务器上传到我的YouTube帐户。我一直在尝试从https://github.com/jimdoescode/CodeIgniter-YouTube-API-Library实现此示例,但是显然它已被弃用,并返回“未注册用户密钥”。

我已经成功完成了身份验证,但是任何支持较新的YouTube v3 API的新库都将不胜感激。我正在使用CodeIgniter。

php codeigniter youtube google-api-php-client
1个回答
0
投票

您应遵循youtube创建的官方PHP API:

  1. Official PHP API provided by YouTube (link towards github)
  2. Google APIs Client Library for PHP
  3. Google APIs Client Library for PHP Get Started

不知道您是如何错过它的,因为其中一个链接已放置在您提供的链接的不建议使用的部分中。

Here is an example of a fileupload that can be found on the github

到此为止的所有信息都是直接从github获取的:

描述:

Google API客户端库使您可以使用Google API例如服务器上的Google+,云端硬盘或YouTube。

来自github的基本示例:

请参阅examples /目录以获取关键客户端功能的示例。

<?php

  require_once 'google-api-php-client/autoload.php'; // or wherever autoload.php is located

  $client = new Google_Client();
  $client->setApplicationName("Client_Library_Examples");
  $client->setDeveloperKey("YOUR_APP_KEY");

  $service = new Google_Service_Books($client);
  $optParams = array('filter' => 'free-ebooks');
  $results = $service->volumes->listVolumes('Henry David Thoreau', $optParams);

  foreach ($results as $item) {
    echo $item['volumeInfo']['title'], "<br /> \n";
  }

来自Google图书馆页面的消息:

此客户端库处于测试版。我们将努力支持库并在将来保持向后兼容性,但是我们保留必要时进行不兼容更改的权利。


0
投票

我已经详细创建了一个博客。按照给定的步骤进行操作。

Upload video on youtube without client authentication

© www.soinside.com 2019 - 2024. All rights reserved.