Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guuzzeji/vidzit-dl
A simple Reddit video downloader that allows you to download videos from Reddit using node js. Made using node-fetch and ffmpeg.wasm.
https://github.com/guuzzeji/vidzit-dl
ffmpeg ffmpeg-wasm javascript nodejs npm npm-package reddit reddit-api reddit-downloader video videodownloader webassembly
Last synced: 2 days ago
JSON representation
A simple Reddit video downloader that allows you to download videos from Reddit using node js. Made using node-fetch and ffmpeg.wasm.
- Host: GitHub
- URL: https://github.com/guuzzeji/vidzit-dl
- Owner: Guuzzeji
- License: mit
- Created: 2021-05-08T23:08:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-01T11:09:48.000Z (over 1 year ago)
- Last Synced: 2024-10-13T23:05:37.304Z (about 1 month ago)
- Topics: ffmpeg, ffmpeg-wasm, javascript, nodejs, npm, npm-package, reddit, reddit-api, reddit-downloader, video, videodownloader, webassembly
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/vidzit-dl
- Size: 190 KB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
A simple Reddit video downloader that allows you to download videos from Reddit using node js. Made using [node-fetch](https://www.npmjs.com/package/node-fetch) and [ffmpeg.wasm](https://github.com/ffmpegwasm/ffmpeg.wasm).
**IMPORTANT NOTE:** Video can't be embedded (No Youtube links, No Vimeo, etc).
This is not an official Reddit library, but we do use Reddit's official web API.
# 📌 Table of Contents
- [📌 Table of Contents](#-table-of-contents)
- [💻 How To Install](#-how-to-install)
- [✏️ Example](#️-example)
- [📖 API](#-api)
- [VidzitDL](#vidzitdl)
- [VidzitDL.initialize(redditURL) ⇒ Promise.\](#vidzitdlinitializeredditurl--promisevidzitdl)
- [vidzitDL.videoInfo](#vidzitdlvideoinfo)
- [**Example of Return JSON**](#example-of-return-json)
- [vidzitDL.findFormatVideo(format) ⇒ JSON](#vidzitdlfindformatvideoformat--json)
- [**Example of Return JSON**](#example-of-return-json-1)
- [vidzitDL.findMaxFormatVideo() ⇒ JSON](#vidzitdlfindmaxformatvideo--json)
- [**Example of Return JSON**](#example-of-return-json-2)
- [vidzitDL.createVideo(options) ⇒ Promise.\](#vidzitdlcreatevideooptions--promiseuint8array)
- [🤝 How to Contribute (Thank You!)](#-how-to-contribute-thank-you)# 💻 How To Install
```bash
npm install vidzit-dl
```# ✏️ Example
```js
const VidzitDL = require("vidzit-dl");async function example1() {
let video1 = await VidzitDL.initialize("https://www.reddit.com/r/IndieDev/comments/10hgvjq/vr_has_been_punishing_for_particles");
console.log(video1.videoInfo);
console.log(await video1.createVideo({
format: '480',
setLogger: function (type, message) {
console.log(type + ": " + message);
},
setProgress: function (ratio) {
console.log(ratio);
}
}));
}async function example2() {
let video1 = await VidzitDL.initialize("https://www.reddit.com/r/IndieDev/comments/10hgvjq/vr_has_been_punishing_for_particles");
console.log(video1.videoInfo);
console.log(await video1.createVideo());
}example1()
example2()
```### VidzitDL
Download reddit videos through node.js**Kind**: global class
**See**: [https://github.com/Guuzzeji/reddit-vid-dl#readme](https://github.com/Guuzzeji/reddit-vid-dl#readme)---
### VidzitDL.initialize(redditURL) ⇒ [
Promise.<VidzitDL>
](#VidzitDL)
Initialize the VidezDitDL class and create an object from it.**Kind**: static method of [
VidzitDL
](#VidzitDL)
**Returns**: [Promise.<VidzitDL>
](#VidzitDL) - returns an VidzitDL object that can be used to get information about the video dash urls and download the video| Param | Type | Description |
| --- | --- | --- |
| redditURL |String
| A normal reddit url of the video post you want to download |---
### vidzitDL.videoInfo
Returns the video information like video url and reddit base url of post**Kind**: instance property of [
VidzitDL
](#VidzitDL)#### **Example of Return JSON**
```js
{
baseURL: "{URL to reddit post}"
dashURL: "{URL to dash file}",
dashContent: {
video: [
{
type: "video",
maxFormat: true || false,
format: "720",
url: "{URL to video format}",
},
...
],
audio: {
type: "audio",
url: "{URL to audio files}",
}
}
}
```---
### vidzitDL.findFormatVideo(format) ⇒
JSON
Searchs dash file to find video resolution (Ex: 480, 720, 1080). It can also return an error if video resolution is not found.**Kind**: instance method of [
VidzitDL
](#VidzitDL)
**Returns**:JSON
- A json of the video resolution url and other infomation| Param | Type | Description |
| --- | --- | --- |
| format |String
| the video format you want (Ex: 480, 720, 1080) |#### **Example of Return JSON**
```js
{
type: "video",
maxFormat: true || false,
format: "720",
url: "{URL to video format}",
}
```---
### vidzitDL.findMaxFormatVideo() ⇒
JSON
Searchs dash file to find video resolution for max resolution of video.**Kind**: instance method of [
VidzitDL
](#VidzitDL)
**Returns**:JSON
- A json of the video resolution url and other infomation#### **Example of Return JSON**
```js
{
type: "video",
maxFormat: true,
format: "1080",
url: "{URL to video format}",
}
```---
### vidzitDL.createVideo(options) ⇒
Promise.<Uint8Array>
Creates a video with the specified format you want. OR can default to max resolution if not specified.**Kind**: instance method of [
VidzitDL
](#VidzitDL)
**See**: More infomation how to use setLogger and setProgress [https://github.com/ffmpegwasm/ffmpeg.wasm/blob/master/docs/api.md#ffmpeg-setlogging](https://github.com/ffmpegwasm/ffmpeg.wasm/blob/master/docs/api.md#ffmpeg-setlogging)| Param | Type | Description |
| --- | --- | --- |
| options |Object
| JSON that stores all options for this function |
| options.format |String
| The format you want to download (Ex: 480, 720, 1080). Default is max resolution if not specified. |
| options.setLogger |function
| Allows you to process ffmpeg logs with your own function. |
| options.setProgress |function
| Allows you to process ffmpeg progresss with your own function. |---
# 🤝 How to Contribute (Thank You!)
- Fork the main branch- Open your fork and add your changes / features / bug fixes
- Create a pull request
- Make sure to add a description of what changes you have made and why your changes are important.