Watch
1
Fork
You've already forked megakino-python
0
0

Latest commit

WildesBenny
bb8504b 2026-05-29 10:25:34 +02:00 3 commits
2026-04-26 23:23:03 +02:00
2026-04-26 23:23:03 +02:00
2026-04-26 23:23:03 +02:00

megakino-python

Unofficial Python client for the MegaKino streaming platform.

Scrapes feeds, searches, retrieves detail pages, and resolves direct video stream URLs for downloading.

Installation

pip install megakino-python

Or install from source:

git clone https://github.com/your-username/megakino-python.git
cd megakino-python
pip install -e .

Requirements: Python ≥ 3.9, requests, beautifulsoup4

For downloading videos, yt-dlp is also required:

pip install yt-dlp

Quick Start

import megakino

# Browse feeds
home     = megakino.feed.home()          # HomeFeedResult
films    = megakino.feed.films()         # FeedResult
serials  = megakino.feed.serials()       # FeedResult
docs     = megakino.feed.documentary()   # FeedResult

# Search
results = megakino.search("galaxy")
for item in results.items:
    print(item.title, item.year, item.url)

# Detail page
detail = megakino.get_details("/films/6160-der-super-mario-galaxy-film.html")
print(detail.title, detail.year, detail.duration_minutes)
for stream in detail.streams:
    print(stream.hoster, stream.url)

# Serial episodes
detail = megakino.get_details("/serials/6162-the-boys-5-staffel.html")
for ep in detail.episodes:
    print(f"Ep {ep.number}: {ep.title}")
    for stream in ep.streams:
        print(f"  [{stream.hoster}] {stream.url}")

Resolving Direct Stream URLs

# Resolve a direct HLS/MP4 URL from an embed page
info = megakino.get_download_url(
    "/films/6160-der-super-mario-galaxy-film.html",
    hoster="voe",      # optional: prefer a specific hoster
)
print(info.direct_url)    # https://...cloudwindow-route.com/engine/hls2/...master.m3u8
print(info.quality_options)  # ['720p', '480p', '240p'] (gxplayer only)

# For serials, pass episode number
info = megakino.get_download_url(
    "/serials/6162-the-boys-5-staffel.html",
    episode=1,
)
print(info.direct_url)

get_download_url returns a DownloadInfo dataclass:

Field Type Description
hoster str Hoster name (e.g. "Voe", "Stream in HD")
embed_url str Original embed URL from the MegaKino page
direct_url str | None Resolved HLS/MP4 URL; None if not extractable
quality_options List[str] Available quality labels (e.g. ["720p", "480p"])
title str Film or serial title
episode int | None Episode number, or None for films

Downloading Videos

Requires yt-dlp to be installed.

# Download a film
megakino.download(
    "/films/6160-der-super-mario-galaxy-film.html",
    path="/tmp/mario.mp4",
    hoster="gxplayer",   # optional
    quality="720p",      # optional, default: best
)

# Download a serial episode
megakino.download(
    "/serials/6162-the-boys-5-staffel.html",
    path="/tmp/boys_s05e01.mp4",
    episode=1,
)

Supported Hosters

Hoster Direct URL Quality options
voe.sx ✅ —
gxplayer ✅ ✅ 240p–720p

API Reference

megakino.feed

Function Returns
feed.home() HomeFeedResult
feed.films() FeedResult
feed.serials() FeedResult
feed.documentary() FeedResult

Top-level functions

Function Returns
search(query) SearchResult
get_details(url) DetailResult
get_download_url(url, episode=None, hoster=None) DownloadInfo
download(url, path, episode=None, hoster=None, quality=None) None

Disclaimer

This library is for personal, educational use only. Respect the terms of service of the website and applicable copyright law.