Youtube上传失败,403 - 下载服务禁止

时间:2013-09-15 22:29:14

标签: node.js youtube-api gdata-api google-api-nodejs-client

我正在使用google-api-nodejs-client而我正在尝试编写一个上传器的脚本。我终于到了OAuth2认证的阶段,我可以提出请求。

当尝试上传时,我收到403 - 下载Service Forbidden错误。谷歌搜索错误完全没有回复(这些日子很罕见),官方错误代码列表没有列出它。

我在下面附上了JSON响应。

 { errors:
   [ { domain: 'global',
       reason: 'downloadServiceForbidden',
       message: 'Download Service Forbidden' },
     [length]: 1 ],
  code: 403,
  message: 'Download Service Forbidden' }

有没有人看过这个或知道它意味着什么?

我的上传代码。

var yt_api = googleapis.discover('youtube', 'v3');

var auth_scopes = [
    "https://www.googleapis.com/auth/youtube",
    "https://www.googleapis.com/auth/youtube.upload",
    "https://www.googleapis.com/auth/youtubepartner"
]

var authClient = new googleapis.OAuth2Client(CLIENT_ID, CLIENT_SECRET, REDIRECT_URL);


//performs the authorisation with the above scopes
ensureAuthorisation(authClient, doRequest);


function doRequest() {

    log.msg('Executing...');
    yt_api.execute(function(err, client){

        // open the video as a stream
        var buffer = fs.readFileSync('../files/test.mp4');

        client
            .youtube.videos.insert({part: "contentDetails", mine: true})
            .withAuthClient(authClient)
            .withMedia('video/*', buffer)
            .execute(function(err, response){

                if (err) {
                    log.err("Error in upload");
                    dumpObj(err);
                } else {
                    log.msg("Succeeded!");
                }

            });

    });

}

谢谢!

0 个答案:

没有答案
相关问题