File size: 662 Bytes
0b51d18
93ed7c0
0b51d18
 
 
 
dba24db
0b51d18
dba24db
 
0b51d18
 
dba24db
7a5add6
dba24db
0b51d18
 
 
6c91077
0b51d18
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import axios from 'axios';
import { trbtoken, trburl } from '../all.js';

async function TeraboxDownloader(url) {
  const options = {
    method: 'POST',
    url: 'https://terabox-downloader-direct-download-link-generator.p.rapidapi.com/fetch',
    headers: {
      'x-rapidapi-key': `${trbtoken}`,
      'x-rapidapi-host': 'terabox-downloader-direct-download-link-generator.p.rapidapi.com',
      'Content-Type': 'application/json'
    },
    data: {
      url: url
    }
  };
  try {
    const response = await axios.request(options);
    return response.data;
  } catch (error) {
    console.error(error);
    return null;
  }
}

export { TeraboxDownloader };