btch-downloader
Version:
A lightweight TypeScript/JavaScript library for downloading media from social media platforms
213 lines • 8.42 kB
TypeScript
import type { TikTokResponse, InstagramResponse, TwitterResponse, YouTubeResponse, FacebookResponse, MediaFireResponse, CapCutResponse, GoogleDriveResponse, PinterestResponse, AioResponse, XiaohongshuResponse, DouyinResponse, SnackVideoResponse, CocofunResponse, SpotifyResponse, YtsResponse, SoundCloudResponse, ThreadsResponse } from './Types';
declare const issues: string;
declare const wm: string;
declare const version: string;
/**
* TikTok video downloader
* @async
* @function ttdl
* @param {string} url - TikTok video URL
* @returns {Promise<TikTokResponse>} Object containing video info and download links
* @throws {Error} When invalid URL or request fails
* @example
* const result = await ttdl('https://tiktok.com/@user/video/123');
* console.log(result.video[0]); // Video download URL
*/
declare function ttdl(url: string): Promise<TikTokResponse>;
/**
* Instagram content downloader
* @async
* @function igdl
* @param {string} url - Instagram post URL (reels/posts/stories)
* @returns {Promise<InstagramResponse>} Array of media items with download links
* @throws {Error} When invalid URL or request fails
* @example
* const result = await igdl('https://instagram.com/p/Cxyz...');
* result.forEach(item => console.log(item.url));
*/
declare function igdl(url: string): Promise<InstagramResponse>;
/**
* Twitter video downloader
* @async
* @function twitter
* @param {string} url - Twitter video URL
* @returns {Promise<TwitterResponse>} Object containing video info
* @throws {Error} When invalid URL or request fails
* @example
* const result = await twitter('https://twitter.com/user/status/123');
*/
declare function twitter(url: string): Promise<TwitterResponse>;
/**
* YouTube video downloader
* @async
* @function youtube
* @param {string} url - YouTube video URL
* @returns {Promise<YouTubeResponse>} Object containing video and audio download links
* @throws {Error} When invalid URL or request fails
* @example
* const result = await youtube('https://youtube.com/watch?v=123');
* console.log(result.mp4); // Video download URL
*/
declare function youtube(url: string): Promise<YouTubeResponse>;
/**
* Facebook video downloader
* @async
* @function fbdown
* @param {string} url - Facebook video URL
* @returns {Promise<FacebookResponse>} Object containing video quality options
* @throws {Error} When invalid URL or request fails
* @example
* const result = await fbdown('https://facebook.com/watch/?v=123');
* console.log(result.HD); // HD quality URL
*/
declare function fbdown(url: string): Promise<FacebookResponse>;
/**
* MediaFire file downloader
* @async
* @function mediafire
* @param {string} url - MediaFire file URL
* @returns {Promise<MediaFireResponse>} Object containing file info
* @throws {Error} When invalid URL or request fails
* @example
* const result = await mediafire('https://mediafire.com/file/123');
* console.log(result.result.filename); // Downloaded filename
*/
declare function mediafire(url: string): Promise<MediaFireResponse>;
/**
* CapCut template downloader
* @async
* @function capcut
* @param {string} url - CapCut template URL
* @returns {Promise<CapCutResponse>} Object containing template info
* @throws {Error} When invalid URL or request fails
* @example
* const result = await capcut('https://capcut.com/template/123');
*/
declare function capcut(url: string): Promise<CapCutResponse>;
/**
* All In One Downloader
* @async
* @function aio
* @param {string} url - Video URL
* @returns {Promise<AioApiResponse>} Object containing video info
* @throws {Error} When invalid URL or request fails
* @example
* const result = await aio('https://tiktok.com/@user/video/123');
*/
declare function aio(url: string): Promise<AioResponse>;
/**
* Google Drive file downloader
* @async
* @function gdrive
* @param {string} url - Google Drive file URL
* @returns {Promise<GoogleDriveResponse>} Object containing file info
* @throws {Error} When invalid URL or request fails
* @example
* const result = await gdrive('https://drive.google.com/file/d/123');
* console.log(result.result.downloadUrl); // Download URL
*/
declare function gdrive(url: string): Promise<GoogleDriveResponse>;
/**
* Pinterest content downloader
* @async
* @function pinterest
* @param {string} query - Pinterest URL or search query
* @returns {Promise<PinterestResponse>} Object containing pin info or search results
* @throws {Error} When invalid URL/query or request fails
* @example
* // For URL
* const result = await pinterest('https://pin.it/123');
* // For search
* const results = await pinterest('Zhao Lusi');
*/
declare function pinterest(query: string): Promise<PinterestResponse>;
/**
* Xiaohongshu downloader
* @async
* @function xiaohongshu
* @param {string} url - Xiaohongshu post URL
* @returns {Promise<XiaohongshuResponse>} Object containing media details and download links
* @throws {Error} When invalid URL or request fails
* @example
* const result = await xiaohongshu('https://xhslink.com/o/123456');
*/
declare function xiaohongshu(url: string): Promise<XiaohongshuResponse>;
/**
* Douyin content downloader
* @async
* @function douyin
* @param {string} url - Douyin post URL
* @returns {Promise<DouyinResponse>} Object containing media details and download links
* @throws {Error} When invalid URL or request fails
* @example
* const result = await douyin('https://v.douyin.com/1234');
*/
declare function douyin(url: string): Promise<DouyinResponse>;
/**
* SnackVideo content downloader
* @async
* @function snackvideo
* @param {string} url - SnackVideo post URL
* @returns {Promise<SnackVideoResponse>} Object containing media details and download links
* @throws {Error} When invalid URL or request fails
* @example
* const result = await snackvideo('https://www.snackvideo.com/@seponsbobofficial/video/5251628748119377077');
*/
declare function snackvideo(url: string): Promise<SnackVideoResponse>;
/**
* Cocofun content downloader
* @async
* @function cocofun
* @param {string} url - SnackVideo post URL
* @returns {Promise<CocofunResponse>} Object containing media details and download links
* @throws {Error} When invalid URL or request fails
* @example
* const result = await cocofun('https://www.icocofun.com/share/post/588965339175?lang=id&pkg=id&share_to=copy_link&m=81638cf44ba27b2ffa708f3410a4e6c2&d=63cd2733d8d258facd28d44fde5198d4cea826e89af7efc4238ada620140eea3&nt=1');
*/
declare function cocofun(url: string): Promise<CocofunResponse>;
/**
* Spotify content downloader
* @async
* @function spotify
* @param {string} url - Spotify track URL
* @returns {Promise<SpotifyResponse>} Object containing media details and download links
* @throws {Error} When invalid URL or request fails
* @example
* const result = await spotify('https://open.spotify.com/track/3zakx7RAwdkUQlOoQ7SJRt');
*/
declare function spotify(url: string): Promise<SpotifyResponse>;
/**
* YouTube search
* @async
* @function yts
* @param {string} query - YouTube search query
* @returns {Promise<YtsResponse>} Object containing search results
* @throws {Error} When invalid query or request fails
* @example
* const result = await yts('Somewhere Only We Know');
*/
declare function yts(query: string): Promise<YtsResponse>;
/**
* SoundCloud content downloader
* @async
* @function soundcloud
* @param {string} url - SoundCloud track URL
* @returns {Promise<SoundCloudResponse>} Object containing media details and download links
* @throws {Error} When invalid URL or request fails
* @example
* const result = await soundcloud('https://soundcloud.com/artist-name/track-name');
*/
declare function soundcloud(url: string): Promise<SoundCloudResponse>;
/**
* Threads content downloader
* @async
* @function threads
* @param {string} url - Threads post URL
* @returns {Promise<ThreadsResponse>} Object containing media details and download links
* @throws {Error} When invalid URL or request fails
* @example
* const result = await threads('https://www.threads.net/@cindyyuvia/post/C_Nqx3khgkI');
*/
declare function threads(url: string): Promise<ThreadsResponse>;
export { fbdown, igdl, ttdl, twitter, youtube, mediafire, capcut, gdrive, pinterest, aio, xiaohongshu, douyin, snackvideo, cocofun, spotify, yts, soundcloud, threads, version as VERSION, wm as developer, issues };
//# sourceMappingURL=index.d.ts.map