1

API バージョン 0.6.2

私はこの答えに従っていました:

google php クライアント api v3 経由で大きなビデオを youtube に投稿する

私は得ています

Failed to start the resumable upload
500 Internal Server Error - Google_Exception 

スタックトレース

in /home/darko/NetBeansProjects/shekortet/vendor/google/google-api-php-client/src/service/Google_MediaFileUpload.php at line 260  -+
        if (200 == $code && true == $location) {
          return $location;
        }
        throw new Google_Exception("Failed to start the resumable upload");
      }
    } 

at Google_MediaFileUpload ->getResumeUri (object(Google_HttpRequest))
in /home/darko/NetBeansProjects/shekortet/vendor/google/google-api-php-client/src/service/Google_MediaFileUpload.php at line 214  -+
      public function nextChunk(Google_HttpRequest $req, $chunk=false) {
        if (false == $this->resumeUri) {
          $this->resumeUri = $this->getResumeUri($req);
        }
        if (false == $chunk) {

at Google_MediaFileUpload ->nextChunk (object(Google_HttpRequest), '')
in /home/darko/NetBeansProjects/shekortet/src/Dalu/MediaBundle/Controller/EncodeController.php at line 284  -+
                    while (!$status && !feof($handle))
                    {
                        $chunk = fread($handle, $chunkSizeBytes);
                        $uploadStatus = $media->nextChunk($result, $chunk);
                        var_dump($uploadStatus);
                    }

再開不可能なアップロードを投稿しようとすると、400 Bad Request エラーが発生します。

エラーメッセージ

Error calling POST https://www.googleapis.com/youtube/v3/videos?part=status%2Csnippet&key=replacedkeystring: (400) Bad Request 

スタックトレース

in /home/darko/NetBeansProjects/shekortet/vendor/google/google-api-php-client/src/io/Google_REST.php at line 66  -+
            $err .= ": ($code) $body";
          }
          throw new Google_ServiceException($err, $code, null, $decoded['error']['errors']);
        }

        // Only attempt to decode the response, if the response code wasn't (204) 'no content'

at Google_REST ::decodeHttpResponse (object(Google_HttpRequest))
in /home/darko/NetBeansProjects/shekortet/vendor/google/google-api-php-client/src/io/Google_REST.php at line 36  -+
       */
      static public function execute(Google_HttpRequest $req) {
        $httpRequest = Google_Client::$io->makeRequest($req);
        $decodedResponse = self::decodeHttpResponse($httpRequest);
        $ret = isset($decodedResponse['data'])
            ? $decodedResponse['data'] : $decodedResponse;
        return $ret;

at Google_REST ::execute (object(Google_HttpRequest))
in /home/darko/NetBeansProjects/shekortet/vendor/google/google-api-php-client/src/service/Google_ServiceResource.php at line 186  -+
          return $httpRequest;
        }
        return Google_REST::execute($httpRequest);
      }
      public  function useObjects() {

at Google_ServiceResource ->__call ('insert', array(array('part' => 'status,snippet', 'postBody' => object(Google_Video), 'mediaUpload' => object(Google_MediaFileUpload))))
in /home/darko/NetBeansProjects/shekortet/vendor/google/google-api-php-client/src/contrib/Google_YouTubeService.php at line 789  -+
        public function insert($part, Google_Video $postBody, $optParams = array()) {
          $params = array('part' => $part, 'postBody' => $postBody);
          $params = array_merge($params, $optParams);
          $data = $this->__call('insert', array($params));
          if ($this->useObjects()) {
            return new Google_Video($data);
          } else {

at Google_VideosServiceResource ->insert ('status,snippet', object(Google_Video), array('mediaUpload' => object(Google_MediaFileUpload)))
in /home/darko/NetBeansProjects/shekortet/src/Dalu/MediaBundle/Controller/EncodeController.php at line 277  -+
                    $media = new \Google_MediaFileUpload('video/x-matroska', null, false, $chunkSizeBytes);
                    $media->setFileSize(filesize($filename));
                    $result = $youtube->videos->insert("status,snippet", $gvideo, ['mediaUpload' => $media]);
                    $status = false;
                    $handle = fopen($filename, "rb");

数時間前に認証しました。トークンの有効期間は 3600 (1 時間) であることがわかりました。これもローカルで行われます。これが原因でしょうか、それとも何が原因でしょうか?

どんな助けでも感謝します。

4

0 に答える 0