Python · Async · v1.7

Beeg API

A fully asynchronous Python API wrapper and scraper for Beeg. Fetch video metadata by parsing external API endpoints, and download streams via HLS. Powered by the eaf_base_api networking engine.

$ pip install unofficial-api-for-beeg 📋
GitHub →
⚠️ Legal Disclaimer
This tool is an unofficial, independent project and is not affiliated with, endorsed by, or sponsored by the target website. This software is provided "as is" for educational and personal purposes only. The developer assumes no responsibility for any consequences arising from the use of this tool, including but not limited to account suspension, IP blocking, or any violation of the target website's Terms of Service. Users are solely responsible for ensuring their use complies with all applicable laws and policies. Use at your own risk.
💚 Support & Commercial Licensing
If you find this project helpful, please consider donating to support its continued development!

Other Options:
PayPal
Ko-Fi

For extended features, enterprise integrations, or custom commercial licensing, please contact EchterAlsFakeBS@proton.me.

📦 Installation

Install from PyPI using pip:

bash
pip install unofficial-api-for-beeg

For TS→MP4 remuxing support (recommended for HLS downloads), install with the optional av dependency:

bash
pip install unofficial-api-for-beeg[av]
Note
Requires Python ≥ 3.12. eaf_base_api ≥ 4.0.0 is installed automatically as a dependency.

🚀 Quick Start

Every method in this API is asynchronous. You need to run your code inside an async function:

python
import asyncio
from beeg_api import Client

async def main():
    client = Client()

    # Fetch a video
    video = await client.get_video("https://beeg.com/1234567")

    # Access metadata
    print(video.title)
    print(video.duration)

    # Download the video
    from base_api import DownloadConfigHLS
    config = DownloadConfigHLS(quality="best", path="./downloads")
    await video.download(configuration=config)

asyncio.run(main())

⚙️ Configuration

The entire API relies on eaf_base_api for its networking. You can configure global settings (proxies, timeouts, etc.) via a custom BaseCore passed into the Client.

Please refer to the eaf_base_api Documentation for the complete reference on how to set up RuntimeConfig and properly integrate it with this API.

python
from base_api import BaseCore
from base_api.modules.config import RuntimeConfig
from beeg_api import Client

my_config = RuntimeConfig()
my_config.proxy = "socks5://127.0.0.1:9050"
my_config.request_attempts = 4

core = BaseCore(configuration=my_config)
client = Client(core=core)
eaf_base_api 4
Version 1.7 uses the v4 request and source-aware media contracts. RuntimeConfig.proxy is a single proxy URL (the old proxies mapping was removed), and request retries are configured with request_attempts plus the request_retry_* settings.

🔌 Client

The Client class is the entry point for all API requests. It initializes and manages the networking core to request video information pages.

python
from beeg_api import Client
from base_api import BaseCore

client = Client()

# Or initialize with custom core config
client_custom = Client(core=BaseCore())

Constructor Parameters

  • core BaseCore — Networking core instance (default: BaseCore())

Methods

Fetch Video get_video()

async
Fetches a video profile and returns a populated Video object. Queries Beeg's external store endpoints to obtain video parameters.
await client.get_video( url: str, load_api: bool = True ) -> Video

Parameters

  • url str — The full Beeg video URL
  • load_api bool — If True (default), fetches and parses the JSON metadata API response

Returns

→ Video
Source-aware fields
Beeg has no paginated Helper iterator: get_video() is its only fetch operation, so IteratorConfig, iterator RetryPolicy, custom scrape handlers, and ScrapeResult do not apply here. With load_api=True, all remote fields are loaded from the "api" source. If you construct a lightweight object with load_api=False, call await video.load_sources("api"), await video.load_fields("title", "duration"), or await video.get_field("title") before reading unresolved fields. Direct unresolved access raises DataNotLoadedError; a real loaded None does not.

🎬 Video

dataclass Inherits from BaseMedia. Represents a single video with details extracted from Beeg's store facts API.

Attributes

AttributeTypeDescription
urlstrThe video page URL
titlestr | NoneVideo title
video_idstr | NoneUnique video file ID
durationint | NoneVideo duration in seconds
m3u8_base_urlstr | NoneMaster HLS stream playlist URL
keystr | NoneVideo key extracted from the URL path

Methods

Download Video download()

async
Downloads the video via HLS streaming. Appends the video title to the output path unless no_title=True on the config.
await video.download( configuration: DownloadConfigHLS ) -> bool | DownloadReport

Parameters

Returns

→ bool | DownloadReport

⬇️ Downloading Options

Beeg video downloads are HLS-only. Configure stream downloads via DownloadConfigHLS:

python
from base_api import DownloadConfigHLS

config = DownloadConfigHLS(
    quality="best",            # "best", "half", "worst", or height int
    path="./downloads",        # Destination path
    no_title=False,            # If False, automatically appends title + ".mp4"
    return_report=True         # Return a DownloadReport instead of bool
)

report = await video.download(configuration=config)

For full details on download options and setup configurations, see the eaf_base_api Documentation.

⚠️ Error Handling

Source loaders translate request failures into exceptions from beeg_api.modules.errors. Calls that load media expose ordinary loader failures through base_api.MediaLoadError (or MediaLoadErrors for several sources); inspect original_error/errors as shown. Operations outside media loading may still raise package or core exceptions directly.

ExceptionTrigger Cause
NotFoundServer returned HTTP 404 (e.g. video deleted)
NetworkErrorRequest failed due to network parameters
BotDetectionCloudflare challenge block detected
ProxyErrorProxy connection failed
UnknownNetworkErrorUnexpected network errors
DownloadFailedHLS segment download operation failed
python
from base_api import MediaLoadError
from beeg_api.modules.errors import NotFound

try:
    video = await client.get_video(url)
except MediaLoadError as error:
    if isinstance(error.original_error, NotFound):
        print("This video was not found on Beeg!")
    else:
        raise

🖥️ Supported Platforms

PlatformArchitectureStatus
Windows 11x64✅ Tested
macOS Sequoiax86_64✅ Tested
Linux (Arch)x86_64✅ Tested
Android 16aarch64✅ Tested

📜 Changelog

1.7 — August 11, 2026

  • 9eb18ac — Added complete public type hints and the py.typed marker, updated package metadata for 1.7, and reverted the temporary exact-suffix ID parsing change. The current implementation again uses strip("-0").

Changes during August 7–10, 2026

  • 3f3f68d (August 7) — Migrated to eaf_base_api 4: explicit request methods, source-aware media_field("api") loaders, strict loader results, and removal of the v3 compatibility code.
  • 2c0a098 (August 9) — Temporarily changed Beeg ID parsing to remove only the exact "-0" suffix.
  • 41d4443 (August 10) — Merged that temporary ID parsing change; it was subsequently reverted by 9eb18ac.