html - Node.js 的 Vimeo-API HTML 错误 'Sorry. Vimeo will be right back'

标签 html node.js error-handling vimeo vimeo-api

我正在将 Vimeo api 用于 node.js,现在遇到了以前从未出现过的问题。尝试 lib.generateClientCredentials 时,它会抛出错误(并使 Node 应用程序崩溃):

    [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&rsquo;ll be back in a jiffy.</p>
  </div>
</body>
</html>]

所以:
1. 为什么会这样?
2. 为什么 HTML 在服务器端 api 中被抛出错误? (我认为将其传递给用户?)

编辑: 我的 Vimeo-API 配置模块(与 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;

编辑2:安装vimeo 0.1.4模块后,第一次服务器启动成功,vimeo api工作正常,但重新启动后,在任何api请求上,我都收到

错误:必须传递有效的用户 token

有时它会在服务器重新加载后起作用,有时它会开始抛出此错误。

最佳答案

这是一个临时服务器端错误。 Vimeo 已推送官方 Node.js 库的更新,该更新应该可以在我们努力解决问题时绕过该问题。

确保您使用的是 vimeo 包,而不是 vimeo-api 并且您使用的是 1.1.3 版本

关于html - Node.js 的 Vimeo-API HTML 错误 'Sorry. Vimeo will be right back',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29954095/

相关文章:

python - 什么可能导致此错误: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 568: invalid start byte

html - 使文本适应容器的宽度

node.js - 过程或函数 insert_azienda 指定了太多参数 (Node.js)

node.js - OpenShift 从另一个 Pod 访问 Mongodb Pod

javascript - 为什么node.js中的mysql多语句选项会增加SQL注入(inject)的范围?

javascript - NodeJS 域错误处理未拾取 ReferenceError

javascript - 无法在 jQuery 中一次只显示一个 div

javascript - 在表单中显示 <A id> 内部占位符

javascript - jQuery根据滚动定位增加和减少div高度

sql-server - 生成的错误日志该怎么办?