Skip to content

Commit

Permalink
- Readme updated for v0.2 and the new executable file
Browse files Browse the repository at this point in the history
- More samples
- Working with pure XML in the sandbox
  • Loading branch information
seb26 committed Mar 23, 2019
1 parent eefeeab commit ccc5543
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 18 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Expand All @@ -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.

---

Expand All @@ -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
Expand Down
19 changes: 17 additions & 2 deletions samples/d01.mhl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Includes a subfolder at the beginning -->
<hashlist version="1.1">
<creatorinfo>
<name>A005</name>
Expand All @@ -10,11 +9,27 @@
<finishdate>2019-03-17T08:32:46</finishdate>
</creatorinfo>
<hash>
<file>EOS_DIGITAL/DCIM/100EOS5D/SEB_3046.JPG</file>
<file>file1.jpg</file>
<size>12498349</size>
<creationdate>2019-03-09T10:14:14</creationdate>
<lastmodificationdate>2019-03-09T10:14:14</lastmodificationdate>
<xxhash64be>19649bc55e32b83f</xxhash64be>
<hashdate>2019-03-17T08:32:51</hashdate>
</hash>
<hash>
<file>file2.jpg</file>
<size>12498349</size>
<creationdate>2019-03-09T10:14:14</creationdate>
<lastmodificationdate>2019-03-09T10:14:14</lastmodificationdate>
<xxhash64be>x19649bc55e32b83f</xxhash64be>
<hashdate>2019-03-17T08:32:51</hashdate>
</hash>
<hash>
<file>file3.jpg</file>
<size>12498349</size>
<creationdate>2019-03-09T10:14:14</creationdate>
<lastmodificationdate>2019-03-09T10:14:14</lastmodificationdate>
<xxhash64be>y19649bc55e32b83f</xxhash64be>
<hashdate>2019-03-17T08:32:51</hashdate>
</hash>
</hashlist>
9 changes: 0 additions & 9 deletions samples/d02.mhl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Includes a subfolder at the beginning -->
<hashlist version="1.1">
<creatorinfo>
<name>A005</name>
Expand All @@ -9,12 +8,4 @@
<startdate>2019-03-17T08:32:05</startdate>
<finishdate>2019-03-17T08:32:46</finishdate>
</creatorinfo>
<hash>
<file>EOS_DIGITAL/DCIM/100EOS5D/SEB_3046.JPG</file>
<size>12498349</size>
<creationdate>2019-03-09T10:14:14</creationdate>
<lastmodificationdate>2019-03-09T10:14:14</lastmodificationdate>
<xxhash64be>19649bc55e32b83f</xxhash64be>
<hashdate>2019-03-17T08:32:51</hashdate>
</hash>
</hashlist>
9 changes: 9 additions & 0 deletions scraps/sandbox2.py
Original file line number Diff line number Diff line change
@@ -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))

0 comments on commit ccc5543

Please sign in to comment.