Skip to main content

This is the simplest module for download videos from Rutube

Project description

Rutube Downloader

Get it

pip install rutube-downloader

Try it

from rutube import Rutube

rt = Rutube('https://rutube.ru/video/5c5f0ae2d9744d11a05b76bd327cbb51/')

# Get a list of videos
# Each object is the same video but with different resolution
print(rt.playlist)  # [Nature 4k (272x480), Nature 4k (408x720), Nature 4k (608x1080)]

# Get a list of available resolutions
print(rt.playlist.available_resolutions)  # ['480', '720', '1080']

# Download a video with specific resolution and save it to the current directory 
rt.playlist.get_by_resolution(720).download()

# Download a video with the best quality and save it to specific directory 
# Path may be absolute or relative
rt.get_best().download('downloads/saved-videos')

Features

Get video with specific resolution

from rutube import Rutube

rt = Rutube('https://rutube.ru/video/5c5f0ae2d9744d11a05b76bd327cbb51/')

# Returns a video with the best quality
rt.get_best()

# Returns a video with the worst quality
rt.get_worst()

# Returns None if not found
rt.get_by_resolution(1080)

# Returns a list of integers - [480, 720, 1080]
rt.available_resolutions

Writing to bytes

from rutube import Rutube
from io import BytesIO, FileIO

rt = Rutube('https://rutube.ru/video/5c5f0ae2d9744d11a05b76bd327cbb51/')

with open('video.mp4', 'wb') as f:
    rt.get_best().download(stream=f)

with BytesIO() as stream:
    rt.get_best().download(stream=stream)

with FileIO() as file:
    rt.get_best().download(stream=file)

Faster downloading

Downloading using threads. Call download() with number of workers as argument.

[!WARNING] It's expensive way to download. Be careful to use it!

from rutube import Rutube

rt = Rutube('https://rutube.ru/video/5c5f0ae2d9744d11a05b76bd327cbb51/')

rt.get_best().download(workers=8)

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

rutube_downloader-0.0.7.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

rutube_downloader-0.0.7-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file rutube_downloader-0.0.7.tar.gz.

File metadata

  • Download URL: rutube_downloader-0.0.7.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for rutube_downloader-0.0.7.tar.gz
Algorithm Hash digest
SHA256 927123e4f4715cc6d774e2b68bb6e06518ebf0ca1ef2cf18328a3b44d0dcd963
MD5 d426c3684548d0c805ca5eb8bc673c26
BLAKE2b-256 37811ef0b0c00819559c03e3258f6d938f724e795a78f7f31fb8b11e86f85ce8

See more details on using hashes here.

File details

Details for the file rutube_downloader-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for rutube_downloader-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3f01acf55dc4e76974b21faa07879d3d6e6a5cc350b30a6c5d559147a212db96
MD5 75fb23489d4e500ca012ec2783be2512
BLAKE2b-256 ecac051fd5a1444049772df310cf831a7fb8b35f2dab8d495564cb4784836f85

See more details on using hashes here.

Supported by

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