npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vidzit-dl

v0.0.2

Published

A simple Reddit video downloader that allows you to download videos from Reddit using node js. Made using node-fetch and ffmpeg.wasm.

Downloads

6

Readme

A simple Reddit video downloader that allows you to download videos from Reddit using node js. Made using node-fetch and 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

💻 How To Install

npm install vidzit-dl

✏️ Example

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()

📖 API

VidzitDL

Download reddit videos through node.js

Kind: global class
See: https://github.com/Guuzzeji/reddit-vid-dl#readme


VidzitDL.initialize(redditURL) ⇒ Promise.<VidzitDL>

Initialize the VidezDitDL class and create an object from it.

Kind: static method of VidzitDL
Returns: Promise.<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

Example of Return JSON

{
  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
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

{
  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
Returns: JSON - A json of the video resolution url and other infomation

Example of Return JSON

{
  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
See: More infomation how to use setLogger and setProgress 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.