Skip to main content

A standalone Python video downloader toolkit for public platform media and direct streams.

Project description

Bentu Downloader

Bentu is a standalone, importable Python downloader toolkit for public platform media, direct streams, and pages that expose downloadable video or audio.

It is designed for videos and media that you own, created yourself, have permission to download, or are otherwise legally allowed to save. It does not bypass DRM, paywalls, logins, captchas, private APIs, or other access controls.

What works in this first version

  • Importable Python API: from bentu import download
  • CLI command: bentu URL -o "%(title)s.%(ext)s"
  • Standalone runtime: no required third-party Python packages
  • Direct media URLs such as .mp4, .webm, .m4a, .mp3, .mov
  • Simple unencrypted HLS playlists (.m3u8)
  • Generic HTML pages that expose media via <video>, <source>, og:video, Twitter cards, JSON-LD, or visible script data
  • Public platform pages when they expose a normal downloadable media URL
  • PyPI update check on CLI startup
  • Retries, progress output, custom headers, output templates
  • Provider architecture for adding dedicated site extractors

Install locally

python -m pip install -e .

Build for PyPI

Every PyPI upload needs a version that has never been uploaded before:

python scripts/bump_version.py 0.1.2
python -m pip install build
python -m build

The build output will be in dist/.

Upload to PyPI

Install Twine once:

python -m pip install twine

Upload:

python -m twine upload dist/*

CLI examples

bentu "https://example.com/video.mp4"
bentu "https://example.com/video.mp4" -o "downloads/%(title)s.%(ext)s"
bentu "https://example.com/page-with-video" --print-info
bentu "https://example.com/stream.m3u8" --no-update-check
bentu "https://example.com/video.mp4" --add-header "Referer:https://example.com/"

Useful options:

bentu --help

Python examples

After installing from PyPI, the package name uses a dash:

python -m pip install bentu-downloader

Python imports cannot contain a dash, so use the import name with an underscore:

import bentu_downloader

result = bentu_downloader.download("https://example.com/video.mp4")
print(result.path)

Short import name also works:

import bentu

result = bentu.download("https://example.com/video.mp4")
print(result.path)
from bentu_downloader import download

result = download("https://example.com/video.mp4", output="videos/%(title)s.%(ext)s")
print(result.path)

Or use the downloader object:

from bentu_downloader import Downloader, DownloadOptions

downloader = Downloader()
info = downloader.extract_info("https://example.com/page-with-video")
print(info.title, info.formats)

result = downloader.download(
    "https://example.com/page-with-video",
    DownloadOptions(output="%(title)s.%(ext)s"),
)

Flexible option wrapper

from bentu_downloader import BentuDL

options = {
    "output": "downloads/%(title)s.%(ext)s",
    "format": "best",
    "quiet": False,
}

with BentuDL(options) as bdl:
    info = bdl.extract_info("https://example.com/video.mp4", download=True)
    print(info["filepath"])

Adding a provider

Create a provider by subclassing Provider and returning a MediaInfo object:

from bentu.models import MediaFormat, MediaInfo
from bentu.providers import Provider


class MyProvider(Provider):
    name = "my-site"

    def supports(self, url: str) -> bool:
        return "example.com" in url

    def extract(self, url: str, context):
        return MediaInfo(
            webpage_url=url,
            title="Example Video",
            formats=[MediaFormat(format_id="best", url="https://example.com/video.mp4", ext="mp4")],
        )

Then pass it to Downloader(providers=[MyProvider()]).

Platform support

Bentu can download from platform pages when the page exposes a normal public media URL. That includes public pages on platforms such as YouTube, TikTok, Instagram, VOE, Filmora, Vimeo, X, Facebook, and similar sites when a direct media file or simple stream is visible to the page. Dedicated providers can be added for sites that need custom parsing. Sites that require DRM, login, captchas, protected private APIs, regional checks, or non-public stream signatures are reported clearly instead of being bypassed.

Publishing checklist

Before uploading, change the package metadata in pyproject.toml:

  • name, if you want a different PyPI project name
  • authors
  • Homepage, Repository, and Issues
  • version, every time you publish a new release

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

bentu_downloader-0.1.2.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

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

bentu_downloader-0.1.2-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file bentu_downloader-0.1.2.tar.gz.

File metadata

  • Download URL: bentu_downloader-0.1.2.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for bentu_downloader-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c51776c594e15b58ab9ddd4882d03f7fa6d4537dd4ee270730b648006888ab9b
MD5 3a9aa7a68de29178552c7c44d21957c7
BLAKE2b-256 0dbc58a6f07896fb69fd7722c3dd2080be8dfa084fdcf8fe6f3b5f23c6fbf6d3

See more details on using hashes here.

File details

Details for the file bentu_downloader-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for bentu_downloader-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 408b608588f30a033a8ce82d2b6fd6b7ae174519f2f3a5f6532ede2cc1ae0a7b
MD5 ed06c7f7376946860178d8901387acef
BLAKE2b-256 ae9c606f548519afcc4d21326bf2c861706eae365b21559f365d950385f21b19

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