From 3446eb5357da225f6a229360fb7890f4b063290e Mon Sep 17 00:00:00 2001 From: calzoneman Date: Fri, 15 Aug 2014 00:27:51 -0500 Subject: [PATCH] Add Google Docs checks for missing duration/title --- lib/get-info.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/get-info.js b/lib/get-info.js index 871a8214..a26f9fb2 100644 --- a/lib/get-info.js +++ b/lib/get-info.js @@ -701,6 +701,16 @@ var Getters = { data[kv[0]] = kv[1]; }); + if (!data.hasOwnProperty("title")) { + return callback("Returned HTML is missing the video title. Are you " + + "sure the video is done processing?"); + } + + if (!data.hasOwnProperty("length_seconds")) { + return callback("Returned HTML is missing the video duration. Are you " + + "sure the video is done processing?"); + } + var title = data.title; var seconds = parseInt(data.length_seconds);