git @ Cat's Eye Technologies yastasoti / 0.1

Tree @0.1 (Download .tar.gz)


Version 0.1

Yet another script to archive stuff off teh internets.

It's not a spider that automatically crawls previously undiscovered webpages — it's intended to be run by a human to make backups of resources they have already seen and recorded the URLs of.

It was split off from Feedmark, which doesn't itself need to support this function.



feedmark --output-links article/*.md | yastasoti --article-root=article/ - | tee results.json

This will make only HEAD requests to check that the resources exist. It will not fetch them. The ones that could not be fetches will appear in results.json, and you can run yastasoti on that again to re-try:

yastasoti --article-root=article/ results.json | tee results2.json

Archive stuff off teh internets

cat >links.json << EOF
        "url": ""
yastasoti --archive-to=downloads links.json

Categorize archived materials with a router

An archive router (used with --archive-via) is a JSON file that looks like this:

    "*": "/dev/null",
    "*": "footube/",
    "*": "archive/"

If a URL matches more than one pattern, the longest pattern will be selected. If the destination is /dev/null it will be treated specially — the file will not be retrieved at all. If no pattern matches, an error will be raised.

To use an archive router once it has been written:

yastasoti --archive-via=router.json links.json


Tested under Python 2.7.12. Seems to work under Python 3.5.2 as well, but this is not so official.

Requires requests Python library to make network requests. Tested with requests version 2.17.3.

If tqdm Python library is installed, will display a nice progress bar.