mirror of
https://github.com/calzoneman/sync.git
synced 2024-09-13 04:32:09 +00:00
Make gdocs retrieval less janky
This commit is contained in:
parent
9ab4e02a5d
commit
ad13896739
@ -688,7 +688,7 @@ var Getters = {
|
|||||||
/* WARNING: hacks inbound */
|
/* WARNING: hacks inbound */
|
||||||
var options = {
|
var options = {
|
||||||
host: "docs.google.com",
|
host: "docs.google.com",
|
||||||
path: "/file/d/" + id + "/view?sle=true",
|
path: "/file/d/" + id + "/get_video_info?sle=true",
|
||||||
port: 443
|
port: 443
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -709,16 +709,11 @@ var Getters = {
|
|||||||
return callback("HTTP " + status, null);
|
return callback("HTTP " + status, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Match [[anything]] and ignore whitespace
|
|
||||||
* Fix 2014-08-07: [^] matches \r\n, . doesn't.
|
|
||||||
*/
|
|
||||||
var m = res.match(/\[(\[\s*\[[^\[][^]*?\]\s*\])/);
|
|
||||||
try {
|
try {
|
||||||
var propertyList = JSON.parse(m[1]);
|
|
||||||
var data = {};
|
var data = {};
|
||||||
propertyList.forEach(function (kv) {
|
res.split("&").forEach(function (urlparam) {
|
||||||
data[kv[0]] = kv[1];
|
var pair = urlparam.split("=").map(decodeURIComponent);
|
||||||
|
data[pair[0]] = pair[1];
|
||||||
});
|
});
|
||||||
|
|
||||||
if (data.hasOwnProperty("reason")) {
|
if (data.hasOwnProperty("reason")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user