How can I download videos from reddit using praw
Asked Answered
P

2

5

So I want to download videos from reddit, I've seen projects on github but I'm very new to python and don't know how it works, if someone could explain I'd appreciate it, I found this project It works but it seperates audio and video and I want it all in one, I think you can combine those using ffmpeg but I don't know how that works either, also how do I configure some of this stuff like where the videos save and quality, here's my code.

from redvid import Downloader
import praw

reddit = praw.Reddit(client_id = "a", client_secret = "b", user_agent = "c")

subreddit = reddit.subreddit("learnpython")
hot = subreddit.hot(limit=5)

downloader = Downloader(max_q=True)

for submission in hot:
    downloader.url = submission.url
    reddit.download()
Pepys answered 14/11, 2020 at 20:50 Comment(2)
Does this thread answer your question? #28219549Bodkin
Thank you, but how could I change the place where ffmpeg downloads are saved?Pepys
K
4

There is a very easy to use library that installs reddit videos with sound just install RedDownloader by:

pip install RedDownloader

use it with:

from RedDownloader import RedDownloader

file = RedDownloader.Download(url = "url of post" , output="output file name here" , quality = 720)

quality is video quality where possible qualities are 360 , 720 , 1080

Keniakenilworth answered 11/10, 2021 at 12:43 Comment(0)
S
2

I am the developer of redvid library.

You just need to fix your code in order to make it work properly:

from redvid import Downloader
import praw

reddit = praw.Reddit(client_id = "a", client_secret = "b", user_agent = "c")

subreddit = reddit.subreddit("learnpython")
hot = subreddit.hot(limit=5)

downloader = Downloader(max_q=True)

for submission in hot:
    downloader.url = submission.url
    downloader.download()
Shigella answered 16/9, 2023 at 21:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.