Update lib/@randydev/terabox.js
Browse files- lib/@randydev/terabox.js +24 -5
lib/@randydev/terabox.js
CHANGED
@@ -1,7 +1,28 @@
|
|
1 |
import axios from 'axios';
|
2 |
import { trbtoken } from '../all.js';
|
3 |
|
4 |
-
async function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
const options = {
|
6 |
method: 'GET',
|
7 |
url: 'https://terabox-downloader-direct-download-link-generator2.p.rapidapi.com/url',
|
@@ -22,7 +43,7 @@ async function TeraboxV2Downloader(url) {
|
|
22 |
}
|
23 |
}
|
24 |
|
25 |
-
async function TeraboxDownloader(url) {
|
26 |
const options = {
|
27 |
method: 'POST',
|
28 |
url: 'https://terabox-downloader-direct-download-link-generator.p.rapidapi.com/fetch',
|
@@ -42,6 +63,4 @@ async function TeraboxDownloader(url) {
|
|
42 |
console.error(error);
|
43 |
return null;
|
44 |
}
|
45 |
-
}
|
46 |
-
|
47 |
-
export { TeraboxDownloader, TeraboxV2Downloader };
|
|
|
1 |
import axios from 'axios';
|
2 |
import { trbtoken } from '../all.js';
|
3 |
|
4 |
+
export async function TeraboxV3Downloader(url) {
|
5 |
+
const options = {
|
6 |
+
method: 'GET',
|
7 |
+
url: 'https://terabox-downloader-tool.p.rapidapi.com/api',
|
8 |
+
headers: {
|
9 |
+
'x-rapidapi-key': `${trbtoken}`,
|
10 |
+
'x-rapidapi-host': 'terabox-downloader-tool.p.rapidapi.com',
|
11 |
+
},
|
12 |
+
params: {
|
13 |
+
data: url
|
14 |
+
}
|
15 |
+
};
|
16 |
+
try {
|
17 |
+
const response = await axios.request(options);
|
18 |
+
return response.data;
|
19 |
+
} catch (error) {
|
20 |
+
console.error(error);
|
21 |
+
return null;
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
export async function TeraboxV2Downloader(url) {
|
26 |
const options = {
|
27 |
method: 'GET',
|
28 |
url: 'https://terabox-downloader-direct-download-link-generator2.p.rapidapi.com/url',
|
|
|
43 |
}
|
44 |
}
|
45 |
|
46 |
+
export async function TeraboxDownloader(url) {
|
47 |
const options = {
|
48 |
method: 'POST',
|
49 |
url: 'https://terabox-downloader-direct-download-link-generator.p.rapidapi.com/fetch',
|
|
|
63 |
console.error(error);
|
64 |
return null;
|
65 |
}
|
66 |
+
}
|
|
|
|