ascmitc / mhl

ASC Media Hash List
MIT License
58 stars 8 forks source link

Issue with ascmhl verify -v /path/to/folder_with_HDE_files_and_asc-mhl_folder/ #132

Closed SiDu1860 closed 2 years ago

SiDu1860 commented 2 years ago

Do:

Happen:

check folder at path: /Volumes/dws/220829_ALEXA_35_SUP_1-0-3_4_Offical_Sample_Footage_Sean_Dooley/02_original_footage/04_ARRIRAW_HDE Traceback (most recent call last): File "/usr/local/bin/ascmhl-debug", line 8, in sys.exit(mhldebugtool_cli()) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 829, in call return self.main(args, kwargs) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 610, in invoke return callback(args, **kwargs) File "/usr/local/lib/python3.10/site-packages/ascmhl/commands.py", line 480, in verify verify_entire_folder(root_path, verbose, single_file, None, ignore_list, ignore_spec_file) File "/usr/local/lib/python3.10/site-packages/ascmhl/commands.py", line 511, in verify_entire_folder existing_history = MHLHistory.load_from_path(root_path) File "/usr/local/lib/python3.10/site-packages/ascmhl/history.py", line 245, in load_from_path history._find_and_load_child_histories() File "/usr/local/lib/python3.10/site-packages/ascmhl/history.py", line 295, in _find_and_load_child_histories child_history = MHLHistory.load_from_path(root) File "/usr/local/lib/python3.10/site-packages/ascmhl/history.py", line 230, in load_from_path hash_list = hashlist_xml_parser.parse(file_path) File "/usr/local/lib/python3.10/site-packages/ascmhl/hashlist_xml_parser.py", line 101, in parse current_object.tool = MHLTool(element.text, element.attrib["version"]) File "src/lxml/etree.pyx", line 2496, in lxml.etree._Attrib.getitem KeyError: 'version'

Should:

Info: macOS Monterey 12.5.1 Intel MacBookPro 2019

ptrpfn commented 2 years ago

Can you append a sample ASC MHL folder where this happens? Or a link to the the ARRIRAW HDE Transcoder version you are using?

Also worth noting: You can also check the validity of ASC MHL files with the command ascmhl-debug xsd-schema-check /path/to/ascmhl/XXXXX.mhl to check if the ASC MHL file is valid against the ASC MHL XSD schema.

SiDu1860 commented 2 years ago

ARRIRAW HDE Transcoder Version 1.0.0.10151 (latest downloader from ARRI Website)

Here's a screenshot of folder structure:

Bildschirmfoto 2022-09-06 um 11 45 03

Here's the file (in a zip): 220830_102152_220830_102141_A_000112SQ.mhl.zip

SiDu1860 commented 2 years ago

ascmhl-debug xsd-schema-check

Also worth noting: You can also check the validity of ASC MHL files with the command ascmhl-debug xsd-schema-check /path/to/ascmhl/XXXXX.mhl to check if the ASC MHL file is valid against the ASC MHL XSD schema.

ends up with:

Traceback (most recent call last): File "/usr/local/bin/ascmhl-debug", line 8, in sys.exit(mhldebugtool_cli()) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 829, in call return self.main(args, kwargs) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 610, in invoke return callback(args, kwargs) File "/usr/local/lib/python3.10/site-packages/ascmhl/commands.py", line 1300, in xsd_schema_check xsd = etree.XMLSchema(etree.parse(xsd_path)) File "src/lxml/etree.pyx", line 3538, in lxml.etree.parse File "src/lxml/parser.pxi", line 1876, in lxml.etree._parseDocument File "src/lxml/parser.pxi", line 1902, in lxml.etree._parseDocumentFromURL File "src/lxml/parser.pxi", line 1805, in lxml.etree._parseDocFromFile File "src/lxml/parser.pxi", line 1177, in lxml.etree._BaseParser._parseDocFromFile File "src/lxml/parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc File "src/lxml/parser.pxi", line 725, in lxml.etree._handleParseResult File "src/lxml/parser.pxi", line 652, in lxml.etree._raiseParseError OSError: Error reading file 'xsd/ASCMHL.xsd': failed to load external entity "xsd/ASCMHL.xsd"**

ptrpfn commented 2 years ago

The xsd-schema-check command must be run from a directory with a xsd subfolder where the ASC MHL xsd files are located (for example it can be run from the root folder of the ASC MHL git repository). Alternatively you can pass the local path to the XSD file (available here) with the -xsd or --xsd_file option.

ptrpfn commented 2 years ago

The initial issue should be fixed with release v0.9.3 (released just now). Please give it a try.

SiDu1860 commented 2 years ago

@ptrpfn confirm to be fixed in v0.9.3.

note: the check found some of these 'hidden' _. mac files. just for information.

found new file ._.DS_Store name of ascmhl file ._220830_102152_220830_102141_A_000112SQ.mhl does not conform to naming convention

The check itself works perfectly. Thanks @ptrpfn

ptrpfn commented 2 years ago

@ptrpfn confirm to be fixed in v0.9.3.

The check itself works perfectly. Thanks @ptrpfn

Great, thank you for confirming!

ptrpfn commented 2 years ago

note: the check found some of these 'hidden' _. mac files. just for information.

found new file ._.DS_Store name of ascmhl file ._220830_102152_220830_102141_A_000112SQ.mhl does not conform to naming convention

Please note that there is an "ignore pattern" feature in ASC MHL. (see https://cms-assets.theasc.com/ASCMHL_Specification_v1.0.pdf → "5.6.1.2. Ignore Semantic" for details).

A default ignore pattern in the ASC MHL could look like this:

    <ignore>
      <pattern>.DS_Store</pattern>
    </ignore>

... which would avoid that message you experienced. The ascmhl tool also adds such ignore patterns by default.