mirror of https://github.com/calzoneman/sync.git
Fix vimeo workaround
This commit is contained in:
parent
12596cb357
commit
7b9162f890
|
@ -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({});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue