From 282ad986b6d7c59c171236a7da9609059a9f5ec4 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Sat, 22 Jul 2017 11:14:29 -0700 Subject: [PATCH] Deprecate legacy vimeo-oauth lookup --- NEWS.md | 12 +++++++++++ config.template.yaml | 10 --------- package.json | 3 +-- src/config.js | 5 ----- src/get-info.js | 48 -------------------------------------------- 5 files changed, 13 insertions(+), 65 deletions(-) diff --git a/NEWS.md b/NEWS.md index 1f341125..31d6b32c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,15 @@ +2017-07-22 +========== + +Support for the old version of Vimeo's OAuth API (the `vimeo-oauth` +configuration block) has been dropped. It's unlikely anyone was using this, +since you haven't been able to register new API keys for it in years (it was +superseded by a newer OAuth API, which CyTube does not support), and in fact I +lost my credentials for this API and no longer have a way to test it. + +Vimeo videos can still be added -- the metadata will be queried from the +anonymous API which has been the default since the beginning. + 2017-07-17 ========== diff --git a/config.template.yaml b/config.template.yaml index 9154819c..ab0504a2 100644 --- a/config.template.yaml +++ b/config.template.yaml @@ -176,16 +176,6 @@ aliases: # Workaround for Vimeo blocking my domain vimeo-workaround: false -# OPTIONAL: Use Vimeo's OAuth API instead of the anonymous API. -# This allows you to add private videos that have embedding enabled. -# See https://developer.vimeo.com/apps/new to register for this API. -# Note that in order to use this feature you must agree to Vimeo's -# Terms of Service and License Agreement. -vimeo-oauth: - enabled: false - consumer-key: '' - secret: '' - # Regular expressions for defining reserved user and channel names and page titles # The list of regular expressions will be joined with an OR, and compared without # case sensitivity. diff --git a/package.json b/package.json index 7e7363f5..166090d5 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "3.42.1", + "version": "3.43.0", "repository": { "url": "http://github.com/calzoneman/sync" }, @@ -30,7 +30,6 @@ "morgan": "^1.6.1", "mysql": "^2.9.0", "nodemailer": "^1.4.0", - "oauth": "^0.9.12", "prom-client": "^10.0.2", "proxy-addr": "^1.1.4", "pug": "^2.0.0-beta3", diff --git a/src/config.js b/src/config.js index 89295b42..46328e4e 100644 --- a/src/config.js +++ b/src/config.js @@ -87,11 +87,6 @@ var defaults = { "max-age": 2592000000 }, "vimeo-workaround": false, - "vimeo-oauth": { - enabled: false, - "consumer-key": "", - secret: "" - }, "html-template": { title: "CyTube Beta", description: "Free, open source synchtube" }, diff --git a/src/get-info.js b/src/get-info.js index 86a23760..76562757 100644 --- a/src/get-info.js +++ b/src/get-info.js @@ -135,10 +135,6 @@ var Getters = { return; } - if (Config.get("vimeo-oauth.enabled")) { - return Getters.vi_oauth(id, callback); - } - Vimeo.lookup(id).then(video => { video = new Media(video.id, video.title, video.duration, "vi"); callback(null, video); @@ -147,50 +143,6 @@ var Getters = { }); }, - vi_oauth: function (id, callback) { - var OAuth = require("oauth"); - var oa = new OAuth.OAuth( - "https://vimeo.com/oauth/request_token", - "https://vimeo.com/oauth/access_token", - Config.get("vimeo-oauth.consumer-key"), - Config.get("vimeo-oauth.secret"), - "1.0", - null, - "HMAC-SHA1" - ); - - oa.get("https://vimeo.com/api/rest/v2?format=json" + - "&method=vimeo.videos.getInfo&video_id=" + id, - null, - null, - function (err, data, res) { - if (err) { - return callback(err, null); - } - - try { - data = JSON.parse(data); - - if (data.stat !== "ok") { - return callback(data.err.msg, null); - } - - var video = data.video[0]; - - if (video.embed_privacy !== "anywhere") { - return callback("Embedding disabled", null); - } - - var id = video.id; - var seconds = parseInt(video.duration); - var title = video.title; - callback(null, new Media(id, title, seconds, "vi")); - } catch (e) { - callback("Error handling Vimeo response", null); - } - }); - }, - /* dailymotion.com */ dm: function (id, callback) { var m = id.match(/([\w-]+)/);