insanocs / ArchimedesProject

A python bot to get statistical data from PixelPlanet templates
MIT License
1 stars 1 forks source link

Lets make a captcha solver #1

Open sneedgers opened 2 years ago

sneedgers commented 2 years ago
from svglib.svglib import svg2rlg
from reportlab.graphics import renderPM, renderPDF
import requests as req
from io import BytesIO
from PIL import Image

from pdf2image import convert_from_bytes

##SLAVA TURKIEE-BURNER 1488!!!111
def get_captcha_as_pillow(s):
    r = s.get("https://scb.pixelplanet.fun/captcha.svg")
    svg_data = BytesIO(r.content)

    #Makes a SVG drwawing
    drawing = svg2rlg(svg_data)

    sneed_buffer_pdf = BytesIO()##Fake memory buffer, so we can kindda - NOT SAVE INTO HOUR COPE-COMPUTERS SNEED DOPE DILATE
    renderPDF.drawToFile(drawing, sneed_buffer_pdf)
    sneed_buffer_pdf.seek(0)
    cope = sneed_buffer_pdf.read()

    return convert_from_bytes(
        cope,
        fmt='jpeg',
        # open('/home/belval/example.pdf', 'rb').read()
    )[0]

s = req.Session()
captcha_image = get_captcha_as_pillow(s)

"""
Perhaps resize

To 250x250 
for easy training. 
But we will see? ???
"""
captcha_image.save('sneed.jpeg', quality = 15)
captcha_image.show()

Hey I am able to convert the captcha into a jpeg (both via the memory....)

My idea is using something like ABINet and then attach it on an api on huggingface for a free captcha solver

Anyways my idea is... 8000images dataset have indians 2captcha-workers to solve the images so you could have a dataset

Who is chipping in...

thanks :) <3

sneedgers commented 2 years ago

image image its improving !

Any generous support of a 2captcha would be nice! so I can enlarge my dataset!

sneedgers commented 2 years ago

image

insanocs commented 2 years ago

Hi, sorry for being late bro, I've made some code to try fixing the captcha image a bit before. Maybe later we can try some more things. I'm in.

insanocs commented 2 years ago

Also, do you have discord?