vypivshiy / anicli-api

Anicli API implemetention
18 stars 2 forks source link

error a_get_videos #29

Closed fruitoiz closed 8 months ago

fruitoiz commented 8 months ago

anicli_api==0.5.16

код:

from anicli_api.source.animego import Extractor

ex = Extractor()
prompt = "парад смерти"
results = await ex.a_search(prompt) 
anime = await results[0].a_get_anime()
episodes = await anime.a_get_episodes()
sources = await episodes[2].a_get_sources()
source = sources[3]
videos = await source.a_get_videos()

ошибка:

File "/home/user/projects/test.py", line 30, in main
  videos = await source.a_get_videos()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/user/.local/lib/python3.12/site-packages/anicli_api/player/kodik.py", line 151, in a_parse
  response_api = (await client.post(url_api, data=payload, headers=headers).json())["links"]
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'coroutine' object has no attribute 'json'

как лечить: response_api = ((await client.post(url_api, data=payload, headers=headers)).json())["links"]

fruitoiz commented 8 months ago

когда получил ошибку сначала решил скачать новую версию с гида, а она не работает.

  File "/home/user/projects/bots/heart.py", line 76, in main
    results = await anime_api.a_search(prompt) 

  File "/home/user/projects/bots/anicli_api_master/anicli_api/source/animego.py", line 50, in a_search
    resp = await self.http_async.get(f"{self.BASE_URL}/search/anime", params={"q": query})
                 ^^^^^^^^^^^^^^^
AttributeError: 'Extractor' object has no attribute 'http_async'
vypivshiy commented 8 months ago

починено и добавлено в тесты это была промежуточная версия с изменениями (да прямо в master, не в dev)

fruitoiz commented 8 months ago

Ура, спасибо