php - CodeIgniter 将视频从 localhost 上传到 YouTube

标签 php codeigniter youtube google-api-php-client

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

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

最佳答案

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

  • Official PHP API provided by YouTube (link towards github)
  • Google APIs Client Library for PHP
  • Google APIs Client Library for PHP Get Started

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

    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/

    相关文章:

    php - Linux 中的 CI 和 SQL Server

    jquery - Codeigniter HMVC 并从 jQuery 调用 View

    php - 在 Laravel 路由上设置协议(protocol)

    PHP使用Curl登录HTTPS页面

    php - codeigniter (PHP) 中的注销问题

    javascript - 移动 Chrome 上的 IFrame 播放器 API

    android - 如何在 Android WebView iframe 上播放和暂停视频播放?

    angularjs - 我正在尝试使用API​​和Angular 1.5用youtube视频填充页面

    php - 表格不显示 Chrome

    php - 在echo中使用html标签以及从数据库中调用数据