Created
March 25, 2017 23:30
-
-
Save madlymad/bc02a34a75e78d09fe1f9bea13aeb984 to your computer and use it in GitHub Desktop.
download swf pages of a book and convert to png files
This file contains 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
#!/bin/bash | |
# Add the number of pages | |
pages=$((134)) | |
rm -rf *.swf* | |
mkdir SWF | |
mkdir PNG | |
i=$((1)) | |
for j in `seq -w 1 $pages` | |
do | |
echo "process page $i" | |
if [ ! -f "SWF/p$i.swf" ]; then | |
# change the url to page url | |
page="http://url_of_your_page/p$i.swf" | |
echo "download $page" | |
wget $page | |
mv *.swf SWF/ | |
fi | |
if [ ! -f "PNG/p$i.png" ]; then | |
swfrender -X 1836 -Y 2376 "SWF/p$i.swf" -o "PNG/p$i.png" | |
fi | |
mv "PNG/p$i.png" "PNG/p$j.png" | |
echo "p$i.png -> PNG/p$j.png" | |
i=`expr $j + 1` | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment