download video from RuTube
Project description
English / Russian
What is it?
Small project with one main function - download a video from RuTube(it's a russian copy of YouTube).
How to use it?
UI
- Download executable file from Releases.
CLI
- Install library
pip install async_rutube_downloader
- Run
rtube-cli https://rutube.ru/video/365ae8f40a2ffd2a5901ace4db799de7/
rtube-cli --helpoutput
❯ rtube-cli
usage: rtube-cli [-h] [-o] [-q] [-v] [-f] [-d] [url]
This CLI utility allows you to download videos from Rutube.
- You can download a single video or multiple videos by providing a file with URLs.
- By default, videos from a file will be downloaded in the best available quality.
positional arguments:
url URL or ID of the Rutube video
options:
-h, --help show this help message and exit
-o , --output Output directory (default: current working directory)
-q, --quality Select video quality interactively
-v, --version show program's version number and exit
Multiple videos download:
-f , --file Path to the file with URLs
-d , --delimiter Delimiter between URLs in the file(default: \n)
Usage examples:
- Download single video:
[rtube-cli] 365ae8f40a2ffd2a5901ace4db799de7
[rtube-cli] https://rutube.ru/video/365ae8f40a2ffd2a5901ace4db799de7/
[rtube-cli] https://rutube.ru/video/365ae8f40a2ffd2a5901ace4db799de7/ -q
- Download multiple videos:
[rtube-cli] -f ~/path/to/file1.txt
[rtube-cli] -f ~/path/to/file2.txt -d ,
Use in code
- Install library
pip install async_rutube_downloader
- Use example
qualities is a tuple, like: ((1280, 720), (1920,1080))
- async
import asyncio
from async_rutube_downloader.rutube_downloader import RutubeDownloader
async def download():
downloader = RutubeDownloader(
"https://rutube.ru/video/365ae8f40a2ffd2a5901ace4db799de7/"
)
qualities = await downloader.fetch_video_info()
await downloader.select_quality(max(qualities))
await downloader.download_video()
asyncio.run(download())
- sync
import asyncio
from async_rutube_downloader.rutube_downloader import RutubeDownloader
loop = asyncio.new_event_loop()
downloader = RutubeDownloader(
"https://rutube.ru/video/365ae8f40a2ffd2a5901ace4db799de7/", loop
)
qualities = loop.run_until_complete(downloader.fetch_video_info())
loop.run_until_complete(downloader.select_quality(max(qualities)))
loop.run_until_complete(downloader.download_video())
loop.close()
Source code
About
This project was created for learning purposes and was inspired by a similar synchronous library and a book about async.
Technical Features
- TKinter UI
argparse(stdlib) CLI- The honest progress bar shows the actual download progress.
- UI and loading work in different threads.
- UI localization.
- The async version allows you to use the full speed of your internet connection.
- PyInstaller is used to create an executable file.
Dependencies
| title | description |
|---|---|
| m3u8 | Used for playlist parsing |
| aiohttp | Async http client |
| aiofiles | async work with files |
| slugify | Convert video title to file name |
| CustomTkinter | Better TKinter UI |
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file async_rutube_downloader-1.4.2.tar.gz.
File metadata
- Download URL: async_rutube_downloader-1.4.2.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.8 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57c581c57c795a0b2bfee2e9af802c00f3eb9fadd34cdcdc775002f0cf0eb6bf
|
|
| MD5 |
dd025145e8f2f629547560fbc38fe18d
|
|
| BLAKE2b-256 |
920e1fa4bc328e9d0898739c5577be894e3c065d7f98e13d765a7dfb809aed6e
|
File details
Details for the file async_rutube_downloader-1.4.2-py3-none-any.whl.
File metadata
- Download URL: async_rutube_downloader-1.4.2-py3-none-any.whl
- Upload date:
- Size: 24.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.8 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6a927dcb795cb219283b6961e1f5ed3e8bded6a983f02cfda359c9f380b4429
|
|
| MD5 |
598c8bd9faf55f09253a6fbdb8ac146d
|
|
| BLAKE2b-256 |
da3fd387734f56d394012b5a9a5ef419d0fef7da838f5be79fa18c4d3b261d2f
|