Skip to main content

Smart downloader for Reddit hosted videos

Project description

redvid

HitCount Build Status Python version Current Release

Smart downloader for Reddit hosted videos

Features

  • Download local hosted videos with audio.
  • Requires only requests and FFmpeg.
  • Ability to decide quality.
  • Bypass bot detection.

Installation

redvid requires Python 3.

Use pip to install the package from PyPI:

pip install redvid

Or, install the latest version of the package from GitHub:

pip install git+https://github.com/elmoiv/redvid.git

Usage

Using redvid to download a video:

> python credvid.py --help

usage: credvid.py [-h] -u URL [-p PATH] [-o] [-mxq] [-mnq] [-mxd MAXDURATION]
                  [-mxs MAXSIZE] [-am] [-px PROXIES]

Argument parser for redvid module

required arguments:
  -u URL, --url URL     Post URL for Reddit hosted video

optional arguments:
  -p PATH, --path PATH  Custom path for downloaded videos
  -o, --overwrite       Overwrite existing videos and ignore exception
  -mxq, --maxquality    Auto select maximum quality
  -mnq, --minquality    Auto select minimum quality
  -mxd MAXDURATION, --maxduration MAXDURATION
                        Ignore videos that exceed this duration (in seconds)
  -mxs MAXSIZE, --maxsize MAXSIZE
                        Ignore videos that exceed this size (in bytes)
  -am, --automax        Automatically download video with maximum size (Helps
                        for old reddit videos with unknown qualities)
  -px PROXIES, --proxies PROXIES
                        Download videos through proxies for blocked regions
  • via scripts:
from redvid import Downloader

reddit = Downloader(max_q=True)
reddit.url = 'https://v.redd.it/c8oic7ppc2751'
reddit.download()

or

__import__('redvid').Downloader(url='https://v.redd.it/c8oic7ppc2751', max_q=True).download()

Installing FFmpeg

Windows:

https://m.wikihow.com/Install-FFmpeg-on-Windows

(You may need to restart your pc after applying these steps)

Linux:

sudo apt install ffmpeg

Mac OS:

  • install Homebrew:

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  • Then:

    $ brew install ffmpeg

Tests

Here are a few sample tests:

Changelog

v1.1.3:

  • #20 Added a feature to create a folder in case it does not exist.

v1.1.2:

  • #18 Fixed bug when handling path that caused recursive directories.

v1.1.1:

  • #15 Fixed bug when fetching reddit videos with expiry date.

v1.1.0:

  • #11 redvid can now decide best quality according to given size.
  • Added support for old reddit videos.
  • Fixed bug where video qualities list can't be parsed.

v1.0.9:

  • #8 Added the ability to disable logging.
  • Maximum video size can be set.
  • #9 Maximum video duration can be set.

v1.0.8:

  • #7 Fixed a bug with quality fetching.

v1.0.7:

  • download() will return file path again.

v1.0.6:

  • #5 Can now download urls with v.reddit.it fromat.
  • #4 PATH can be choosed instead of current dir.
  • #3 Max/Min quality can be automatically set to skip quality query.
  • Added ffmpeg encoding to videos with no sound to be uploadable on some platforms.
  • Adjusted printed text and progress bars.

Stargazers over time

Stargazers over time

Contributing

Please contribute! If you want to fix a bug, suggest improvements, or add new features to the project, just open an issue or send me a pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redvid-2.0.3.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

redvid-2.0.3-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file redvid-2.0.3.tar.gz.

File metadata

  • Download URL: redvid-2.0.3.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.28.2 setuptools/68.0.0 requests-toolbelt/0.9.1 tqdm/4.65.0 CPython/3.7.7

File hashes

Hashes for redvid-2.0.3.tar.gz
Algorithm Hash digest
SHA256 105657164dfa513e92034f751d0e9cf34dfc023758ab65155a9c765ad8ff6e26
MD5 e04b4e71e7860612e9058e5ded2e69f0
BLAKE2b-256 d14a6cca0a8e84efd372092a78c27057eb2f181767b17a4a12c505354d070a48

See more details on using hashes here.

File details

Details for the file redvid-2.0.3-py3-none-any.whl.

File metadata

  • Download URL: redvid-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.28.2 setuptools/68.0.0 requests-toolbelt/0.9.1 tqdm/4.65.0 CPython/3.7.7

File hashes

Hashes for redvid-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 08101e9e524c1f099b29559881e92d3ffe5caa512158260f13c80eb4107b3b53
MD5 aff58500fcf148719844a7979fee48f6
BLAKE2b-256 e01552ebf1ee73cc0b4df33713485cf96914c2387dcf8f046eaacd3588338fcd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page