fdown-downloader
v1.0.0
Published
A professional Facebook video downloader library
Maintainers
Readme
FDown Downloader
A professional Facebook video downloader library built with Node.js.
This library is powered by fdown.net
Features
- Download Facebook videos in SD and HD quality
- Class-based implementation for easy integration
- Promise-based API
- Error handling
Installation
npm install fdown-downloaderUsage
Basic Usage
const FacebookDownloader = require('fdown-downloader');
// Create a new instance
const downloader = new FacebookDownloader();
// Download video details
async function downloadVideo() {
try {
const videoUrl = 'https://www.facebook.com/video/url';
const details = await downloader.download(videoUrl);
console.log(details);
} catch (error) {
console.error(error.message);
}
}Available Methods
1. Download Full Video Details
const details = await downloader.download(videoUrl);
// Returns: { title, description, duration, thumb_url, sd_link, hd_link }2. Get SD Quality Link Only
const sdLink = await downloader.getSDLink(videoUrl);
// Returns: string (SD quality download URL)3. Get HD Quality Link Only
const hdLink = await downloader.getHDLink(videoUrl);
// Returns: string (HD quality download URL)Example Response
{
title: "Video Title",
description: "Video Description",
duration: "Video Duration",
thumb_url: "Thumbnail URL",
sd_link: "SD Quality Download Link",
hd_link: "HD Quality Download Link"
}Error Handling
The library uses try-catch blocks for error handling. All methods will throw an error if:
- The video URL is invalid
- The request fails
- The video is not available
- The server returns an error
try {
const details = await downloader.download(videoUrl);
} catch (error) {
console.error('Error:', error.message);
}Development
# Clone the repository
git clone https://github.com/yourusername/fdown-downloader.git
cd fdown-downloader
# Install dependencies
npm install
# Run tests
npm testContributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Code Owner
Sisula Welgamage
