Skip to main content

A small, importable Python video downloader toolkit with a yt-dlp-like CLI.

Project description

Bentu Downloader

Bentu is a small, importable Python downloader toolkit with a yt-dlp-style command line interface.

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"
  • 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, or JSON-LD contentUrl
  • PyPI update check on CLI startup
  • Retries, progress output, custom headers, output templates
  • Provider architecture for adding more sites

Install locally

python -m pip install -e .

Build for PyPI

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"),
)

yt-dlp-style migration helper

from bentu import BentuDL

options = {
    "outtmpl": "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()]).

Note about big platforms

Platforms such as YouTube, TikTok, streaming hosts, and movie sites change frequently and often use signatures, throttling, login flows, region checks, or DRM. Bentu's core intentionally does not implement bypasses for those systems. If a page exposes a normal public media URL, Bentu can download it through the generic providers.

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.0.tar.gz (15.5 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.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bentu_downloader-0.1.0.tar.gz
  • Upload date:
  • Size: 15.5 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.0.tar.gz
Algorithm Hash digest
SHA256 9fe774655db749dfba9bbb86916f4de5fd147c3090518db20ab209657d1a208a
MD5 d8e372c2123e04513c4d25c50b431788
BLAKE2b-256 07efdd4e3195e20c4434838f79997eda532c213ea9412fda5789e2481f98c752

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bentu_downloader-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8beafaee4763afdc26082506bc881bed54e401bfbf07019480584e1394c1b8e0
MD5 38bdd966db85a964922731890cf93bb6
BLAKE2b-256 e7f25c555cd1ee6ff6d76c4bfa6cacb2a05ef47276adac7b349e04602b178302

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