Skip to content

Instantly share code, notes, and snippets.

@arthuRHD
Created December 12, 2023 20:02
Show Gist options
  • Save arthuRHD/defe0db8545288300e80281ffe416f25 to your computer and use it in GitHub Desktop.
Save arthuRHD/defe0db8545288300e80281ffe416f25 to your computer and use it in GitHub Desktop.
Download the latest one piece chapter and aggregate each scan inside a PDF
#!/bin/bash
# Prerequirements:
# - sudo apt install img2pdf ocrmypdf
# - internet access
for i in {01..30}; do
url="https://lelscans.net/mangas/one-piece/$1/$i.jpg"
curl -sf $url -o onepiece_${i}.jpg # assuming there is around 30 pages by chapter
done
echo "Scans retrieved"
img2pdf onepiece_*.jpg --output combined.pdf
ocrmypdf combined.pdf $1.pdf
rm combined.pdf onepiece_*.jpg
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment