fca-luxury 1.1.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/Screenshot.js +0 -83
package/package.json
CHANGED
package/src/Screenshot.js
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
/* eslint-disable linebreak-style */
|
2
|
-
"use strict";
|
3
|
-
|
4
|
-
|
5
|
-
module.exports = function (defaultFuncs, api, ctx) {
|
6
|
-
var Coookie = JSON.parse(JSON.stringify(ctx.jar.getCookies("https://www.facebook.com").concat(ctx.jar.getCookies("https://facebook.com")).concat(ctx.jar.getCookies("https://www.messenger.com"))));
|
7
|
-
for (let i of Coookie) {
|
8
|
-
i.name = i.key;
|
9
|
-
i.domain = 'www.facebook.com';
|
10
|
-
delete i.key;
|
11
|
-
}
|
12
|
-
return function(Link, callback) {
|
13
|
-
var logger = require('../logger');
|
14
|
-
if (process.platform != 'win32') return logger.Error('Not Supported Platform');
|
15
|
-
else try {
|
16
|
-
let i = require('puppeteer');
|
17
|
-
}
|
18
|
-
catch (e) {
|
19
|
-
var { execSync } = require('child_process');
|
20
|
-
execSync('npm i puppeteer', { stdio: 'inherit' });
|
21
|
-
}
|
22
|
-
const Screenshot = require('../Extra/ExtraScreenShot');
|
23
|
-
var resolveFunc = function () { };
|
24
|
-
var rejectFunc = function () { };
|
25
|
-
var returnPromise = new Promise(function (resolve, reject) {
|
26
|
-
resolveFunc = resolve;
|
27
|
-
rejectFunc = reject;
|
28
|
-
});
|
29
|
-
|
30
|
-
if (!callback) {
|
31
|
-
callback = function (err, data) {
|
32
|
-
if (err) return rejectFunc(err);
|
33
|
-
resolveFunc(data);
|
34
|
-
};
|
35
|
-
}
|
36
|
-
if (Link.includes('facebook.com') || Link.includes('Facebook.com') || Link.includes('fb')) {
|
37
|
-
let LinkSplit = Link.split('/');
|
38
|
-
if (LinkSplit.indexOf("https:") == 0) {
|
39
|
-
if (Link.includes('messages')) {
|
40
|
-
Screenshot.buffer(Link, {
|
41
|
-
cookies: Coookie
|
42
|
-
}).then(data => {
|
43
|
-
callback(null,data);
|
44
|
-
});
|
45
|
-
}
|
46
|
-
else if (!isNaN(LinkSplit[3]) && !Link.split('=')[1] && !isNaN(Link.split('=')[1])) {
|
47
|
-
api.sendMessage('Invaild link, format link: facebook.com/Lazic.Kanzu',global.Fca.Data.event.threadID,global.Fca.Data.event.messageID);
|
48
|
-
callback('Error Link', null);
|
49
|
-
}
|
50
|
-
else if (!isNaN(Link.split('=')[1]) && Link.split('=')[1]) {
|
51
|
-
let Format = `https://www.facebook.com/profile.php?id=${Link.split('=')[1]}`;
|
52
|
-
Screenshot.buffer(Format, {
|
53
|
-
cookies: Coookie
|
54
|
-
}).then(data => {
|
55
|
-
callback(null,data);
|
56
|
-
});
|
57
|
-
}
|
58
|
-
else {
|
59
|
-
let Format = `https://www.facebook.com/${LinkSplit[3]}`;
|
60
|
-
Screenshot.buffer(Format, {
|
61
|
-
cookies: Coookie
|
62
|
-
}).then(data => {
|
63
|
-
callback(null,data);
|
64
|
-
});
|
65
|
-
}
|
66
|
-
}
|
67
|
-
else {
|
68
|
-
let Form = `https://www.facebook.com/${LinkSplit[1]}`;
|
69
|
-
Screenshot.buffer(Form, {
|
70
|
-
cookies: Coookie
|
71
|
-
}).then(data => {
|
72
|
-
callback(null,data);
|
73
|
-
});
|
74
|
-
}
|
75
|
-
}
|
76
|
-
else {
|
77
|
-
Screenshot.buffer(Link).then(data => {
|
78
|
-
callback(null,data);
|
79
|
-
});
|
80
|
-
}
|
81
|
-
return returnPromise;
|
82
|
-
};
|
83
|
-
};
|