我正在尝试将视频从本地服务器上传到我的 YouTube 帐户。我一直在尝试从 https://github.com/jimdoescode/CodeIgniter-YouTube-API-Library 实现这个示例但它显然已被弃用并返回“未注册消费者 key ”。
我已成功完成身份验证,但任何支持较新的 YouTube v3 API 的新库将不胜感激。我正在使用 CodeIgniter。
最佳答案
您应该遵循 youtube 创建的官方 PHP API:
不知道您是如何错过它的,因为其中一个链接已放在您提供的链接的已弃用部分中。
Here is an example of a fileupload that can be found on the github
此处所有信息均直接取自 github:
描述:
The Google API Client Library enables you to work with Google APIs such as Google+, Drive, or YouTube on your server.
来自 github 的基本示例:
See the examples/ directory for examples of the key client features.
<?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";
}
来自谷歌图书馆页面的消息:
This client library is in beta. We will make an effort to support the library and maintain backwards compatibility in the future, but we reserve the right to make incompatible changes when necessary.
关于php - CodeIgniter 将视频从 localhost 上传到 YouTube,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27275386/