
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
socialmediadl
Advanced tools
A universal social media downloader package for Node.js.
Download media from 17+ platforms including LinkedIn, Threads, Reddit, Facebook, Instagram, TikTok, YouTube, Pinterest, Twitter, and more — with auto-detection and easy-to-use API.
npm install socialmediadl
Or with yarn:
yarn add socialmediadl
Or with pnpm:
pnpm add socialmediadl
The easiest way to use socialmediadl is with the auto-detection feature:
const socialmediadl = require('socialmediadl');
async function downloadMedia() {
try {
// Auto-detect platform and download
const url = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
const result = await socialmediadl.download(url);
console.log('Platform:', result.platform); // 'youtube'
console.log('Data:', result.data); // Media download info
} catch (error) {
console.error('Error:', error.message);
}
}
downloadMedia();
Response Format:
{
platform: 'youtube', // Detected platform name
data: {
// Platform-specific media download information
// (varies by platform)
}
}
For more control, use platform-specific functions:
const {
fetchYoutubeData,
fetchTiktokData,
fetchMetaData,
fetchTwitterData
} = require('socialmediadl');
async function examples() {
// YouTube
const youtubeData = await fetchYoutubeData('https://youtube.com/watch?v=...');
// TikTok
const tiktokData = await fetchTiktokData('https://tiktok.com/@user/video/...');
// Facebook/Instagram
const metaData = await fetchMetaData('https://instagram.com/p/...');
// Twitter/X
const twitterData = await fetchTwitterData('https://twitter.com/user/status/...');
}
Always wrap your calls in try-catch blocks:
const socialmediadl = require('socialmediadl');
async function safeDownload(url) {
try {
const result = await socialmediadl.download(url);
return result;
} catch (error) {
if (error.message.includes('not supported')) {
console.error('Platform not supported:', url);
} else {
console.error('Download error:', error.message);
}
return null;
}
}
socialmediadl.download(url)Auto-detects platform and downloads media.
Parameters:
url (string): The social media URLReturns:
Promise<{
platform: string, // Detected platform name
data: object // Media download information
}>
Throws:
All platform functions return a Promise with platform-specific data:
| Function | Platform | Example URL |
|---|---|---|
fetchBlueskyData(url) | Bluesky | https://bsky.app/... |
fetchCapcutData(url) | CapCut | https://capcut.com/... |
fetchDailymotionData(url) | Dailymotion | https://dailymotion.com/... |
fetchDouyinData(url) | Douyin | https://douyin.com/... |
fetchMetaData(url) | Facebook/Instagram | https://instagram.com/p/... |
fetchKuaishouData(url) | Kuaishou | https://kuaishou.com/... |
fetchLinkedinData(url) | https://linkedin.com/... | |
fetchPinterestMedia(url) | https://pinterest.com/pin/... | |
fetchRedditData(url) | https://reddit.com/r/... | |
fetchSnapchatData(url) | Snapchat | https://snapchat.com/... |
fetchSoundcloudData(url) | Soundcloud | https://soundcloud.com/... |
fetchSpotify(url) | Spotify | https://spotify.com/track/... |
fetchThreadsData(url) | Threads | https://threads.net/... |
fetchTiktokData(url) | TikTok | https://tiktok.com/@user/video/... |
fetchTumblrData(url) | Tumblr | https://tumblr.com/... |
fetchTwitterData(url) | Twitter/X | https://twitter.com/user/status/... |
fetchYoutubeData(url) | YouTube | https://youtube.com/watch?v=... |
Example:
const { fetchYoutubeData } = require('socialmediadl');
const data = await fetchYoutubeData('https://youtube.com/watch?v=...');
console.log(data);
const socialmediadl = require('socialmediadl');
// Main function
socialmediadl.download(url)
// All platform-specific functions
const {
fetchBlueskyData,
fetchCapcutData,
fetchDailymotionData,
fetchDouyinData,
fetchMetaData,
fetchKuaishouData,
fetchLinkedinData,
fetchPinterestMedia,
fetchRedditData,
fetchSnapchatData,
fetchSoundcloudData,
fetchSpotify,
fetchThreadsData,
fetchTiktokData,
fetchTumblrData,
fetchTwitterData,
fetchYoutubeData
} = socialmediadl;
.
├── config/ # Configuration files (axios setup)
├── services/ # Platform-specific downloader functions
├── index.js # Main module exports
├── test.js # Example test file
├── package.json # Package metadata
└── README.md # Documentation
Run the included test file to see examples:
node test.js
Or create your own test:
const socialmediadl = require('socialmediadl');
async function myTest() {
const result = await socialmediadl.download('YOUR_URL_HERE');
console.log(result);
}
myTest();
Contributions are welcome! Feel free to:
ST | Sheikh Tamim
GitHub: @sheikhtamimlover
Repository: socialmediadl
This project is open source and available for use.
If you find this package useful, please consider giving it a ⭐ on GitHub!
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.