Advertisement
metalx1000

Book Ripper for issuu or kindle

Apr 22nd, 2020
1,512
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.71 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #read -p "Number of pages: " num
  4. #https://issuu.com/
  5. #Amazon.com
  6. sleep 3;
  7.  
  8. #get page1 crop info
  9. import /tmp/out.png
  10. size="$(identify /tmp/out.png |cut -d\  -f3)"
  11. offset="+$(identify /tmp/out.png |cut -d\+ -f2,3|awk '{print $1}')"
  12. page1="${size}${offset}"
  13. echo "$page1"
  14.  
  15. #get page2 crop info
  16. import /tmp/out.png
  17. size="$(identify /tmp/out.png |cut -d\  -f3)"
  18. offset="+$(identify /tmp/out.png |cut -d\+ -f2,3|awk '{print $1}')"
  19. page2="${size}${offset}"
  20. echo "$page2"
  21.  
  22. sleep 5
  23.  
  24. for page in {01..1000}
  25. do
  26.   echo "$page"
  27.   sleep 1
  28.   import -window root +repage -crop $page1 $(date +%s).jpg
  29.   sleep 1
  30.   import -window root +repage -crop $page2 $(date +%s).jpg
  31.   xte "mouseclick 1"
  32. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement