reddit-video-creator icon indicating copy to clipboard operation
reddit-video-creator copied to clipboard

✨📼Create Reddit Videos with JavaScript📼✨

✨📼 Create Reddit Videos with JavaScript 📼✨

https://user-images.githubusercontent.com/74852397/176777528-649ec815-441d-4e94-9cfb-09a7bdaf0c74.mp4

Welcome to the Reddit Video Creation project, powered by JavaScript! This tool allows you to effortlessly generate captivating videos from Reddit posts. Below, you'll find instructions on setting up and running the project.

🚀 Setup

If you encounter any issues during setup, please refer to the References section for additional resources.

🪟 Windows

  1. Begin by downloading and installing the following components:

    Once installed, make sure to save their respective executable file paths (ffmpeg, ffprobe, bal4web) into the /src/data/settings.json file.

🐧 Linux

  1. Follow these steps to set up on Linux:

    • Install the latest version of Node.js with the following commands:

      curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
      export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
      [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
      nvm install --lts
      
    • Download and save FFMPEG and BAL4WEB in a dedicated folder. Be sure to store the paths for ffmpeg, ffprobe, and bal4web in the /src/data/settings.json file.

    • Install Wine using one of the following commands, depending on your Linux distribution:

      Debian:

      sudo apt update -y
      sudo apt install wine64 -y
      

      Arch:

      sudo pacman -Syu -y
      sudo pacman -S wine-staging -y
      

💀 macOS - #todo

🏃 Run

To start creating Reddit videos, follow these steps:

  1. Add Reddit video items to the src/data/posts.json file. Here's an example of how to structure your entries:

    [
      {
        "status": "queue", // queue, draft, finish
        "url": "https://www.reddit.com/r/AskReddit/comments/xxx/xxx", // Post URL
        "maxDuration": 8, // Maximum video duration
        "videosCount": 1, // Number of videos per set maxDuration
        "image": "/backgrounds/mike-dubyna-gwLO-b1n5Yc-unsplash.jpg" // Video background image /public/<image path>
      }
    ]
    
  2. Open your terminal and run the following commands:

    npm i
    npm start
    

⚙️ Config

Customize your video creation settings by editing the /src/data/settings.json file:

{
  "exportPath": "/home/john/Desktop/reddit-videos/", // Video export path
  "backgroundMusic": "", // Video background music (default: /public/music.mp3)
  "voice": "AriaNeural", // Voice choice: AriaNeural, JennyNeural, GuyNeural, AmberNeural, AshleyNeural, CoraNeural, ElizabethNeural, MichelleNeural, MonicaNeural, AnaNeural, BrandonNeural, ChristopherNeural, JacobNeural, EricNeural
  "maxScore": 1000, // Minimum Reddit post comment score
  "bal4web": "/home/john/Desktop/bal4web/bal4web.exe", // Bal4web executable path
  "ffmpeg": "/home/john/Desktop/ffmpeg/ffmpeg", // FFmpeg executable path
  "ffprobe": "/home/john/Desktop/ffmpeg/ffprobe" // FFprobe executable path
}

🧰 Todo

Here's a list of tasks to enhance the project:

  • [x] Implement loading indicator in the CLI
    • [x] Provide more detailed progress information
  • [x] Change the background image
  • [ ] Add video to the background
  • [x] Include background audio
  • [x] Implement settings configuration via .json files
  • [ ] Transform into a CLI tool
  • [x] Implement custom thumbnail resizing script
  • [ ] Implement word censorship
  • [x] Merge extra content into a single video
  • [ ] Update setup instructions for macOS
  • [ ] Refactor and improve codebase

📑 References

For further assistance, refer to these helpful resources: