meta4ra -- Metalink4 utilities

meta4ra-create utility is used to create Metalink4
(https://datatracker.ietf.org/doc/html/rfc5854)
.meta4-file for single specified file.

meta4ra-list utility is used to list files in .meta4 file, get its size,
list its URLs in "pri|cc|URL" format, extract signatures.

meta4ra-check utility is used verify corresponding files integrity.

meta4ra-dl utility can be used to download specified URL.

meta4ra-hash utility can be used to hash the data with a single hash
algorithm. It could be useful if you want to use the best found
algorithm on current system, whatever it is.

Example attempt to download .meta4's file from Russia-based location as
most preferred, with fallback to Europe continent, leaving location-less
next, randomising remaining:

    fn=$(meta4ra-list .meta4 | head -1)
    size=$(meta4ra-list -size .meta4 $fn)
    meta4ra-list .meta4 $fn |
    urls-sort ru c:eu "" rand |
    while read url ; do
        meta4ra-dl -size $size -progress "$url" |
        meta4ra-check -pipe .meta4 $fn >$fn || {
            rm $fn
            continue
        }
        break
    done
    [ -s $fn ]

urls-sort is taken from BASS project (http://www.bass.cypherpunks.su/).

meta4ra is copylefted free software: see the file COPYING for copying
conditions. It should work on all POSIX-compatible systems.

You can select desired fields by ordinary XML-related utulities:
    xml sel -t -m "/_:metalink/_:file/_:url" -v . -nl data.meta4
