mx-dlp
v0.3.0
Published
Premium MX Player downloader and streamer CLI for npm global installs
Maintainers
Readme
mx-dlp
mx-dlp is a terminal-first MX Player downloader, streamer, and catalog indexer with a polished CLI, search flow, and packaging built for real-world installation.
Install
Runtime requirements
- Python 3.10+
mpvfor the best--streamexperiencevlcplusffmpegif you want VLC-based streaming
Recommended: global install with pipx
pipx install mx-dlp
mx-dlp --helpTo install directly from source:
pipx install .
mx-dlp --search "cricket"Standard Python install
python3 -m pip install mx-dlp
mx-dlp --helpnpm global install
npm install -g mx-dlp
mx-dlp --helpNote:
- the npm package runs the Python CLI from this project
- Python 3 must be installed on the machine for the npm package to work
- if you want no Python dependency, use the standalone binary release instead
Use in a Node.js project
Install inside your Node.js app:
npm install mx-dlpThen call the CLI from your Node code with child_process.
Simple example:
import { execSync } from "node:child_process";
execSync('npx mx-dlp --search "cricket" --number 5', {
stdio: "inherit",
});Recommended example with spawn:
import { spawn } from "node:child_process";
const child = spawn("npx", ["mx-dlp", "--search", "cricket", "--number", "5"], {
stdio: "inherit",
shell: process.platform === "win32",
});
child.on("close", (code) => {
console.log(`mx-dlp finished with code ${code}`);
});Download a stream URL from Node.js:
import { spawn } from "node:child_process";
const mxdlp = spawn(
"npx",
[
"mx-dlp",
"--url",
"https://www.mxplayer.in/movie/watch-varisu-hindi-movie-online-04c78559cceaaa49ec1ce2764a5cd331",
"--quality",
"720p",
],
{
stdio: "inherit",
shell: process.platform === "win32",
},
);
mxdlp.on("close", (code) => {
console.log(`download finished with code ${code}`);
});Stream directly in mpv from Node.js:
import { spawn } from "node:child_process";
const mxdlp = spawn(
"npx",
["mx-dlp", "--search", "aashram", "--first", "--stream", "--player", "mpv"],
{
stdio: "inherit",
shell: process.platform === "win32",
},
);
mxdlp.on("close", (code) => {
console.log(`stream finished with code ${code}`);
});Important notes for Node.js users:
mx-dlpis a CLI tool, not a native JavaScript SDK- in Node.js projects, the normal pattern is to run it with
npx mx-dlp ...or the installed binary - the npm package currently requires Python 3 on the machine
- output files are written to the current working directory unless you run the command from another folder
Run as a module
python3 -m mxdlp --search "cricket"Features
- Global CLI entrypoint:
mx-dlp - Download mode plus external-player streaming mode
- Player integration for
mpvandvlc - Backend engine for MX landing pages such as
web-series,movies,new-release, andlist - Modern
pyproject.tomlpackaging - PyPI-ready metadata
pipx-friendly install flow- Standalone binary build path with PyInstaller
Usage
mx-dlp --search "cricket"
mx-dlp --search "pushpa" --number 10
mx-dlp --search "aashram" --first --quality 720p
mx-dlp --url "https://www.mxplayer.in/movie/watch-..." --quality 1080p
mx-dlp --backend --number 10
mx-dlp --catalog "https://www.mxplayer.in/web-series,https://www.mxplayer.in/movies"
mx-dlp --url "https://www.mxplayer.in/web-series"
mx-dlp --search "aashram" --first --stream
mx-dlp --url "https://www.mxplayer.in/movie/watch-..." --stream --player mpv --player-arg=--fullscreenModes
--searchqueries MX search and prints matching titles--backendindexes the built-in MX landing pages:web-series,movies,new-release, andlist--catalogindexes one or more custom MX landing page URLs--urlaccepts either a title URL or a catalog URL and auto-detects the correct flow--firstimmediately hands the first result to download or streaming mode
Backend Engine
Use the backend engine when you want mx-dlp to ingest MX landing pages and surface the playable titles behind them.
Built-in backend sources:
https://www.mxplayer.in/web-serieshttps://www.mxplayer.in/movieshttps://www.mxplayer.in/new-releasehttps://www.mxplayer.in/list
Examples:
mx-dlp --backend
mx-dlp --backend --number 20
mx-dlp --backend --first --stream
mx-dlp --catalog "https://www.mxplayer.in/web-series,https://www.mxplayer.in/movies"
mx-dlp --url "https://www.mxplayer.in/web-series"Notes:
--backendindexes the built-in MX landing pages above--catalogaccepts one or more comma-separated MX landing page URLs- if
--urlpoints at a landing page instead of a title page,mx-dlpautomatically switches to backend indexing mode --firstworks here too, so you can index a backend source and immediately stream or download the first playable title- result cards include the backend source page so you can see where each title came from
Streaming
Use --stream when you want a yt-dlp-style "open in player now" flow instead of writing an .mp4 file first.
Examples:
mx-dlp --url "https://www.mxplayer.in/movie/watch-..." --stream
mx-dlp --url "https://www.mxplayer.in/movie/watch-..." --stream --player mpv
mx-dlp --url "https://www.mxplayer.in/movie/watch-..." --stream --player vlc
mx-dlp --search "aashram" --first --stream --player-arg=--fullscreenNotes:
--player autoprefersmpvvlcstreaming uses anffmpegbridge so MX headers are preserved across DASH playback- repeat
--player-argto pass extra options straight to your player - use
--player-path /path/to/playerif the executable is not on yourPATH - if the requested quality is unavailable,
mx-dlpfalls back to the best available stream and prints the fallback it chose
Use In Any Project
You can use mx-dlp in other projects in two simple ways:
- call the global CLI from your app, script, or backend job
- import the Python modules directly inside your code
1. Use the global CLI from any project
Install once:
pipx install mx-dlpOr with npm:
npm install -g mx-dlpThen call it from any folder on your machine:
mx-dlp --search "cricket"
mx-dlp --url "https://www.mxplayer.in/movie/watch-..." --quality 720p
mx-dlp --backend --number 10Example in a shell script:
#!/usr/bin/env bash
set -e
mx-dlp --search "aashram" --first --quality 720pExample in Node.js:
import { execSync } from "node:child_process";
execSync('mx-dlp --search "cricket" --number 5', {
stdio: "inherit",
});Example in Python with subprocess:
import subprocess
subprocess.run(
["mx-dlp", "--search", "cricket", "--number", "5"],
check=True,
)Example indexing backend sources from a Python app:
import subprocess
subprocess.run(
["mx-dlp", "--backend", "--number", "10"],
check=True,
)2. Use mx-dlp as a Python package in your project
Install it in your app environment:
python3 -m pip install mx-dlpSearch titles programmatically:
from mxdlp.services.search import MXSearch
results = MXSearch("cricket").fetch()
for item in results[:5]:
print(item["title"], item["url"])Index backend landing pages programmatically:
from mxdlp.services.catalog import MXCatalogEngine
results = MXCatalogEngine.backend().fetch()
for item in results[:10]:
print(item["title"], item["url"], item.get("source"))Download from a known MX Player URL:
from mxdlp.core.pipeline import Pipeline
Pipeline(
"https://www.mxplayer.in/movie/watch-varisu-hindi-movie-online-04c78559cceaaa49ec1ce2764a5cd331",
"720p",
).run()Search first, then download inside your own project flow:
from mxdlp.core.pipeline import Pipeline
from mxdlp.services.search import MXSearch
results = MXSearch("aashram").fetch()
if results:
Pipeline(results[0]["url"], "720p").run()Search first, then stream in mpv inside your own project flow:
from mxdlp.core.pipeline import Pipeline
from mxdlp.services.search import MXSearch
results = MXSearch("aashram").fetch()
if results:
Pipeline(results[0]["url"], "720p", stream=True, player="mpv").run()Output behavior
--searchprints MX Player results in the terminal--backendand--catalogprint title results extracted from MX landing pages--firstautomatically picks the first result and starts the download or streaming flow--streamlaunches an external player instead of writing a local media file- title URLs passed to
--urlgo straight into resolution, while catalog URLs passed to--urlswitch to indexing mode automatically - downloads are currently written as
<quality>.mp4in the current working directory
So if you run:
mx-dlp --url "https://www.mxplayer.in/movie/watch-..." --quality 720pThe file will be created in your current folder as:
720p.mp4Development
Install editable mode:
python3 -m pip install -e .Build wheel and source distribution:
python3 -m pip install build
python3 -m buildOr with pip only:
python3 -m pip wheel --no-deps --no-build-isolation . -w distPublish To PyPI
- Bump the version in
mxdlp/__init__.py - Build distributions
python3 -m pip install build twine
python3 -m build
python3 -m twine check dist/*
python3 -m twine upload dist/*After publishing:
pipx install mx-dlpPublish To npm
- Make sure
package.jsonversion matchesmxdlp/__init__.py - Log in to npm
- Publish the package
npm login
npm publish --access publicAfter publishing:
npm install -g mx-dlpStandalone Binary
Build a single-file executable with no Python required on the target machine:
python3 -m pip install ".[binary]"
./scripts/build-binary.shOutput:
- Linux/macOS:
dist/mx-dlp - Windows:
dist/mx-dlp.exe
Release Automation
The repository includes a GitHub Actions workflow that can:
- build wheels and sdists
- publish to PyPI on tagged releases
- publish the npm package on tagged releases
- attach standalone binaries to a GitHub release
Tag example:
git tag v0.3.0
git push origin v0.3.0