Python wrapper for VideoLAN's libdvdcss.
Project description
pydvdcss is a Python wrapper for VideoLAN's libdvdcss.
libdvdcss is a simple library designed for accessing DVDs like a block device without having to bother about the decryption.
Features
- Portability — Supported platforms include GNU/Linux, FreeBSD, NetBSD, OpenBSD, Haiku, macOS, Solaris, QNX, OS/2, and Windows NT 4.0 SP4 (with IE 5.0) or later.
- Simplicity — A DVD player can be built around the libdvdcss API using no more than 4 or 5 library calls.
- Freedom — libdvdcss is released under the GPL, ensuring it stays free and is used only for free software.
- Adaptability — Unlike most similar projects, libdvdcss does not require the region of your drive to be set, and will try its best to read from the disc even in the case of a region mismatch.
Installation
pip install pydvdcss
pydvdcss is a wrapper, so it needs the native libdvdcss library too:
- Windows: nothing to do — the Windows wheels bundle
libdvdcss-2.dll, sopip install pydvdcssis all you need. (If you install the source distribution instead, drop alibdvdcss-2.dllnext to your script, in the current working directory, or inC:/Windows/System32; pre-built DLLs: https://github.com/allienx/libdvdcss-dll.) - Linux: install it from your distribution's repositories (e.g.
libdvdcss2). - macOS:
brew install libdvdcss.
pydvdcss looks for the library bundled inside the package first, then falls back to a system-installed copy.
Bundled libdvdcss
The Windows wheels include a precompiled libdvdcss-2.dll (© VideoLAN, GPL-2.0-or-later)
taken unmodified from https://github.com/allienx/libdvdcss-dll and verified by SHA-256 at
build time. The pure wheel and source distribution do not bundle it. See
THIRD-PARTY-NOTICES.md
for attribution, license, and the GPL written offer for source.
Usage
from pydvdcss import DvdCss
with DvdCss() as dvd:
dvd.open("D:") # a device ("D:", "/dev/sr0"), an ISO file, or a VIDEO_TS directory
print(dvd.is_scrambled) # True if the disc is CSS-protected
dvd.seek(16) # seek to the Primary Volume Descriptor
data = dvd.read(1) # read 1 logical block (2048 bytes), returned as bytes
print(data[40:72]) # e.g. b'SPONGEBOB_SQUAREPANTS_D1\x00\x00...'
To descramble CSS-protected VOB data, seek to the start of each title with SeekFlag.SEEK_KEY to obtain its title
key, then read the sectors with ReadFlag.READ_DECRYPT. See the docstrings on DvdCss and its methods for the full
API, including seek(), read(), readv(), and open_stream().
Development
This project is managed using uv, an extremely fast Python package and project manager. Install the latest version of uv before continuing. Development currently requires Python 3.10+.
Set up
Starting from Zero? Not sure where to begin? Here's steps on setting up this Python project using uv. Note that uv installation instructions should be followed from the uv Docs: https://docs.astral.sh/uv/getting-started/installation
-
Clone the Repository:
git clone https://github.com/homemediadb/pydvdcss cd pydvdcss
-
Install the Project with uv:
uv sync --all-groups
This creates a Virtual environment at
.venvand then installs all project dependencies into the Virtual environment. Your System Python environment is not affected at all. -
Now activate the Virtual environment:
.venv\Scripts\activate
(or
source .venv/bin/activateon macOS and Linux)Note:
- You can alternatively just prefix
uv runto any command you wish to run under the Virtual environment. - I recommend entering the Virtual environment and all further instructions will have assumed you did.
- JetBrains PyCharm and Visual Studio Code both detect the
.venvVirtual environment automatically. - For more information, see: https://docs.astral.sh/uv/concepts/projects/
- You can alternatively just prefix
-
Install Pre-commit tooling to ensure safe and quality commits:
uv tool install pre-commit --with pre-commit-uv --force-reinstall pre-commit install
Now feel free to work on the project however you like, all code will be checked before committing.
Building Source and Wheel distributions
uv build
You can optionally specify --sdist or --wheel to build that distribution only.
Built files can be found in the /dist directory.
License
This project is licensed under the terms of the GNU General Public License, Version 3.0.
© rlaphoenix 2020-2026
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydvdcss-1.5.0.tar.gz.
File metadata
- Download URL: pydvdcss-1.5.0.tar.gz
- Upload date:
- Size: 31.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f5c9e661242ab01d6371c5a3f87c7312bcd39ac51b040bedcaa80045f846927
|
|
| MD5 |
c08d53fdedafca4e454b2e1bd879e5d8
|
|
| BLAKE2b-256 |
4712632a2afec1c7980021e0588f389e9be0a04747bb13aa261f7908c54b5434
|
File details
Details for the file pydvdcss-1.5.0-py3-none-win_amd64.whl.
File metadata
- Download URL: pydvdcss-1.5.0-py3-none-win_amd64.whl
- Upload date:
- Size: 139.9 kB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e03c28b25c01d02d00cae2fd666514b550a2379d655380227c71b3648ab751f
|
|
| MD5 |
70ae8f9289bfd0f061e66eb0511acd3f
|
|
| BLAKE2b-256 |
deaadefc107441ccc31d5aab6cdc9a3968479fbafb7cffba243ffcfe05698055
|
File details
Details for the file pydvdcss-1.5.0-py3-none-win32.whl.
File metadata
- Download URL: pydvdcss-1.5.0-py3-none-win32.whl
- Upload date:
- Size: 133.5 kB
- Tags: Python 3, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5373c92b8e5c1f9b073210ae717a25998860bf5639403fadc645f1e3f7e96b18
|
|
| MD5 |
b6a12e34c25d74c7fcb29744bad033e7
|
|
| BLAKE2b-256 |
e3b92a6ae50b96b75cf7a134e2fbdd6d6a760e980c2442bc0c131edceeafda47
|
File details
Details for the file pydvdcss-1.5.0-py3-none-any.whl.
File metadata
- Download URL: pydvdcss-1.5.0-py3-none-any.whl
- Upload date:
- Size: 26.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
834ef0de5044801adda3f21c3702c846c11ac4c25717329c9a8dad938b91ab19
|
|
| MD5 |
6ab7d8052a9f256fcc39049cc3b16a77
|
|
| BLAKE2b-256 |
f02046a5b9683264d581de23a99ceff90ad600b186a332854601e6443f00ea36
|