Giter Club home page Giter Club logo

aiobalaboba's Introduction

aiobalaboba

CI Downloads

Asynchronous wrapper for Yandex Balaboba (Яндекс Балабоба).

Synchronous version here.

Disclaimer

The neural network doesn’t really know what it’s saying, so it can say absolutely anything. Don’t get offended if it says something that hurts your feelings. When sharing the texts, make sure they’re not offensive or violate the law.

Installation

python -m pip install -U aiobalaboba

Documentation

https://aiobalaboba.readthedocs.io

License

MIT

aiobalaboba's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

aiobalaboba's Issues

Showcaptcha error (400 Bad request) on readme code example

from aiobalaboba import Balaboba
bb = Balaboba()
intros = await bb.get_text_types(language="en")
response = await bb.balaboba("Hello", text_type=intros[0])
print(response)
ERROR - asyncio - Task exception was never retrieved
future: <Task finished name='Task-8' coro=<Dispatcher._process_polling_updates() done, defined at /home/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py:407> exception=ClientResponseError(RequestInfo(url=URL('https://yandex.ru/showcaptcha?cc=1&mt=5BD38005661AFA214A23039DE66CE99154FDE0F3DD12D82BFD23E382919877DC0D82BA&retpath=aHR0cHM6Ly95YW5kZXgucnUvbGFiL2FwaS95YWxtL3RleHQzPw,,_0ccfab5d3059dd8a57eb02c7e03cac1d&t=2/1678024684/acc9b116267c570ce065d19c7d41f759&u=a6ac3f1d-fa31cdee-45b504b6-44f88428&s=52368c518dccfdfb0eb52a786fc2dc2c'), method='GET', headers=<CIMultiDictProxy('Host': 'yandex.ru', 'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Python/3.10 aiohttp/3.8.3', 'Cookie': 'i=s68mMBN/NuTDjT0qE4yeRmtFVibiolnp7TJtfdmpq+z3llr9bac6axEOmvcAyE04Cs0AAWxH6rgRg0L4zeZt1ldAOqY=; spravka=dD0xNjQ2NDg4Njg0O2k9OTAuMTU0LjcxLjU3O0Q9NzU0RjEzRUMyQkExNzc1OUI5OThGREFFQkJBREJGODhGNjQ3MzYyQTAzOTIwRDM2NkQwRjgzOTMyRTM4O3U9MTY0NjQ4ODY4NDM1MDE5ODI5MztoPWE5NDY1NzE0YjQ2M2M3YzYyZTFiMmRkNWFmOWI2YjQ4; yashr=2712595181678024684')>, real_url=URL('https://yandex.ru/showcaptcha?cc=1&mt=5BD38005661AFA214A23039DE66CE99154FDE0F3DD12D82BFD23E382919877DC0D82BA&retpath=aHR0cHM6Ly95YW5kZXgucnUvbGFiL2FwaS95YWxtL3RleHQzPw,,_0ccfab5d3059dd8a57eb02c7e03cac1d&t=2/1678024684/acc9b116267c570ce065d19c7d41f759&u=a6ac3f1d-fa31cdee-45b504b6-44f88428&s=52368c518dccfdfb0eb52a786fc2dc2c')), (), status=400, message='Bad request', headers=<CIMultiDictProxy('Accept-CH': 'Sec-CH-UA-Platform-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA, Sec-CH-UA-Full-Version-List, Sec-CH-UA-WoW64, Sec-CH-UA-Arch, Sec-CH-UA-Bitness, Sec-CH-UA-Platform, Sec-CH-UA-Full-Version, Viewport-Width, DPR, Device-Memory, RTT, Downlink, ECT', 'Content-Length': '5432', 'Content-Type': 'text/html', 'NEL': '{"report_to": "network-errors", "max_age": 100, "success_fraction": 0.001, "failure_fraction": 0.1}', 'Report-To': '{ "group": "network-errors", "max_age": 100, "endpoints": [{"url": "https://dr.yandex.net/nel", "priority": 1}, {"url": "https://dr2.yandex.net/nel", "priority": 2}]}', 'X-Content-Type-Options': 'nosniff', 'X-Yandex-EU-Request': '0', 'X-Yandex-Req-Id': '1678024684360830-3912569391714052001-vla1-5363-vla-l7-balancer-8080-BAL')>)>
Traceback (most recent call last):
  File "/home/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py", line 415, in _process_polling_updates
    for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
  File "/home/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py", line 235, in process_updates
    return await asyncio.gather(*tasks)
  File "/home/lib/python3.10/site-packages/aiogram/dispatcher/handler.py", line 117, in notify
    response = await handler_obj.handler(*args, **partial_data)
  File "/home/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py", line 256, in process_update
    return await self.message_handlers.notify(update.message)
  File "/home/lib/python3.10/site-packages/aiogram/dispatcher/handler.py", line 117, in notify
    response = await handler_obj.handler(*args, **partial_data)
  File "/home/src/handlers.py", line 35, in cmd_help
    response = await bb.balaboba("Hello", text_type=intros[0])
  File "/home/lib/python3.10/site-packages/aiobalaboba/_balaboba.py", line 49, in balaboba
    response = await self._session.get_response(
  File "/home/lib/python3.10/site-packages/aiobalaboba/_http.py", line 29, in get_response
    return await self._fetch(
  File "/home/lib/python3.10/site-packages/aiobalaboba/_http.py", line 41, in _fetch
    async with session.request(
  File "/home/lib/python3.10/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
  File "/home/lib/python3.10/site-packages/aiohttp/client.py", line 643, in _request
    resp.raise_for_status()
  File "/home/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad request', url=URL('https://yandex.ru/showcaptcha?cc=1&mt=5BD38005661AFA214A23039DE66CE99154FDE0F3DD12D82BFD23E382919877DC0D82BA&retpath=aHR0cHM6Ly95YW5kZXgucnUvbGFiL2FwaS95YWxtL3RleHQzPw,,_0ccfab5d3059dd8a57eb02c7e03cac1d&t=2/1678024684/acc9b116267c570ce065d19c7d41f759&u=a6ac3f1d-fa31cdee-45b504b6-44f88428&s=52368c518dccfdfb0eb52a786fc2dc2c')
2023-03-05 16:58:22,421 - INFO - root - Start game inspector: 0 active games

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.