Skip to content

Instantly share code, notes, and snippets.

@reikoNeko
Last active December 16, 2019 14:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reikoNeko/ad4fa3a7bde5feb5ffa850b91fc13cbb to your computer and use it in GitHub Desktop.
Save reikoNeko/ad4fa3a7bde5feb5ffa850b91fc13cbb to your computer and use it in GitHub Desktop.
We need moar candy canes!?

Need more images from the Frido Sleigh CAPTEHA? Just want to test your training and categorization?

  • Open the site in a Chrome browser and open the developer tools
  • Log all the images through multiple runs of the CAPTEHA
  • Capture images into a .har archive -- It's just json, and the request strings include the full image in base64 mode.
  • Run the attached script to convert the images from the .har file to .png

Then run Chris Davis's scripts from https://github.com/chrisjd20/img_rec_tf_ml_demo to categorize your images!

import json
import base64
with open('fridosleigh.com.har') as f:
har = json.load(f)
for imageset in range(0, len(har['log']['entries']):
id = har['log']['entries'][imageset]['response']['content']['text']
images = json.loads(id)['images']
for image in range(0, len(images)):
filename = f'set{imageset:02}image{image:03}.png'
outfile = open(filename, 'wb')
outfile.write(base64.b64decode(images[image]['base64']))
outfile.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment