https://github.com/tbetool/php-fb-youtube-download
PHP Library to download Facebook and Youtube videos
https://github.com/tbetool/php-fb-youtube-download
Last synced: 4 months ago
JSON representation
PHP Library to download Facebook and Youtube videos
- Host: GitHub
- URL: https://github.com/tbetool/php-fb-youtube-download
- Owner: TBETool
- License: gpl-3.0
- Created: 2018-10-05T10:05:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-08T04:53:58.000Z (over 6 years ago)
- Last Synced: 2025-02-09T19:16:30.836Z (4 months ago)
- Language: PHP
- Homepage:
- Size: 22.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## PHP Library: Facebook-Youtube downloader
PHP Library to download Facebook and Youtube videos.
---
### Using the Library#### Requirement
1. FFMPEG: Media editing library
2. youtube-dl: command line library to download videos#### Installation
Intall library in PHP project using composer
```
composer require tbetool/php-fb-youtube-download
```#### Using Library
$downloader = new Downloader(FFMPEG_PATH, YOUTUBE-DL_PATH);
#### Setting output path
Set absolute path of the directory where to save the output. You don't need to provide a file name as it will be auto generated.
```
$path = '/aboslute/path/to/directory';$downloader->setOutputPath($path);
```#### Download video
```
$downloader->download(video_url);
```
You can pass Facebook or Youtube video url to the `download()` function.
If video is downloaded successfully, this will return the path of the local video saved, otherwise will throw an exception.---
### Exception handlingEvery function throws an Exception in case of any error/issue. Bind the code block within `try-catch` block to catch any exception occurred.
_Ex:_
```
try {
$downloader->download(video_url);
} catch (Exception $exception) {
echo $exception->getMessage();
}
```---
### Bug ReportingIf you found any bug, create an [issue](https://github.com/TBETool/php-fb-youtube-download/issues/new).
---
### Support and ContributionSomething is missing?
* `Fork` the repositroy
* Make your contribution
* make a `pull request`