sheldonkwoodward/pymkv

Attachments are not showing up properly

Opened this issue ยท 0 comments

I've got an mkv file with a number of attachments that show up when running mkvmerge manually, but they aren't showing up when using MKVFile.attachments:

sub-extractor on ๎‚  master [?] is ๐Ÿ“ฆ v0.1.0 via ๐Ÿ v3.8.6 
โฏ poetry run sub-extractor --dir . --clear
{'_track_codec': 'MPEG-4p10/AVC/H.264', '_track_type': 'video', 'mkvmerge_path': 'mkvmerge', '_file_path': 'test.mkv', '_track_id': 0, 'track_name': None, '_language': 'eng', '_tags': None, 'default_track': True, 'forced_track': False, 'no_chapters': False, 'no_global_tags': False, 'no_track_tags': False, 'no_attachments': False}
{'_track_codec': 'AAC', '_track_type': 'audio', 'mkvmerge_path': 'mkvmerge', '_file_path': 'test.mkv', '_track_id': 1, 'track_name': None, '_language': 'jpn', '_tags': None, 'default_track': True, 'forced_track': False, 'no_chapters': False, 'no_global_tags': False, 'no_track_tags': False, 'no_attachments': False}
{'_track_codec': 'SubStationAlpha', '_track_type': 'subtitles', 'mkvmerge_path': 'mkvmerge', '_file_path': 'test.mkv', '_track_id': 2, 'track_name': None, '_language': 'eng', '_tags': None, 'default_track': True, 'forced_track': False, 'no_chapters': False, 'no_global_tags': False, 'no_track_tags': False, 'no_attachments': False}

0

sub-extractor on ๎‚  master [?] is ๐Ÿ“ฆ v0.1.0 via ๐Ÿ v3.8.6 
โฏ mkvmerge -i test.mkv                                                      
File 'test.mkv': container: Matroska
Track ID 0: video (MPEG-4p10/AVC/H.264)
Track ID 1: audio (AAC)
Track ID 2: subtitles (SubStationAlpha)
Attachment ID 1: type 'application/x-truetype-font', size 170160 bytes, file name 'KGHAPPY.ttf'
Attachment ID 2: type 'application/x-truetype-font', size 62536 bytes, file name 'LT_C.ttf'
Attachment ID 3: type 'application/x-truetype-font', size 62480 bytes, file name 'LTFinnegan_MediumItalic_0.ttf'
Attachment ID 4: type 'application/x-truetype-font', size 116172 bytes, file name 'Mermaid1001.ttf'
Attachment ID 5: type 'application/x-truetype-font', size 50348 bytes, file name 'Polo Brush.ttf'
Attachment ID 6: type 'application/x-truetype-font', size 20728 bytes, file name 'Scratch.ttf'
Attachment ID 7: type 'application/x-truetype-font', size 36452 bytes, file name 'SetFireToTheRain.ttf'
Attachment ID 8: type 'application/x-truetype-font', size 53968 bytes, file name 'Arial Rounded MT.ttf'
Attachment ID 9: type 'application/x-truetype-font', size 57808 bytes, file name 'Folder_Bold.ttf'
Attachment ID 10: type 'application/vnd.ms-opentype', size 17028 bytes, file name 'FOTCometStdStripped-Bold_0.otf'
Attachment ID 11: type 'application/x-truetype-font', size 152700 bytes, file name 'FRABK.TTF'
Attachment ID 12: type 'application/x-truetype-font', size 142932 bytes, file name 'FRADM.TTF'
Attachment ID 13: type 'application/x-truetype-font', size 139332 bytes, file name 'framd_0.ttf'
Attachment ID 14: type 'application/x-truetype-font', size 42108 bytes, file name 'GOTH720K.TTF'
Attachment ID 15: type 'application/x-truetype-font', size 67056 bytes, file name 'Janetta Silloam.otf'
Chapters: 6 entries

Here's the function that was being called:

def extract_subs_and_fonts(
    mkv_file: Path,
    mkv_dir: Path,
):
    mkv_obj = MKVFile(mkv_file)
    for track in mkv_obj.tracks:
        print(track)
    print()
    print(len(mkv_obj.attachments))