32 lines
845 B
Plaintext
32 lines
845 B
Plaintext
|
#!/usr/bin/env python3
|
||
|
#
|
||
|
# wut-ia-torrents --- Download SatNOGS torrents from the Internet Archive.
|
||
|
#
|
||
|
# https://archive.org/details/satnogs
|
||
|
|
||
|
from internetarchive import get_item
|
||
|
from internetarchive import get_session
|
||
|
from internetarchive import download
|
||
|
from internetarchive import search_items
|
||
|
import time
|
||
|
|
||
|
# Download dir
|
||
|
obs_dl='/srv/dl'
|
||
|
|
||
|
s = get_session()
|
||
|
s.mount_http_adapter()
|
||
|
search_results = s.search_items('satnogs-observations')
|
||
|
for i in search_items('identifier:satnogs-observations-*'):
|
||
|
obs_id=(i['identifier'])
|
||
|
print('Collection', obs_id)
|
||
|
download(obs_id, verbose=True, glob_pattern='*.torrent',
|
||
|
checksum=True, destdir=obs_dl,
|
||
|
retries=4, ignore_errors=True)
|
||
|
|
||
|
download(obs_id, verbose=True, glob_pattern='*_files.xml',
|
||
|
checksum=True, destdir=obs_dl,
|
||
|
retries=4, ignore_errors=True)
|
||
|
|
||
|
time.sleep(3)
|
||
|
|