Last active
December 15, 2015 03:59
-
-
Save hackingbutlegal/5198754 to your computer and use it in GitHub Desktop.
Download files from Issuu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # not a script, just a set of cmds | |
| # | |
| printf 'http://image.issuu.com/actual_url/jpg/page_%d.jpg\n' {1..500} > files.txt | |
| wget -i files.txt | |
| # test sed | |
| for filename in page_*.jpg; do echo $filename | sed -e 's/page\_//g'; done | |
| # execute sed rename | |
| for filename in page_*.jpg; do newname=`echo $filename | sed -e 's/page\_//g'`; mv $filename $newname; done | |
| # convert images to pdf | |
| for f in *.jpg; do | |
| convert ./"$f" ./"${f%.jpg}.pdf" | |
| done | |
| # combine pdfs into one file in numerical order | |
| ls | sort -g -o files2.txt | |
| pdftk <file names in desired order> cat output new_file.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment