Skip to content

Instantly share code, notes, and snippets.

@svelleweetakealot
Forked from orodley/extract_image.sh
Created October 11, 2018 11:33
Show Gist options
  • Save svelleweetakealot/18d42efdd782a68035b48dea73325a9e to your computer and use it in GitHub Desktop.
Save svelleweetakealot/18d42efdd782a68035b48dea73325a9e to your computer and use it in GitHub Desktop.
Extract base64-encoded images from an HTML file.
for image in `grep --color=never -Po 'data:image/[^;]*;base64,\K[a-zA-Z0-9+/]*' foo.html`; do echo -n "$image" | base64 -di > `mktemp image_XXXX`; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment