meta-fca 2.5.9 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utils.js +30 -32
package/package.json
CHANGED
package/utils.js
CHANGED
@@ -28,22 +28,20 @@ function setProxy(url) {
|
|
28
28
|
*/
|
29
29
|
|
30
30
|
function getHeaders(url, options, ctx, customHeader) {
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
return headers;
|
31
|
+
var headers = {
|
32
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
33
|
+
Referer: "https://www.facebook.com/",
|
34
|
+
Host: url.replace("https://", "").split("/")[0],
|
35
|
+
Origin: "https://www.facebook.com",
|
36
|
+
"user-agent": (options.userAgent || "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36"),
|
37
|
+
Connection: "keep-alive",
|
38
|
+
"sec-fetch-site": 'same-origin',
|
39
|
+
"sec-fetch-mode": 'cors'
|
40
|
+
};
|
41
|
+
if (customHeader) Object.assign(headers, customHeader);
|
42
|
+
if (ctx && ctx.region) headers["X-MSGR-Region"] = ctx.region;
|
43
|
+
|
44
|
+
return headers;
|
47
45
|
}
|
48
46
|
|
49
47
|
/**
|
@@ -116,22 +114,22 @@ fb_dtsg: any; jazoest: any; }} qs
|
|
116
114
|
*/
|
117
115
|
|
118
116
|
function postFormData(url, jar, form, qs, options, ctx) {
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
117
|
+
var headers = getHeaders(url, options, ctx);
|
118
|
+
headers["Content-Type"] = "multipart/form-data";
|
119
|
+
var op = {
|
120
|
+
headers: headers,
|
121
|
+
timeout: 60000,
|
122
|
+
url: url,
|
123
|
+
method: "POST",
|
124
|
+
formData: form,
|
125
|
+
qs: qs,
|
126
|
+
jar: jar,
|
127
|
+
gzip: true
|
128
|
+
};
|
129
|
+
|
130
|
+
return request(op).then(function(res) {
|
131
|
+
return res;
|
132
|
+
});
|
135
133
|
}
|
136
134
|
|
137
135
|
/**
|