download torrents from Internet Archive

master
Jeff Moe 2022-06-11 18:22:52 -06:00
parent b6ac03590a
commit 5e987198bc
2 changed files with 38 additions and 4 deletions

View File

@ -1,6 +1,27 @@
#!/usr/bin/env python3
import time
import xmlrpc.client as xmlrpclib
s = xmlrpclib.ServerProxy('http://localhost:4800/rpc')
s.aria2.addTorrent("token:yajnuAdCemNathNojdi", xmlrpclib.Binary(open('/srv/dl/satnogs-observations-000100001-000110000/satnogs-observations-000100001-000110000_archive.torrent', mode='rb').read()))
from pathlib import Path
s = xmlrpclib.ServerProxy('http://localhost:4800/rpc')
path=Path('/srv/dl')
# All torrents
#torrents=sorted(list(path.glob('**/satnogs-observations-*/satnogs-observations-*_archive.torrent')))
# Added torrents
torrents=sorted(list(path.glob('**/satnogs-observations-0001?0001-000??0000/satnogs-observations-*_archive.torrent')))
torrents=sorted(list(path.glob('**/satnogs-observations-0002?0001-000??0000/satnogs-observations-*_archive.torrent')))
torrents=sorted(list(path.glob('**/satnogs-observations-0003?0001-000??0000/satnogs-observations-*_archive.torrent')))
torrents=sorted(list(path.glob('**/satnogs-observations-0004?0001-000??0000/satnogs-observations-*_archive.torrent')))
torrents=sorted(list(path.glob('**/satnogs-observations-0005?0001-000??0000/satnogs-observations-*_archive.torrent')))
torrents=sorted(list(path.glob('**/satnogs-observations-0006?0001-000??0000/satnogs-observations-*_archive.torrent')))
torrents=sorted(list(path.glob('**/satnogs-observations-0007?0001-000??0000/satnogs-observations-*_archive.torrent')))
for i in torrents:
print(i.name)
s.aria2.addTorrent("token:yajnuAdCemNathNojdi",
xmlrpclib.Binary(open(i, mode='rb').read()))
time.sleep(3)

View File

@ -4,6 +4,8 @@ set -x
mkdir -p ~/log /srv/dl
ulimit -n 8192
aria2c \
--daemon=true \
--enable-rpc=true \
@ -11,7 +13,6 @@ aria2c \
--rpc-listen-port=4800 \
--rpc-listen-all=false \
--rpc-secret=`cat /home/jebba/.aria-secret` \
--deferred-input=true \
--disable-ipv6=true \
--disk-cache=128M \
--file-allocation=falloc \
@ -19,5 +20,17 @@ aria2c \
--log=/home/jebba/log/aria.log \
--bt-max-open-files=1000 \
--bt-max-peers=1000 \
--continue=true
--continue=true \
--follow-torrent=mem \
--rpc-save-upload-metadata=false \
--max-concurrent-downloads=100 \
--bt-max-open-files=50000 \
--bt-max-peers=0 \
--allow-overwrite=true \
--max-download-result=0 \
--enable-mmap=true
exit
--deferred-input=true \
--enable-mmap