abot-scraper 1.0.0 → 1.1.0
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/README.MD +68 -46
- package/package.json +22 -17
- package/src/index.js +7 -15
- package/src/scraper/downloader.js +307 -275
- package/src/scraper/search.js +144 -0
package/README.MD
CHANGED
@@ -1,46 +1,68 @@
|
|
1
|
-
# abot-scraper
|
2
|
-
|
3
|
-
abot-scraper is a library node js. Can get data downloader like facebook, youtube, instagram and etc.
|
4
|
-
|
5
|
-
# Installation
|
6
|
-
|
7
|
-
Install stable version of scraper:
|
8
|
-
|
9
|
-
```sh
|
10
|
-
npm i
|
11
|
-
```
|
12
|
-
|
13
|
-
Install latest version from github (not recommended)
|
14
|
-
|
15
|
-
```sh
|
16
|
-
npm i github:ahlulmukh/abot-scraper
|
17
|
-
```
|
18
|
-
|
19
|
-
## Usage
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
.
|
28
|
-
console.
|
29
|
-
})
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
1
|
+
# abot-scraper
|
2
|
+
|
3
|
+
abot-scraper is a library node js. Can get data downloader like facebook, youtube, instagram and etc.
|
4
|
+
|
5
|
+
# Installation
|
6
|
+
|
7
|
+
Install stable version of scraper:
|
8
|
+
|
9
|
+
```sh
|
10
|
+
npm i abot-scraper
|
11
|
+
```
|
12
|
+
|
13
|
+
Install latest version from github (not recommended)
|
14
|
+
|
15
|
+
```sh
|
16
|
+
npm i github:ahlulmukh/abot-scraper
|
17
|
+
```
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
For Downloader
|
22
|
+
|
23
|
+
```js
|
24
|
+
const { Downloader } = require("@ahlulmukh/abot-scraper");
|
25
|
+
|
26
|
+
Downloader.ytMP4("https://youtu.be/j_MlBCb9-m8?si=g6KsGM6cHNotU-rH")
|
27
|
+
.then((result) => {
|
28
|
+
console.log(result); // json;
|
29
|
+
})
|
30
|
+
.catch((error) => {
|
31
|
+
console.error(error);
|
32
|
+
});
|
33
|
+
```
|
34
|
+
|
35
|
+
For Search
|
36
|
+
|
37
|
+
```js
|
38
|
+
const { Search } = require("@ahlulmukh/abot-scraper");
|
39
|
+
|
40
|
+
Search.ytPlay("Lagu Terbaru")
|
41
|
+
.then((result) => {
|
42
|
+
console.log(result); // json;
|
43
|
+
})
|
44
|
+
.catch((error) => {
|
45
|
+
console.error(error);
|
46
|
+
});
|
47
|
+
```
|
48
|
+
|
49
|
+
## Features
|
50
|
+
|
51
|
+
- Youtube Downloader
|
52
|
+
- Facebok Downloader
|
53
|
+
- Tiktok Downloader
|
54
|
+
- Instagram Downloader
|
55
|
+
- Instastory Downloader
|
56
|
+
- Pinterest Search
|
57
|
+
- Youtube Play By query
|
58
|
+
- Wallpaper
|
59
|
+
|
60
|
+
## Contributing
|
61
|
+
|
62
|
+
If you find a bug or have a feature request, please open an issue on our GitHub repository.
|
63
|
+
|
64
|
+
We welcome contributions from the community. If you'd like to contribute, please fork the repository and submit a pull request.
|
65
|
+
|
66
|
+
## License
|
67
|
+
|
68
|
+
Scraper is licensed under the GPL-3.0-or-later license. See [LICENSE](LICENSE) for more information.
|
package/package.json
CHANGED
@@ -1,18 +1,23 @@
|
|
1
|
-
{
|
2
|
-
"name": "abot-scraper",
|
3
|
-
"version": "1.
|
4
|
-
"description": "scraper random",
|
5
|
-
"main": "src/index.js",
|
6
|
-
"scripts": {
|
7
|
-
"test": "npm test"
|
8
|
-
},
|
9
|
-
"keywords": [
|
10
|
-
"scraper"
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
"
|
16
|
-
|
17
|
-
|
1
|
+
{
|
2
|
+
"name": "abot-scraper",
|
3
|
+
"version": "1.1.0",
|
4
|
+
"description": "scraper random for downloader and searching",
|
5
|
+
"main": "src/index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "npm test"
|
8
|
+
},
|
9
|
+
"keywords": [
|
10
|
+
"scraper",
|
11
|
+
"ytdownloader",
|
12
|
+
"instagram",
|
13
|
+
"youtube-dl",
|
14
|
+
"youtube",
|
15
|
+
"facebook"
|
16
|
+
],
|
17
|
+
"author": "Ahlul Mukhramin",
|
18
|
+
"license": "ISC",
|
19
|
+
"dependencies": {
|
20
|
+
"axios": "^1.5.1",
|
21
|
+
"cheerio": "^1.0.0-rc.12"
|
22
|
+
}
|
18
23
|
}
|
package/src/index.js
CHANGED
@@ -1,15 +1,7 @@
|
|
1
|
-
const
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
}
|
8
|
-
|
9
|
-
module.exports = {
|
10
|
-
facebook,
|
11
|
-
igstory,
|
12
|
-
instagram,
|
13
|
-
ytMP3,
|
14
|
-
ytMP4,
|
15
|
-
};
|
1
|
+
const Downloader = require("./scraper/downloader");
|
2
|
+
const Search = require("./scraper/search");
|
3
|
+
|
4
|
+
module.exports = {
|
5
|
+
Downloader: new Downloader(),
|
6
|
+
Search: new Search(),
|
7
|
+
};
|
@@ -1,275 +1,307 @@
|
|
1
|
-
const { default: axios } = require("axios");
|
2
|
-
const cheerio = require("cheerio");
|
3
|
-
global.creator = `@abotscraper – ahmuq`;
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
"
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
}
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
"
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
}
|
139
|
-
|
140
|
-
};
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
})
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
1
|
+
const { default: axios } = require("axios");
|
2
|
+
const cheerio = require("cheerio");
|
3
|
+
global.creator = `@abotscraper – ahmuq`;
|
4
|
+
|
5
|
+
module.exports = class Downloader {
|
6
|
+
facebook = (url) => {
|
7
|
+
return new Promise((resolve, reject) => {
|
8
|
+
let config = {
|
9
|
+
url: url,
|
10
|
+
};
|
11
|
+
let headerss = {
|
12
|
+
"sec-ch-ua":
|
13
|
+
'" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"',
|
14
|
+
"user-agent":
|
15
|
+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
16
|
+
Cookie:
|
17
|
+
'PHPSESSID=6jo2ggb63g5mjvgj45f612ogt7; _ga=GA1.2.405896420.1625200423; _gid=GA1.2.2135261581.1625200423; _PN_SBSCRBR_FALLBACK_DENIED=1625200785624; MarketGidStorage={"0":{},"C702514":{"page":5,"time":1625200846733}}',
|
18
|
+
};
|
19
|
+
axios("https://www.getfvid.com/downloader", {
|
20
|
+
method: "POST",
|
21
|
+
data: new URLSearchParams(Object.entries(config)),
|
22
|
+
headers: headerss,
|
23
|
+
})
|
24
|
+
.then(({ data }) => {
|
25
|
+
const $ = cheerio.load(data);
|
26
|
+
const title = $(".card-title a").text().trim();
|
27
|
+
const links = {
|
28
|
+
hd: "",
|
29
|
+
sd: "",
|
30
|
+
audio: "",
|
31
|
+
};
|
32
|
+
|
33
|
+
$(".btns-download a").each((index, element) => {
|
34
|
+
const link = $(element).attr("href");
|
35
|
+
const text = $(element).text();
|
36
|
+
if (text.includes("HD Quality")) {
|
37
|
+
links.hd = link;
|
38
|
+
} else if (text.includes("Normal Quality")) {
|
39
|
+
links.sd = link;
|
40
|
+
} else if (text.includes("Audio Only")) {
|
41
|
+
links.audio = link;
|
42
|
+
}
|
43
|
+
});
|
44
|
+
|
45
|
+
resolve({
|
46
|
+
creator: global.creator,
|
47
|
+
status: 200,
|
48
|
+
result: {
|
49
|
+
title: title,
|
50
|
+
hd: links.hd,
|
51
|
+
sd: links.sd,
|
52
|
+
audio: links.audio,
|
53
|
+
},
|
54
|
+
});
|
55
|
+
})
|
56
|
+
.catch(reject);
|
57
|
+
});
|
58
|
+
};
|
59
|
+
|
60
|
+
tiktokDownloader = (url) => {
|
61
|
+
return new Promise((resolve, reject) => {
|
62
|
+
let headers = {
|
63
|
+
"sec-ch-ua":
|
64
|
+
'" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"',
|
65
|
+
"user-agent":
|
66
|
+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
67
|
+
};
|
68
|
+
|
69
|
+
let config = {
|
70
|
+
id: url,
|
71
|
+
locale: "en",
|
72
|
+
tt: "WmNzZDk_",
|
73
|
+
};
|
74
|
+
axios("https://ssstik.io/abc?url=dl", {
|
75
|
+
method: "POST",
|
76
|
+
data: new URLSearchParams(Object.entries(config)),
|
77
|
+
headers: headers,
|
78
|
+
})
|
79
|
+
.then(({ data }) => {
|
80
|
+
const $ = cheerio.load(data);
|
81
|
+
const title = $("p.maintext").text().trim();
|
82
|
+
const audio = $("a.download_link.music").attr("href");
|
83
|
+
const video = $("a.download_link.without_watermark").attr("href");
|
84
|
+
resolve({
|
85
|
+
creator: global.creator,
|
86
|
+
status: 200,
|
87
|
+
result: {
|
88
|
+
title: title,
|
89
|
+
video: video,
|
90
|
+
audio: audio,
|
91
|
+
},
|
92
|
+
});
|
93
|
+
})
|
94
|
+
.catch(reject);
|
95
|
+
});
|
96
|
+
};
|
97
|
+
|
98
|
+
igstory = (username) => {
|
99
|
+
return new Promise(async (resolve) => {
|
100
|
+
try {
|
101
|
+
const data = await axios.get(
|
102
|
+
"https://insta-stories-viewer.com/" + username
|
103
|
+
);
|
104
|
+
const userIdRegex = /var USER_ID = (\d+);/;
|
105
|
+
const match = data.data.match(userIdRegex);
|
106
|
+
const userId = parseInt(match[1]);
|
107
|
+
const hasil = await axios.get(
|
108
|
+
"https://igs.sf-converter.com/api/stories/" + userId
|
109
|
+
);
|
110
|
+
const result = [];
|
111
|
+
hasil.data.result.forEach((item, index) => {
|
112
|
+
const imageUrl =
|
113
|
+
item.image_versions2 &&
|
114
|
+
item.image_versions2.candidates &&
|
115
|
+
item.image_versions2.candidates.length > 0
|
116
|
+
? item.image_versions2.candidates[0].url
|
117
|
+
: null;
|
118
|
+
const videoUrl =
|
119
|
+
item.video_versions && item.video_versions.length > 0
|
120
|
+
? item.video_versions[0].url
|
121
|
+
: null;
|
122
|
+
result.push(imageUrl);
|
123
|
+
if (videoUrl) {
|
124
|
+
result.push(videoUrl);
|
125
|
+
}
|
126
|
+
resolve({
|
127
|
+
creator: global.creator,
|
128
|
+
status: 200,
|
129
|
+
result: result,
|
130
|
+
});
|
131
|
+
});
|
132
|
+
} catch (error) {
|
133
|
+
console.log(error);
|
134
|
+
return resolve({
|
135
|
+
creator: global.creator,
|
136
|
+
status: false,
|
137
|
+
});
|
138
|
+
}
|
139
|
+
});
|
140
|
+
};
|
141
|
+
|
142
|
+
instagram = (url) => {
|
143
|
+
return new Promise((resolve, reject) => {
|
144
|
+
let config = {
|
145
|
+
url: url,
|
146
|
+
lang_code: "en",
|
147
|
+
token: "",
|
148
|
+
};
|
149
|
+
let headerss = {
|
150
|
+
"sec-ch-ua":
|
151
|
+
'" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"',
|
152
|
+
"user-agent":
|
153
|
+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
154
|
+
Cookie:
|
155
|
+
'PHPSESSID=6jo2ggb63g5mjvgj45f612ogt7; _ga=GA1.2.405896420.1625200423; _gid=GA1.2.2135261581.1625200423; _PN_SBSCRBR_FALLBACK_DENIED=1625200785624; MarketGidStorage={"0":{},"C702514":{"page":5,"time":1625200846733}}',
|
156
|
+
};
|
157
|
+
axios("https://fastdl.app/c/", {
|
158
|
+
method: "POST",
|
159
|
+
data: new URLSearchParams(Object.entries(config)),
|
160
|
+
headers: headerss,
|
161
|
+
})
|
162
|
+
.then(({ data }) => {
|
163
|
+
const $ = cheerio.load(data);
|
164
|
+
const downloadLinks = [];
|
165
|
+
$("a[href]").each((index, element) => {
|
166
|
+
const hrefValue = $(element).attr("href");
|
167
|
+
downloadLinks.push(hrefValue);
|
168
|
+
});
|
169
|
+
resolve({
|
170
|
+
creator: global.creator,
|
171
|
+
status: 200,
|
172
|
+
result: downloadLinks,
|
173
|
+
});
|
174
|
+
})
|
175
|
+
.catch(({ error }) => {
|
176
|
+
reject(error);
|
177
|
+
});
|
178
|
+
});
|
179
|
+
};
|
180
|
+
|
181
|
+
ytMP3(url) {
|
182
|
+
return new Promise((resolve, reject) => {
|
183
|
+
let configd = {
|
184
|
+
k_query: url,
|
185
|
+
k_page: "Youtube Downloader",
|
186
|
+
hl: "en",
|
187
|
+
q_auto: 0,
|
188
|
+
};
|
189
|
+
let headerss = {
|
190
|
+
"sec-ch-ua":
|
191
|
+
'" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"',
|
192
|
+
"user-agent":
|
193
|
+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
194
|
+
Cookie:
|
195
|
+
'PHPSESSID=6jo2ggb63g5mjvgj45f612ogt7; _ga=GA1.2.405896420.1625200423; _gid=GA1.2.2135261581.1625200423; _PN_SBSCRBR_FALLBACK_DENIED=1625200785624; MarketGidStorage={"0":{},"C702514":{"page":5,"time":1625200846733}}',
|
196
|
+
};
|
197
|
+
axios("https://www.y2mate.com/mates/analyzeV2/ajax", {
|
198
|
+
method: "POST",
|
199
|
+
data: new URLSearchParams(Object.entries(configd)),
|
200
|
+
headers: headerss,
|
201
|
+
})
|
202
|
+
.then(({ data }) => {
|
203
|
+
let url = "https://www.youtube.com/watch?v=" + data.vid;
|
204
|
+
let configimg = {
|
205
|
+
url: "https://www.youtube.be/" + url,
|
206
|
+
q_auto: 0,
|
207
|
+
ajax: 1,
|
208
|
+
};
|
209
|
+
let configdl = {
|
210
|
+
vid: data.vid,
|
211
|
+
k: data.links.mp3.mp3128.k,
|
212
|
+
};
|
213
|
+
let size = data.links.mp3.mp3128.size;
|
214
|
+
axios("https://www.y2mate.com/mates/en68/analyze/ajax", {
|
215
|
+
method: "POST",
|
216
|
+
data: new URLSearchParams(Object.entries(configimg)),
|
217
|
+
headers: headerss,
|
218
|
+
}).then(({ data }) => {
|
219
|
+
const $ = cheerio.load(data.result);
|
220
|
+
let img = $("div.thumbnail.cover > a > img").attr("src");
|
221
|
+
axios("https://www.y2mate.com/mates/convertV2/index", {
|
222
|
+
method: "POST",
|
223
|
+
data: new URLSearchParams(Object.entries(configdl)),
|
224
|
+
headers: headerss,
|
225
|
+
}).then(({ data }) => {
|
226
|
+
resolve({
|
227
|
+
creator: global.creator,
|
228
|
+
status: 200,
|
229
|
+
result: {
|
230
|
+
title: data.title,
|
231
|
+
ftype: data.ftype,
|
232
|
+
quality: data.fquality,
|
233
|
+
thumb: img,
|
234
|
+
size_mp3: size,
|
235
|
+
link: data.dlink,
|
236
|
+
},
|
237
|
+
});
|
238
|
+
});
|
239
|
+
});
|
240
|
+
})
|
241
|
+
.catch(reject);
|
242
|
+
});
|
243
|
+
}
|
244
|
+
|
245
|
+
ytMP4 = (url) => {
|
246
|
+
return new Promise((resolve, reject) => {
|
247
|
+
let configd = {
|
248
|
+
k_query: url,
|
249
|
+
k_page: "Youtube Downloader",
|
250
|
+
hl: "en",
|
251
|
+
q_auto: 0,
|
252
|
+
};
|
253
|
+
let headerss = {
|
254
|
+
"sec-ch-ua":
|
255
|
+
'" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"',
|
256
|
+
"user-agent":
|
257
|
+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
258
|
+
Cookie:
|
259
|
+
'PHPSESSID=6jo2ggb63g5mjvgj45f612ogt7; _ga=GA1.2.405896420.1625200423; _gid=GA1.2.2135261581.1625200423; _PN_SBSCRBR_FALLBACK_DENIED=1625200785624; MarketGidStorage={"0":{},"C702514":{"page":5,"time":1625200846733}}',
|
260
|
+
};
|
261
|
+
axios("https://www.y2mate.com/mates/analyzeV2/ajax", {
|
262
|
+
method: "POST",
|
263
|
+
data: new URLSearchParams(Object.entries(configd)),
|
264
|
+
headers: headerss,
|
265
|
+
})
|
266
|
+
.then(({ data }) => {
|
267
|
+
let url = "https://www.youtube.com/watch?v=" + data.vid;
|
268
|
+
let configimg = {
|
269
|
+
url: "https://www.youtube.be/" + url,
|
270
|
+
q_auto: 0,
|
271
|
+
ajax: 1,
|
272
|
+
};
|
273
|
+
let configdl = {
|
274
|
+
vid: data.vid,
|
275
|
+
k: data.links.mp4[135].k,
|
276
|
+
};
|
277
|
+
let size = data.links.mp4[135].size;
|
278
|
+
axios("https://www.y2mate.com/mates/en68/analyze/ajax", {
|
279
|
+
method: "POST",
|
280
|
+
data: new URLSearchParams(Object.entries(configimg)),
|
281
|
+
headers: headerss,
|
282
|
+
}).then(({ data }) => {
|
283
|
+
const $ = cheerio.load(data.result);
|
284
|
+
let img = $("div.thumbnail.cover > a > img").attr("src");
|
285
|
+
axios("https://www.y2mate.com/mates/convertV2/index", {
|
286
|
+
method: "POST",
|
287
|
+
data: new URLSearchParams(Object.entries(configdl)),
|
288
|
+
headers: headerss,
|
289
|
+
}).then(({ data }) => {
|
290
|
+
resolve({
|
291
|
+
creator: global.creator,
|
292
|
+
status: 200,
|
293
|
+
result: {
|
294
|
+
title: data.title,
|
295
|
+
ftype: data.ftype,
|
296
|
+
thumb: img,
|
297
|
+
size_mp4: size,
|
298
|
+
link: data.dlink,
|
299
|
+
},
|
300
|
+
});
|
301
|
+
});
|
302
|
+
});
|
303
|
+
})
|
304
|
+
.catch(reject);
|
305
|
+
});
|
306
|
+
};
|
307
|
+
};
|
@@ -0,0 +1,144 @@
|
|
1
|
+
const { default: axios } = require("axios");
|
2
|
+
const cheerio = require("cheerio");
|
3
|
+
global.creator = `@abotscraper – ahmuq`;
|
4
|
+
|
5
|
+
module.exports = class Search {
|
6
|
+
ytPlay = (text) => {
|
7
|
+
return new Promise((resolve, reject) => {
|
8
|
+
let configd = {
|
9
|
+
k_query: text,
|
10
|
+
k_page: "mp3",
|
11
|
+
q_auto: 1,
|
12
|
+
};
|
13
|
+
let headerss = {
|
14
|
+
"sec-ch-ua":
|
15
|
+
'" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"',
|
16
|
+
"user-agent":
|
17
|
+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
18
|
+
Cookie:
|
19
|
+
'PHPSESSID=6jo2ggb63g5mjvgj45f612ogt7; _ga=GA1.2.405896420.1625200423; _gid=GA1.2.2135261581.1625200423; _PN_SBSCRBR_FALLBACK_DENIED=1625200785624; MarketGidStorage={"0":{},"C702514":{"page":5,"time":1625200846733}}',
|
20
|
+
};
|
21
|
+
|
22
|
+
axios("https://www.y2mate.com/mates/analyzeV2/ajax", {
|
23
|
+
method: "POST",
|
24
|
+
data: new URLSearchParams(Object.entries(configd)),
|
25
|
+
headers: headerss,
|
26
|
+
})
|
27
|
+
.then(({ data }) => {
|
28
|
+
let v = data.vitems;
|
29
|
+
var v2 = v[Math.floor(Math.random() * v.length)].v;
|
30
|
+
let url = "https://www.youtube.com/watch?v=" + v2;
|
31
|
+
let config = {
|
32
|
+
k_query: "https://www.youtube.be/" + url,
|
33
|
+
k_page: "mp3",
|
34
|
+
hl: "en",
|
35
|
+
q_auto: 1,
|
36
|
+
};
|
37
|
+
let config2 = {
|
38
|
+
url: "https://www.youtube.be/" + url,
|
39
|
+
q_auto: 0,
|
40
|
+
ajax: 1,
|
41
|
+
};
|
42
|
+
axios("https://www.y2mate.com/mates/en68/analyze/ajax", {
|
43
|
+
method: "POST",
|
44
|
+
data: new URLSearchParams(Object.entries(config2)),
|
45
|
+
headers: headerss,
|
46
|
+
}).then(({ data }) => {
|
47
|
+
const $ = cheerio.load(data.result);
|
48
|
+
let img = $("div.thumbnail.cover > a > img").attr("src");
|
49
|
+
axios("https://www.y2mate.com/mates/analyzeV2/ajax", {
|
50
|
+
method: "POST",
|
51
|
+
data: new URLSearchParams(Object.entries(config)),
|
52
|
+
headers: headerss,
|
53
|
+
}).then(({ data }) => {
|
54
|
+
const convertConfig = {
|
55
|
+
vid: data.vid,
|
56
|
+
k: data.links.mp3.mp3128.k,
|
57
|
+
};
|
58
|
+
let size = data.links.mp3.mp3128.size;
|
59
|
+
axios("https://www.y2mate.com/mates/convertV2/index", {
|
60
|
+
method: "POST",
|
61
|
+
data: new URLSearchParams(Object.entries(convertConfig)),
|
62
|
+
headers: headerss,
|
63
|
+
})
|
64
|
+
.then((response) => {
|
65
|
+
resolve({
|
66
|
+
creator: global.creator,
|
67
|
+
status: 200,
|
68
|
+
result: {
|
69
|
+
status: response.data.status,
|
70
|
+
title: response.data.title,
|
71
|
+
ftype: response.data.ftype,
|
72
|
+
thumb: img,
|
73
|
+
size_mp3: size,
|
74
|
+
link: response.data.dlink,
|
75
|
+
},
|
76
|
+
});
|
77
|
+
})
|
78
|
+
.catch(reject);
|
79
|
+
});
|
80
|
+
});
|
81
|
+
})
|
82
|
+
.catch(reject);
|
83
|
+
});
|
84
|
+
};
|
85
|
+
|
86
|
+
wallpaper = (title, page = "1") => {
|
87
|
+
return new Promise((resolve, reject) => {
|
88
|
+
axios
|
89
|
+
.get(
|
90
|
+
`https://www.besthdwallpaper.com/search?CurrentPage=${page}&q=${title}`
|
91
|
+
)
|
92
|
+
.then(({ data }) => {
|
93
|
+
let $ = cheerio.load(data);
|
94
|
+
let hasil = [];
|
95
|
+
|
96
|
+
$("div.grid-item").each(function (a, b) {
|
97
|
+
hasil.push({
|
98
|
+
title: $(b).find("p[title]").attr("title").trim(),
|
99
|
+
type: $(b).find("div.info > a:nth-child(2)").text().trim(),
|
100
|
+
source:
|
101
|
+
"https://www.besthdwallpaper.com" + $(b).find("a").attr("href"),
|
102
|
+
image: [
|
103
|
+
$(b).find("picture > img").attr("src"),
|
104
|
+
$(b).find("picture > source:nth-child(1)").attr("srcset"),
|
105
|
+
$(b).find("picture > source:nth-child(2)").attr("srcset"),
|
106
|
+
],
|
107
|
+
});
|
108
|
+
});
|
109
|
+
resolve({ creator: global.creator, status: 200, hasil });
|
110
|
+
})
|
111
|
+
.catch((error) => {
|
112
|
+
reject(error);
|
113
|
+
});
|
114
|
+
});
|
115
|
+
};
|
116
|
+
|
117
|
+
wikimedia = (title) => {
|
118
|
+
return new Promise((resolve, reject) => {
|
119
|
+
axios
|
120
|
+
.get(
|
121
|
+
`https://commons.wikimedia.org/w/index.php?search=${title}&title=Special:MediaSearch&go=Go&type=image`
|
122
|
+
)
|
123
|
+
.then((res) => {
|
124
|
+
let $ = cheerio.load(res.data);
|
125
|
+
let hasil = [];
|
126
|
+
$(".sdms-search-results__list-wrapper > div > a").each(function (
|
127
|
+
a,
|
128
|
+
b
|
129
|
+
) {
|
130
|
+
hasil.push({
|
131
|
+
title: $(b).find("img").attr("alt"),
|
132
|
+
source: $(b).attr("href"),
|
133
|
+
image:
|
134
|
+
$(b).find("img").attr("data-src") ||
|
135
|
+
$(b).find("img").attr("src"),
|
136
|
+
});
|
137
|
+
});
|
138
|
+
|
139
|
+
resolve({ creator: global.creator, status: 200, hasil });
|
140
|
+
})
|
141
|
+
.catch(reject);
|
142
|
+
});
|
143
|
+
};
|
144
|
+
};
|