Skip to content

Commit

Permalink
Make mirror step easier to read
Browse files Browse the repository at this point in the history
  • Loading branch information
norwd authored Dec 11, 2024
1 parent afd8c5e commit 3a8b893
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,17 @@ jobs:
do
ENDPOINT="$(curl -sS "${ENDPOINT}" | tee "${TMP_FILE}" | jq --raw-output "${JQ_QUERY}")"
cat "${TMP_FILE}"
done | jq --slurp '[.[].results[]]' | tee "index.json" | jq --raw-output '.[].formats[]' | xargs -P "$(nproc)" -IURL wget --no-verbose --execute robots=off --random-wait --wait 10 --no-host-directories --force-directories URL
done | \
jq --slurp '[.[].results[]]' | \
tee "index.json" | \
jq --raw-output '.[].formats[]' | \
xargs --max-procs="$(nproc)" -IURL \
wget --no-verbose --execute robots=off --random-wait --wait "${WAIT_SEC}" --no-host-directories --force-directories URL
env:
ENDPOINT: 'https://gutendex.com/books/?languages=eo'
JQ_QUERY: '.next|tostring|sub("^null$"; ""; "i")'
TMP_FILE: '${{ runner.temp }}/results'
WAIT_SEC: 10

- name: "Add files"
run: git add .
Expand Down

0 comments on commit 3a8b893

Please sign in to comment.