diff options
author | Bryan Newbold <bnewbold@archive.org> | 2019-08-09 16:57:52 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2019-08-09 16:57:52 -0700 |
commit | db711e1ac9e4b8ba8c9d5229bf310e89ffc27a47 (patch) | |
tree | d977dfee48cfd947aec3c424733aebe74646d25e /postgresql/petabox_transform.py | |
parent | 9e4657d49dd91f1249042865505d1a9ea8ad2ea6 (diff) | |
download | sandcrawler-db711e1ac9e4b8ba8c9d5229bf310e89ffc27a47.tar.gz sandcrawler-db711e1ac9e4b8ba8c9d5229bf310e89ffc27a47.zip |
move postgres/rest directory
Diffstat (limited to 'postgresql/petabox_transform.py')
-rwxr-xr-x | postgresql/petabox_transform.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/postgresql/petabox_transform.py b/postgresql/petabox_transform.py deleted file mode 100755 index b638911..0000000 --- a/postgresql/petabox_transform.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python3 - -import json, sys, os - -for l in sys.stdin.readlines(): - l = l.strip() - if not l: - continue - r = json.loads(l) - if not r['sha1']: - continue - sha1hex = r['sha1'] - for url in r['urls']: - u = url['url'] - if not '//archive.org/' in u: - continue - u = u.split('/') - if u[2] == 'web.archive.org': - continue - #print(u) - assert u[2] == 'archive.org' and u[3] in ('download', 'serve') - item = u[4] - path = '/'.join(u[5:]) - print("\t".join([item, path, sha1hex])) |