A simple tool to generate direct download links for media from Instagram, Facebook, Twitter, Snapchat, YouTube and TikTok! Just provide the post URL, and this package will return a direct download URL.
You can install happy-dl
via npm:
npm install happy-dl
Or, if you're using Yarn:
yarn add happy-dl
You can import the entire happy-dl
module:
const happyDL = require("happy-dl");
Or destructure specific functions:
const {
instagramDownloader,
facebookDownloader,
twitterDownloader,
snapchatDownloader,
youtubeDownloader,
tiktokDownloader,
} = require("happy-dl");
async function fetchInstagramData() {
try {
const result = await happyDL.instagramDownloader(
"https://www.instagram.com/reel/C2xQMDBBY6v/"
);
console.log("Fetched Instagram media details:", result);
} catch (error) {
console.error("Error fetching Instagram media details:", error);
}
}
fetchInstagramData();
async function fetchFacebookData() {
try {
const result = await happyDL.facebookDownloader(
"https://www.facebook.com/share/r/yfF9ZULaNJnQ72Ur/"
);
console.log("Fetched Facebook media details:", result);
} catch (error) {
console.error("Error fetching Facebook media details:", error);
}
}
fetchFacebookData();
async function fetchTwitterData() {
try {
const result = await happyDL.twitterDownloader(
"https://x.com/ImHappyKumar/status/1758877530776547450"
);
console.log("Fetched Twitter media details:", result);
} catch (error) {
console.error("Error fetching Twitter media details:", error);
}
}
fetchTwitterData();
async function fetchSnapchatData() {
try {
const result = await happyDL.snapchatDownloader(
"https://snapchat.com/t/VHVlyNZX"
);
console.log("Fetched Snapchat media details:", result);
} catch (error) {
console.error("Error fetching Snapchat media details:", error);
}
}
fetchSnapchatData();
async function fetchYoutubeData() {
try {
const result = await happyDL.youtubeDownloader(
"https://www.youtube.com/watch?v=j7asIBf1HcQ&ab_channel=SeekingOfHappiness"
);
console.log("Fetched YouTube media details:", result);
} catch (error) {
console.error("Error fetching YouTube media details:", error);
}
}
fetchYoutubeData();
async function fetchTiktokData() {
try {
const result = await happyDL.tiktokDownloader(
"https://www.tiktok.com/@khaby.lame/video/7473945919407377686?lang=en"
);
console.log("Fetched TikTok media details:", result);
} catch (error) {
console.error("Error fetching TikTok media details:", error);
}
}
fetchTiktokData();
- Snapchat
- YouTube
- TikTok
- More coming soon!
Contributions are welcome! If you find any issues or want to contribute new features, feel free to fork the repository and create a pull request.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.