sec08 MANIFEST rebuilt to sec01-07 cancon (per-item 'N files' headers, Cross-references before Not downloadable); queue scripts generalized to tools/lgdl-queue.sh + lgdl-rounds.sh, logs/queue removed from downloads dir
This commit is contained in:
parent
8e664c7099
commit
4bc2bfb6e4
8 changed files with 129 additions and 1031 deletions
27
tools/lgdl-queue.sh
Executable file
27
tools/lgdl-queue.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
# Libgen EN-download queue for a section (sec08 pattern, 2026-09-26).
|
||||
# Usage: tools/lgdl-queue.sh <section-dir> <queue-file>
|
||||
# <section-dir> e.g. downloads/09-<name>
|
||||
# <queue-file> lines: "<f_id> <edition_id> <file-name-base>"
|
||||
# Per-file: skip-if-exists, timeout 1500, tries=3 (fast-fail under ads.php throttle),
|
||||
# unbuffered logs. Pair with lgdl-rounds.sh for cooldown rounds.
|
||||
cd /home/dima/jung
|
||||
D="$1"; Q="$2"; LOG="$D/queue.log"
|
||||
[ -z "$D" ] || [ -z "$Q" ] && { echo "usage: lgdl-queue.sh <section-dir> <queue-file>"; exit 1; }
|
||||
echo "=== queue start $(date)" >> "$LOG"
|
||||
while read -r f_id ed_id name; do
|
||||
[ -z "$f_id" ] && continue
|
||||
if ls "$D/$name"*.pdf "$D/$name"*.epub "$D/$name"*.fb2 "$D/$name"*.doc "$D/$name"*.rtf "$D/$name"*.djvu >/dev/null 2>&1; then
|
||||
echo "SKIP (exists): $name" >> "$LOG"
|
||||
continue
|
||||
fi
|
||||
rm -f "$D/$name"*.part
|
||||
echo "=== $name (f/$f_id) $(date)" >> "$LOG"
|
||||
timeout 1500 python3 -u -c "
|
||||
import sys; sys.path.insert(0,'tools'); import lgdl
|
||||
r = lgdl.download(sys.argv[1], sys.argv[2], sys.argv[3], tries=3)
|
||||
sys.exit(0 if r else 1)" "$f_id" "$D" "$name" >> "$LOG" 2>&1
|
||||
echo "rc=$? $name" >> "$LOG"
|
||||
sleep 2
|
||||
done < "$Q"
|
||||
echo "=== queue round DONE $(date)" >> "$LOG"
|
||||
Loading…
Add table
Add a link
Reference in a new issue