A lightweight TypeScript/JavaScript library for downloading media from social media platforms
- Version
- 5.0.10
- License
- MIT
- See
- GitHub Repository for contributions and issue reporting.
Methods
(async, inner) aio(url) → {Promise.<Object>}
Downloads media from a given URL across supported platforms.
Name | Type | Description |
---|---|---|
url | string | The URL of the media to download (e.g., Instagram, TikTok, etc.). |
If the URL is invalid or the media is not accessible.
- Type
- Error
A JSON object containing the media data.
- Type:
- Promise.<Object>
ESM
import { aio } from 'btch-downloader';
aio('https://www.instagram.com/p/ByxKbUSnubS/?utm_source=ig_web_copy_link')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
CJS
const { aio } = require('btch-downloader');
aio('https://www.instagram.com/p/ByxKbUSnubS/?utm_source=ig_web_copy_link')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
(async, inner) capcut(url) → {Promise.<Object>}
Downloads media from Capcut.
Name | Type | Description |
---|---|---|
url | string | The Capcut media URL. |
If the URL is invalid or the media is not accessible.
- Type
- Error
A JSON object containing the media data.
- Type:
- Promise.<Object>
ESM
import { capcut } from 'btch-downloader';
capcut('https://www.capcut.com/template-detail/7299286607478181121?template_id=7299286607478181121&share_token=80302b19-8026-4101-81df-2fd9a9cecb9c&enter_from=template_detail®ion=ID&language=in&platform=copy_link&is_copy_link=1')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
CJS
const { capcut } = require('btch-downloader');
capcut('https://www.capcut.com/template-detail/7299286607478181121?template_id=7299286607478181121&share_token=80302b19-8026-4101-81df-2fd9a9cecb9c&enter_from=template_detail®ion=ID&language=in&platform=copy_link&is_copy_link=1')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
(async, inner) douyin(url) → {Promise.<Object>}
Downloads media from Douyin.
Name | Type | Description |
---|---|---|
url | string | The Douyin media URL. |
If the URL is invalid or the media is not accessible.
- Type
- Error
A JSON object containing the media data.
- Type:
- Promise.<Object>
ESM
import { douyin } from 'btch-downloader';
const url = 'https://v.douyin.com/ikq8axJ/';
douyin(url).then(data => console.log(data)).catch(err => console.error(err));
// JSON
CJS
const { douyin } = require('btch-downloader');
const url = 'https://v.douyin.com/ikq8axJ/';
douyin(url).then(data => console.log(data)).catch(err => console.error(err));
// JSON
(async, inner) fbdown(url) → {Promise.<Object>}
Downloads media from Facebook.
Name | Type | Description |
---|---|---|
url | string | The Facebook media URL. |
If the URL is invalid or the media is not accessible.
- Type
- Error
A JSON object containing the media data.
- Type:
- Promise.<Object>
ESM
import { fbdown } from 'btch-downloader';
fbdown('https://www.facebook.com/watch/?v=1393572814172251')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
CJS
const { fbdown } = require('btch-downloader');
fbdown('https://www.facebook.com/watch/?v=1393572814172251')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
(async, inner) gdrive(url) → {Promise.<Object>}
Downloads media from Google Drive.
Name | Type | Description |
---|---|---|
url | string | The Google Drive media URL. |
If the URL is invalid or the media is not accessible.
- Type
- Error
A JSON object containing the media data.
- Type:
- Promise.<Object>
ESM
import { gdrive } from 'btch-downloader';
gdrive('https://drive.google.com/file/d/1thDYWcS5p5FFhzTpTev7RUv0VFnNQyZ4/view?usp=drivesdk')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
CJS
const { gdrive } = require('btch-downloader');
gdrive('https://drive.google.com/file/d/1thDYWcS5p5FFhzTpTev7RUv0VFnNQyZ4/view?usp=drivesdk')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
(async, inner) igdl(url) → {Promise.<(Array.<Object>|Object)>}
Downloads media from Instagram.
Name | Type | Description |
---|---|---|
url | string | The Instagram media URL. |
If the URL is invalid or the media is not accessible.
- Type
- Error
An array of JSON objects or an error object.
- Type:
- Promise.<(Array.<Object>|Object)>
ESM
import { igdl } from 'btch-downloader';
igdl('https://www.instagram.com/p/ByxKbUSnubS/?utm_source=ig_web_copy_link')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
CJS
const { igdl } = require('btch-downloader');
igdl('https://www.instagram.com/p/ByxKbUSnubS/?utm_source=ig_web_copy_link')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
(async, inner) mediafire(url) → {Promise.<Object>}
Downloads media from MediaFire.
Name | Type | Description |
---|---|---|
url | string | The MediaFire media URL. |
If the URL is invalid or the media is not accessible.
- Type
- Error
A JSON object containing the media data.
- Type:
- Promise.<Object>
ESM
import { mediafire } from 'btch-downloader';
mediafire('https://www.mediafire.com/file/941xczxhn27qbby/GBWA_V12.25FF-By.SamMods-.apk/file')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
CJS
const { mediafire } = require('btch-downloader');
mediafire('https://www.mediafire.com/file/941xczxhn27qbby/GBWA_V12.25FF-By.SamMods-.apk/file')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
(async, inner) pinterest(input) → {Promise.<Object>}
Downloads or searches media from Pinterest using a URL or text query.
Name | Type | Description |
---|---|---|
input | string | The Pinterest media URL or a search query. |
If the input is invalid or the media is not accessible.
- Type
- Error
A JSON object containing the media data.
- Type:
- Promise.<Object>
ESM
import { pinterest } from 'btch-downloader';
// Using a URL
pinterest('https://pin.it/4CVodSq')
.then(data => console.log(data))
.catch(err => console.error(err));
// Using a search query
pinterest('Zhao Lusi')
.then(data => console.log(data))
.catch(err => console.error(err));
CJS
const { pinterest } = require('btch-downloader');
// Using a URL
pinterest('https://pin.it/4CVodSq')
.then(data => console.log(data))
.catch(err => console.error(err));
// Using a search query
pinterest('Zhao Lusi')
.then(data => console.log(data))
.catch(err => console.error(err));
(async, inner) snackvideo(url) → {Promise.<Object>}
Downloads media from SnackVideo.
Name | Type | Description |
---|---|---|
url | string | The SnackVideo media URL. |
If the URL is invalid or the media is not accessible.
- Type
- Error
A JSON object containing the media data.
- Type:
- Promise.<Object>
ESM
import { snackvideo } from 'btch-downloader';
const url = 'https://s.snackvideo.com/p/j9jKr9dR';
snackvideo(url).then(data => console.log(data)).catch(err => console.error(err));
// JSON
CJS
const { snackvideo } = require('btch-downloader');
const url = 'https://s.snackvideo.com/p/j9jKr9dR';
snackvideo(url).then(data => console.log(data)).catch(err => console.error(err));
// JSON
(async, inner) ttdl(url) → {Promise.<Object>}
Downloads media from TikTok.
Name | Type | Description |
---|---|---|
url | string | The TikTok media URL. |
If the URL is invalid or the media is not accessible.
- Type
- Error
A JSON object containing the media data.
- Type:
- Promise.<Object>
ESM
import { ttdl } from 'btch-downloader';
ttdl('https://www.tiktok.com/@omagadsus/video/7025456384175017243')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
CJS
const { ttdl } = require('btch-downloader');
ttdl('https://www.tiktok.com/@omagadsus/video/7025456384175017243')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
(async, inner) twitter(url) → {Promise.<Object>}
Downloads media from Twitter.
Name | Type | Description |
---|---|---|
url | string | The Twitter media URL. |
If the URL is invalid or the media is not accessible.
- Type
- Error
A JSON object containing the media data.
- Type:
- Promise.<Object>
ESM
import { twitter } from 'btch-downloader';
twitter('https://twitter.com/gofoodindonesia/status/1229369819511709697')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
CJS
const { twitter } = require('btch-downloader');
twitter('https://twitter.com/gofoodindonesia/status/1229369819511709697')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
(async, inner) xiaohongshu(url) → {Promise.<Object>}
Downloads media from Xiaohongshu.
Name | Type | Description |
---|---|---|
url | string | The Xiaohongshu media URL. |
If the URL is invalid or the media is not accessible.
- Type
- Error
A JSON object containing the media data.
- Type:
- Promise.<Object>
ESM
import { xiaohongshu } from 'btch-downloader';
const url = 'https://xhslink.com/o/588P0GrGwWf';
xiaohongshu(url).then(data => console.log(data)).catch(err => console.error(err));
// JSON
CJS
const { xiaohongshu } = require('btch-downloader');
const url = 'https://xhslink.com/o/588P0GrGwWf';
xiaohongshu(url).then(data => console.log(data)).catch(err => console.error(err));
// JSON
(async, inner) youtube(url) → {Promise.<Object>}
Downloads media from YouTube.
Name | Type | Description |
---|---|---|
url | string | The YouTube media URL. |
If the URL is invalid or the media is not accessible.
- Type
- Error
A JSON object containing the media data.
- Type:
- Promise.<Object>
ESM
import { youtube } from 'btch-downloader';
youtube('https://youtube.com/watch?v=C8mJ8943X80')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON
CJS
const { youtube } = require('btch-downloader');
youtube('https://youtube.com/watch?v=C8mJ8943X80')
.then(data => console.log(data))
.catch(err => console.error(err));
// JSON