我使用Vimeo api
为node.js
现在遇到了一个问题,从来没有发生过。在尝试lib.generateClientCredentials
它抛出错误(和崩溃节点的应用程序):用于node.js的Vimeo-API HTML错误'抱歉。 Vimeo将回到'
[Error: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="robots" content="nofollow, noindex">
<title>Sorry. Vimeo will be right back.</title>
<style>
body {
margin: 0;
padding: 0;
background: #34454E url('https://f.vimeocdn.com/images_v6/ins_down_illustr
ation.png') bottom repeat-x fixed;
color: #ffffff;
font: 36px/1.3 Helvetica, Arial, sans-serif;
text-align: center;
}
#content {
position: fixed;
width: 100%;
top: 35px;
left: 0;
}
h1 {
margin-bottom: 35px;
height: 101px;
background: url('https://f.vimeocdn.com/images_v6/ins_down_vimeo.png') cen
ter no-repeat;
text-indent: -1000em;
overflow: hidden;
}
h2 {
color: #717D83;
font-size: 37px;
font-weight: normal;
margin-bottom: 5px;
}
p {
margin: 0;
}
@media all and (min-height: 960px) {
#content {
top: 5%;
}
}
@media all and (min-height: 1200px) {
#content {
top: 10%;
}
}
@media all and (max-height: 900px) {
body {
background-position: center 300px;
}
#content {
top: 0;
}
}
</style>
</head>
<body>
<div id="content">
<h1>Vimeo</h1>
<h2>Something is weird in the magical forest.</h2>
<p>We’ll be back in a jiffy.</p>
</div>
</body>
</html>]
所以:
1.为什么会发生?
2.为什么在服务器端api中引发HTML错误? (将它传递给用户我假设?)
编辑: 我Vimeo-API
配置模块(Basicly一样的例子Vimeo
文档):
var Vimeo = require('vimeo-api').Vimeo;
var lib = new Vimeo('*somethingsecret*', '*anothersecretthing*');
lib.generateClientCredentials('public', function (err, access_token) {
if (err) {
console.log(err);
}
var token = access_token.access_token;
lib.access_token = token;
// Other useful information is included alongside the access token
// We include the final scopes granted to the token. This is important because the user (or api) might revoke scopes during the authentication process
var scopes = access_token.scope;
});
module.exports = lib;
EDIT2:安装vimeo 0.1.4 module
第一台服务器之后启动was succesfull,vimeo api工作正常,但重启后,在任何api请求上,我收到
error: A valid user token must be passed
。
有时它在服务器重新加载后有效,有时会开始抛出这个错误。
它是否尚未解决?我遇到了同样的问题,还有其他人,请参阅:https://vimeo.com/forums/api/topic:265764 – johnnycrab
不,昨天神奇地自我修复iteslf,但从今天上午我看到同样的错误。奇怪的是,它从来没有出现过去5个月使用vimeo-api,或许它受到我昨天安装的模块的某种影响,它们似乎完全不相关(UglifyCSS和Forever-monitor),也许我的'npm install'也更新了vimeo-api模块,我没有注意到,这个更新搞砸了一切。 –
我相信这是vimeo方面的问题,我希望他们的支持尽快回复。 Vimeo-API从两个月左右开始并未更新(v.1.1.2),并且不依赖任何第三方软件包。我也检查了被调用的请求,并将它们与当前的api文档进行比较 - 一切正常。 :( – johnnycrab