diff --git a/README.md b/README.md index 93dbcce..d2e4e1c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ # mhl-compare -Written in Python. Work in progress (19 March 2019). - Given two [Media Hash List (MHL) files](https://mediahashlist.org/), this command line utility will compare them and show differences in hash, filenames, directory structure, size and more, of the media files described within them. Useful when comparing two copies of media files that are intended to be the same, but they originate from other sources or were copied at different times. @@ -22,8 +20,9 @@ Additionally, MHL files are small (typically much less than 500 KB) and contain ### Usage +In a Terminal window: ``` -python mhl_compare.py first.mhl second.mhl +./mhl-compare first.mhl second.mhl ``` #### Options @@ -35,7 +34,9 @@ python mhl_compare.py first.mhl second.mhl ### Installation -Work in progress. Download the .py file and try to run it. +* **Download version 0.2** (latest): https://github.com/seb26/mhl-compare/releases/download/v0.1/mhl-compare-v0.2.zip +* Extract the zip +* No installation, you just run the above command in a Terminal window. --- @@ -44,15 +45,16 @@ Work in progress. Download the .py file and try to run it. #### With MHL files Can open any MHL file that is in [the standard XML format for MHL files](https://mediahashlist.org/mhl-specification/). -#### With running the program itself +#### With running the program itself (the regular download) +Only runs on macOS. Tested only on macOS 10.14.3. It is likely to run successfully on older versions though, it's not a very complex program. + +#### With running the program as a Python script Has been tested on Python 3.7.2 on macOS 10.14.3. Written in Python 3, so in its source format, it is not compatible with Python 2 branch, and cannot be run on macOS. Has not been tested on Windows or Linux, but Python is generally pretty functional across OSs. Dependency libraries: [`xmltodict`](https://github.com/martinblech/xmltodict), [`dateutil`](https://dateutil.readthedocs.io/en/stable/), [`humanize`](https://pypi.org/project/humanize/), [`termcolor`](https://pypi.org/project/termcolor/), [`dictdiffer`](https://github.com/hughdbrown/dictdiffer). -*Coming soon*: Executable file that can be downloaded and run on any macOS installation. - --- ### Development goals diff --git a/samples/d01.mhl b/samples/d01.mhl index 7964bc5..1ab4b1a 100644 --- a/samples/d01.mhl +++ b/samples/d01.mhl @@ -1,5 +1,4 @@ - A005 @@ -10,11 +9,27 @@ 2019-03-17T08:32:46 - EOS_DIGITAL/DCIM/100EOS5D/SEB_3046.JPG + file1.jpg 12498349 2019-03-09T10:14:14 2019-03-09T10:14:14 19649bc55e32b83f 2019-03-17T08:32:51 + + file2.jpg + 12498349 + 2019-03-09T10:14:14 + 2019-03-09T10:14:14 + x19649bc55e32b83f + 2019-03-17T08:32:51 + + + file3.jpg + 12498349 + 2019-03-09T10:14:14 + 2019-03-09T10:14:14 + y19649bc55e32b83f + 2019-03-17T08:32:51 + diff --git a/samples/d02.mhl b/samples/d02.mhl index 7964bc5..b08ba42 100644 --- a/samples/d02.mhl +++ b/samples/d02.mhl @@ -1,5 +1,4 @@ - A005 @@ -9,12 +8,4 @@ 2019-03-17T08:32:05 2019-03-17T08:32:46 - - EOS_DIGITAL/DCIM/100EOS5D/SEB_3046.JPG - 12498349 - 2019-03-09T10:14:14 - 2019-03-09T10:14:14 - 19649bc55e32b83f - 2019-03-17T08:32:51 - diff --git a/scraps/sandbox2.py b/scraps/sandbox2.py new file mode 100644 index 0000000..5636e31 --- /dev/null +++ b/scraps/sandbox2.py @@ -0,0 +1,9 @@ +import defusedxml as xml + +handler = xml.sax.handler + +f = open('samples/d01.mhl', 'r') +parsed = sax.parse(f, handler) + +for item in parsed.iter(): + print(item, type(item))