Skip to content

Instantly share code, notes, and snippets.

@phelipetls
Last active November 9, 2019 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phelipetls/8e5ad890df096019682af44b257c41c0 to your computer and use it in GitHub Desktop.
Save phelipetls/8e5ad890df096019682af44b257c41c0 to your computer and use it in GitHub Desktop.
Download arbitrary chapter of Demon Slayer manga. Just use with ./download_kimetsu 89 to download chapter 89. It will then download all pages into a folder called 089 etc.
#!/bin/bash
n=1
curl "https://ww1.demonslayermanga.com/chapter/demon-slayer-kimetsu-no-yaiba-chapter-$1/" |
sed -n '/<img class/p' |
sed -nr 's/.*src="(.*)".*/\1/p' |
tr -d '\015' | # some carriage return got in the way, gotta delete them
while read url;
do curl "$url" --create-dirs --output "$(printf %03d $1)/$(printf %02d $n).png";
((++n));
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment