|
import axios from 'axios'; |
|
import { trbtoken } from '../all.js'; |
|
|
|
export async function TeraboxV3Downloader(url) { |
|
const options = { |
|
method: 'GET', |
|
url: 'https://terabox-downloader-tool.p.rapidapi.com/api', |
|
headers: { |
|
'x-rapidapi-key': `${trbtoken}`, |
|
'x-rapidapi-host': 'terabox-downloader-tool.p.rapidapi.com', |
|
}, |
|
params: { |
|
data: url |
|
} |
|
}; |
|
try { |
|
const response = await axios.request(options); |
|
return response.data; |
|
} catch (error) { |
|
console.error(error); |
|
return null; |
|
} |
|
} |
|
|
|
export async function TeraboxV2Downloader(url) { |
|
const options = { |
|
method: 'GET', |
|
url: 'https://terabox-downloader-direct-download-link-generator2.p.rapidapi.com/url', |
|
headers: { |
|
'x-rapidapi-key': `${trbtoken}`, |
|
'x-rapidapi-host': 'terabox-downloader-direct-download-link-generator2.p.rapidapi.com', |
|
}, |
|
params: { |
|
url: url |
|
} |
|
}; |
|
try { |
|
const response = await axios.request(options); |
|
return response.data; |
|
} catch (error) { |
|
console.error(error); |
|
return null; |
|
} |
|
} |
|
|
|
export 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; |
|
} |
|
} |