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

from bentu 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 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 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.1.tar.gz (16.6 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.1-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bentu_downloader-0.1.1.tar.gz
  • Upload date:
  • Size: 16.6 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.1.tar.gz
Algorithm Hash digest
SHA256 08d092176a1cd13cc0ddeb2a97f8e70777a29bc5b9e24ddc37000556fdb2ead9
MD5 778308a1ff6f5e2757989db972798853
BLAKE2b-256 7730c7073e3ba23ef99b7d19010c77015cde46766d66d065c347cc3fd03178c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bentu_downloader-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 845bca522debba81f0d55105af61a03ced419352900b783260e495bbf92bcf45
MD5 1372bd23bd08112eca8a557fa6840bd2
BLAKE2b-256 f6391049f1079c7530281d54f8e1948f157f4715ba556b00f38f29756a697d0f

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