Metadata-Version: 2.5
Name: pyparsebluray
Version: 0.2.0
Summary: Parse and extract binary data from bluray files
Project-URL: Source Code, https://github.com/Ichunjo/pyparsebluray
Author-email: Vardë <ichunjo.le.terrible@gmail.com>
License-File: LICENSE
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# pyparsebluray

Parse and extract binary data from bluray files

# Installation

```
pip install pyparsebluray
```

# Example

Load a whole playlist file at once:

```py
from pyparsebluray import mpls

playlist_file = mpls.load_mpls("/BD-ROM/BDMV/PLAYLIST/00001.mpls")

for play_item in playlist_file.playlist.play_items:
    print(play_item.clip_information_filename, play_item.intime, play_item.outtime)

for mark in playlist_file.playlist_marks.playlist_marks:
    print(mark.mark_timestamp)
```

`load_mpls` also accepts a binary file you have already opened.

Or load each part separately:

```py
import os

from pyparsebluray import mpls

with open("/BD-ROM/BDMV/PLAYLIST/00001.mpls", "rb") as mpls_file:
    print("_____________Header_____________")
    header = mpls.load_movie_playlist(mpls_file)
    print(header)

    print("_____________AppInfo_____________")
    appinfo = mpls.load_app_info_playlist(mpls_file)
    print(appinfo)

    print("_____________Playlist_____________")
    mpls_file.seek(header.playlist_start_address, os.SEEK_SET)
    pls = mpls.load_playlist(mpls_file)
    print(pls)

    print("_____________Playlist Mark_____________")
    mpls_file.seek(header.playlist_mark_start_address, os.SEEK_SET)
    marks = mpls.load_playlist_mark(mpls_file)
    print(marks)

    print("_____________Extension_____________")
    if header.extension_data_start_address != 0:
        mpls_file.seek(header.extension_data_start_address, os.SEEK_SET)
        extension = mpls.load_extention_data(mpls_file)
        print(extension)
```

# TODO

- Add clpi, index table and movie object

# Credits

- [PyGuymer2](https://github.com/Guymer/PyGuymer)
- [PyGuymer3](https://github.com/Guymer/PyGuymer3)
- [lw](https://github.com/lw/BluRay/wiki/ApplicationFormat)
