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.available_resolutions)  # [480, 720, 1080]

# Download a video with specific resolution and save it to the current directory 
rt.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('video.mp4', 'wb') as file:  # Mode: wb or rb+
    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.8.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: rutube_downloader-0.0.8.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.8.tar.gz
Algorithm Hash digest
SHA256 73483345e8613a56ba4f1856364d65c6d96aeb66399ac20dce9de9d3f5edbcdc
MD5 d7971dc13181d69a2aae6515174cf01d
BLAKE2b-256 abdda02b4aadd634cc6fd1f50514a757c9e86aab57036b212df2356a4f1714cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rutube_downloader-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 8853e620a826bc50851f9a1e2841cc24ab47bf8d5d444ea8dfa3dc40f7c68ad7
MD5 6d0ad7cb93f78186637e94cfc02687a9
BLAKE2b-256 218a0c60f39dd6bdf8a0e216978c8ff45b221c02d71f932e99ec5dd5dab6ff6f

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