Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Failed to start the resumable upload

$
0
0

Api Version 0.6.2

I was following this answer:

Post large video to youtube via google php client api v3

I'm getting

Failed to start the resumable upload500 Internal Server Error - Google_Exception 

Stack Trace

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);                    }

When trying to post a nonresumable upload I'm getting a 400 Bad Request error.

Error Message

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

Stack Trace

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");

I have authenticated a few hours ago. I saw that the token lifetime was 3600 (1h).This is also done locallyCould this be the reason or what could be the reason?

Any help appreciated.


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>