diff --git a/lib/get-info.js b/lib/get-info.js index 3b103219..e0fb96f0 100644 --- a/lib/get-info.js +++ b/lib/get-info.js @@ -726,9 +726,16 @@ function vimeoWorkaround(id, cb) { }; var parse = function (data) { - var i = data.indexOf("b={"); + var i = data.indexOf("{\"cdn_url\""); + if (i === -1) { + Logger.errlog.log("Vimeo workaround failed (i=-1): http://vimeo.com/" + id); + setImmediate(function () { + cb({}); + }); + return; + } var j = data.indexOf("};", i); - var json = data.substring(i+2, j+1); + var json = data.substring(i, j+1); try { json = JSON.parse(json); var codec = json.request.files.codecs[0]; @@ -761,7 +768,7 @@ function vimeoWorkaround(id, cb) { } Logger.errlog.log("Vimeo workaround error: "); Logger.errlog.log(e); - Logger.errlog.log(data); + Logger.errlog.log("http://vimeo.com/" + id); setImmediate(function () { cb({}); });