Xewdy444 / Playwright-reCAPTCHA

A Python library for solving reCAPTCHA v2 and v3 with Playwright
https://pypi.org/project/playwright-recaptcha/
MIT License
275 stars 38 forks source link

add russian language #83

Closed sega-gremlen closed 7 months ago

Xewdy444 commented 8 months ago

Thanks! I'll get this merged soon.

sega-gremlen commented 8 months ago

I noticed you take off the "." out of the captcha text. This is not the mistake, the symbol is actually in text in some phrases.

1 2

3 4

One more thing that I forgot to mention is that I tested the script only on audio captchas. As I understand, for image captchas, this part still needs to be translated:

object_dict = {
            "taxis": "/m/0pg52",
            "bus": "/m/01bjv",
            "school bus": "/m/02yvhj",
            "motorcycles": "/m/04_sv",
            "tractors": "/m/013xlm",
            "chimneys": "/m/01jk_4",
            "crosswalks": "/m/014xcs",
            "traffic lights": "/m/015qff",
            "bicycles": "/m/0199g",
            "parking meters": "/m/015qbp",
            "cars": "/m/0k4j",
            "bridges": "/m/015kr",
            "boats": "/m/019jd",
            "palm trees": "/m/0cdl1",
            "mountains or hills": "/m/09d_r",
            "fire hydrant": "/m/01pns0",
            "stairs": "/m/01lynh",
        }

But I don't have the CapSolver API to test images, so I can only provide a translation of these words.

Xewdy444 commented 8 months ago

I noticed you take off the "." out of the captcha text. This is not the mistake, the symbol is actually in text in some phrases.

I do this because the period is excluded in the message sometimes, so I want to still match the text in that case. The regex pattern will match regardless of the period being present or not.

I went ahead and added the Russian translations for the reCAPTCHA objects. I believe they are correct, but I would ask that you check them over to be sure.

sega-gremlen commented 8 months ago

After about 20-30 minutes of clicking, I didn't get the following items: parking meters, boats, palm trees, mountains, or hills. I believe it's quite rare. I corrected some translation inaccuracies that I encountered.

However, I didn't see a school bus, instead, I saw two different types of buses. The Russian translation shows them as "bus" and "buses" (plural form), i don't know why.

Xewdy444 commented 8 months ago

In that case, both translations can be put in the "bus" translations. Do you know any websites with a Russian reCAPTCHA that I could test this on?

sega-gremlen commented 8 months ago

In that case, both translations can be put in the "bus" translations. Do you know any websites with a Russian reCAPTCHA that I could test this on?

You can try it on demo captcha, just use locale:

context = browser.new_context(locale='RU')

Or this page: https://www.fl.ru/account/login/

Xewdy444 commented 8 months ago

Perfect, thank you. I will test this out later today and see if I can check the remaining translations.

Xewdy444 commented 8 months ago

I added an alternate translation for fire hydrant. I also did not get the items that you listed, so I was not able to confirm if they are translated correctly. I would say that this is fine, because in the rare chance that someone does get one of those items and it is mistranslated, it will just be skipped without counting it as a solve attempt.