Skip to main content

Unofficial wrapper for moviebox.ph - search, discover and download movies, tv-series and their subtitles.

Project description

moviebox-api

Unofficial wrapper for moviebox.ph - search, discover and download movies, tv-series and their subtitles.

PyPI version PyPI - Python Version PyPI - License Ruff Hits Downloads

Features

  • Search & download movies, tv-series and their subtitles.
  • Native pydantic modelling of responses
  • Fully asynchronous with synchronous support for major operations

Installation

Run the following command in your terminal:

$ pip install "moviebox-api[cli]"

# For developers
$ pip install moviebox-api

Termux

pip install moviebox-api --no-deps
pip install 'pydantic==2.9.2'
pip install rich click httpx tqdm bs4

Usage

Developers

from moviebox_api import Auto

async def main():
    auto = Auto()
    movie_saved_to, subtitle_saved_to = await auto.run("Avatar")
    print(movie_saved_to, subtitle_saved_to, sep="\n")
    # Output
    # /.../Avatar - 1080P.mp4
    # /.../Avatar - English.srt

if __name__ == "__main__":
    import asyncio

    asyncio.run(main())

Perform download with progress hook

from moviebox_api import Auto

async def callback_function(progress: dict):
    percent = (progress["downloaded_size"] / progress["size"]) * 100

    print(f">>[{percent:.2f}%] Downloading {progress["filename"]}", end="\r")

if __name__=="__main__":
    import asyncio

    auto = Auto(caption_language=None)
    asyncio.run(
        auto.run(
            query="Avatar",
            progress_hook=callback_function,
            progress_bar=False
            )
        )

More Control

Prompt for item confirmation prior to download

Movie
# $ pip install 'moviebox-api[cli]'

from moviebox_api.cli import Downloader

async def main():
    downloader = Downloader()
    movie_path, subtitle_path = await downloader.download_movie("avatar")
    print(movie_path, subtitle_path, sep="\n")

if __name__ == "__main__":
    import asyncio

    asyncio.run(main())
TV-Series
from moviebox_api.cli import Downloader

async def main():
    downloader = Downloader()
    episodes_content_map = await downloader.download_tv_series(
        "Merlin",
        season=1,
        episode=1,
        limit=2,
        # limit=13 # This will download entire 13 episodes of season 1
    )

    print(episodes_content_map)

if __name__ == "__main__":
    import asyncio

    asyncio.run(main())

    # output
    {
      "1": {
        "captions_path" : ["/..S1E1 - english.srt"],
        "movie_path" : "/..S1E1.mp4"
      },
      "2": {
        "captions_path" : ["/..S1E1 - english.srt"],
        "movie_path" : "/..S1E2.mp4"
      }
    }

For more details youn can go through the full documentation

Commandline

# $ python -m moviebox_api --help

Usage: moviebox [OPTIONS] COMMAND [ARGS]...

  Search and download movies/tv-series and their subtitles. envvar-prefix :
  MOVIEBOX

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  download-movie    Search and download movie.
  download-series   Search and download tv series.
  homepage-content  Show contents displayed at landing page
  mirror-hosts      Discover Moviebox mirror hosts [env: MOVIEBOX_API_HOST]
  popular-search    Movies/tv-series many people are searching now

Download Movie

$ python -m moviebox_api download-movie <Movie title>
# e.g python -m moviebox_api download-movie Avatar
# python -m moviebox_api download-movie --help

Usage: moviebox download-movie [OPTIONS] TITLE

  Search and download movie.

Options:
  -y, --year INTEGER              Year filter for the movie to proceed with :
                                  0
  -q, --quality [worst|best|360p|480p|720p|1080p]
                                  Media quality to be downloaded : BEST
  -d, --dir DIRECTORY             Directory for saving the movie to : PWD
  -D, --caption-dir DIRECTORY     Directory for saving the caption file to :
                                  PWD
  -Z, --chunk-size INTEGER RANGE  Chunk-size for downloading files in KB : 512
                                  [1<=x<=10000]
  -m, --mode [start|resume|auto]  Start the download, resume or set
                                  automatically : AUTO
  -c, --colour TEXT               Progress bar display colour : cyan
  -A, --ascii                     Use unicode (smooth blocks) to fill the
                                  progress-bar meter : False
  -x, --language TEXT             Caption language filter : [English]
  -M, --movie-filename-tmpl TEXT  Template for generating movie filename :
                                  [default]
  -C, --caption-filename-tmpl TEXT
                                  Template for generating caption filename :
                                  [default]
  --progress-bar / --no-progress-bar
                                  Display or disable progress-bar : True
  --leave / --no-leave            Keep all leaves of the progressbar : True
  --caption / --no-caption        Download caption file : True
  -O, --caption-only              Download caption file only and ignore movie
                                  : False
  -S, --simple                    Show download percentage and bar only in
                                  progressbar : False
  -T, --test                      Just test if download is possible but do not
                                  actually download : False
  -V, --verbose                   Show more detailed interactive texts : False
  -Q, --quiet                     Disable showing interactive texts on the
                                  progress (logs) : False
  -Y, --yes                       Do not prompt for movie confirmation : False
  -h, --help                      Show this message and exit.

Download Series

$ python -m moviebox_api download-series <Series title> -s <season number> -e <episode number>
# e.g python -m moviebox_api download-series Merlin -s 1 -e 1
# python -m moviebox_api download-series --help

Usage: moviebox download-series [OPTIONS] TITLE

  Search and download tv series.

Options:
  -y, --year INTEGER              Year filter for the series to proceed with :
                                  0
  -s, --season INTEGER RANGE      TV Series season filter  [1<=x<=1000;
                                  required]
  -e, --episode INTEGER RANGE     Episode offset of the tv-series season
                                  [1<=x<=1000; required]
  -l, --limit INTEGER RANGE       Total number of episodes to download in the
                                  season : 1  [1<=x<=1000]
  -q, --quality [worst|best|360p|480p|720p|1080p]
                                  Media quality to be downloaded : BEST
  -x, --language TEXT             Caption language filter : [English]
  -d, --dir DIRECTORY             Directory for saving the series file to :
                                  PWD
  -D, --caption-dir DIRECTORY     Directory for saving the caption file to :
                                  PWD
  -Z, --chunk-size INTEGER RANGE  Chunk-size for downloading files in KB : 512
                                  [1<=x<=10000]
  -m, --mode [start|resume|auto]  Start new download, resume or set
                                  automatically : AUTO
  -E, --episode-filename-tmpl TEXT
                                  Template for generating series episode
                                  filename : [default]
  -C, --caption-filename-tmpl TEXT
                                  Template for generating caption filename :
                                  [default]
  -c, --colour TEXT               Progress bar display color : cyan
  -A, --ascii                     Use unicode (smooth blocks) to fill the
                                  progress-bar meter : False
  --progress-bar / --no-progress-bar
                                  Display or disable progress-bar : True
  --leave / --no-leave            Keep all leaves of the progressbar : True
  --caption / --no-caption        Download caption file : True
  -O, --caption-only              Download caption file only and ignore movie
                                  : False
  -S, --simple                    Show download percentage and bar only in
                                  progressbar : False
  -T, --test                      Just test if download is possible but do not
                                  actually download : False
  -V, --verbose                   Show more detailed interactive texts : False
  -Q, --quiet                     Disable showing interactive texts on the
                                  progress (logs) : False
  -Y, --yes                       Do not prompt for tv-series confirmation :
                                  False
  -h, --help                      Show this message and exit.

Further info

[!TIP] Shorthand for $ python -m moviebox_api is simply $ moviebox

Moviebox.ph has several other mirror hosts, in order to set specific one to be used by the script simply expose it as environment variable using name MOVIEBOX_API_HOST. For instance, in Linux systems one might need to run $ export MOVIEBOX_API_HOST="h5.aoneroom.com"

Disclaimer

"All videos and pictures on MovieBox are from the Internet, and their copyrights belong to the original creators. We only provide webpage services and do not store, record, or upload any content." - moviebox.ph as on Sunday 13th, July 2025

Long live Moviebox spirit.

Made with ❤️

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

moviebox_api-0.1.9.tar.gz (142.6 kB view details)

Uploaded Source

Built Distribution

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

moviebox_api-0.1.9-py3-none-any.whl (46.9 kB view details)

Uploaded Python 3

File details

Details for the file moviebox_api-0.1.9.tar.gz.

File metadata

  • Download URL: moviebox_api-0.1.9.tar.gz
  • Upload date:
  • Size: 142.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.31

File hashes

Hashes for moviebox_api-0.1.9.tar.gz
Algorithm Hash digest
SHA256 4e08f2bb3c28865b73f1ecf25013f5ddcc3b2bbd744922178a882f8310f80429
MD5 feb8226eb122e360c4d12b026751d8bf
BLAKE2b-256 b2e0dda3bb818ed6e2600815dcb72e680fee5d6a4acf4c4ebdb2bf21e686c8ff

See more details on using hashes here.

File details

Details for the file moviebox_api-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for moviebox_api-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 90a58fb2a0e809678a3aca4abc1ea71e95021534822e18b98fb32199df13b57b
MD5 c26df402065c6fbbd0ef2713bacbc0d0
BLAKE2b-256 16e67f6fa9a495dc2bbf45683cd8d84e2d0d7ed252810d625432d39b5e3e2e5c

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