randydev commited on
Commit
d5b52db
·
verified ·
1 Parent(s): d97f748

Update lib/@randydev/terabox.js

Browse files
Files changed (1) hide show
  1. lib/@randydev/terabox.js +23 -2
lib/@randydev/terabox.js CHANGED
@@ -1,5 +1,26 @@
1
  import axios from 'axios';
2
- import { trbtoken, trburl } from '../all.js';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  async function TeraboxDownloader(url) {
5
  const options = {
@@ -23,4 +44,4 @@ async function TeraboxDownloader(url) {
23
  }
24
  }
25
 
26
- export { TeraboxDownloader };
 
1
  import axios from 'axios';
2
+ import { trbtoken } from '../all.js';
3
+
4
+ async function TeraboxV2Downloader(url) {
5
+ const options = {
6
+ method: 'GET',
7
+ url: 'https://terabox-downloader-direct-download-link-generator2.p.rapidapi.com/url',
8
+ headers: {
9
+ 'x-rapidapi-key': `${trbtoken}`,
10
+ 'x-rapidapi-host': 'terabox-downloader-direct-download-link-generator2.p.rapidapi.com',
11
+ },
12
+ params: {
13
+ url: 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
  async function TeraboxDownloader(url) {
26
  const options = {
 
44
  }
45
  }
46
 
47
+ export { TeraboxDownloader, TeraboxV2Downloader };