Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Нерабочие примеры? #20

Closed
Minuta18 opened this issue May 24, 2023 · 2 comments
Closed

Нерабочие примеры? #20

Minuta18 opened this issue May 24, 2023 · 2 comments

Comments

@Minuta18
Copy link

Я использовал следующий код (из README):

from kinopoisk_unofficial.kinopoisk_api_client import KinopoiskApiClient
from kinopoisk_unofficial.request.films.search_by_keyword_request import SearchByKeywordRequest

api_client = KinopoiskApiClient("token")
request = SearchByKeywordRequest("Kek")
response = api_client.films.send_search_by_keyword_request(request)

(Вместо "token" стоит токен)

Но я получил ошибку:

Traceback (most recent call last):
  File "/home/igors/Рабочий стол/archive/Main.py", line 6, in <module>
    response = api_client.films.send_search_by_keyword_request(request)
  File "/home/igors/Рабочий стол/archive/.venv/lib/python3.10/site-packages/kinopoisk_unofficial/client/films_api_client.py", line 38, in send_search_by_keyword_request
    return self._send_request(request)
  File "/home/igors/Рабочий стол/archive/.venv/lib/python3.10/site-packages/kinopoisk_unofficial/client/api_client.py", line 47, in _send_request
    return self.__deserialize_response(
  File "/home/igors/Рабочий стол/archive/.venv/lib/python3.10/site-packages/kinopoisk_unofficial/client/api_client.py", line 57, in __deserialize_response
    return self.__serializer.deserialize(response_class, response_body)
  File "/home/igors/Рабочий стол/archive/.venv/lib/python3.10/site-packages/apischema/utils.py", line 546, in wrapper
    return wrapped(*args, **kwargs)
  File "/home/igors/Рабочий стол/archive/.venv/lib/python3.10/site-packages/apischema/deserialization/__init__.py", line 869, in deserialize
    return deserialization_method(
  File "/home/igors/Рабочий стол/archive/.venv/lib/python3.10/site-packages/apischema/deserialization/__init__.py", line 528, in method
    raise ValidationError(errors, field_errors)
apischema.validation.errors.ValidationError: ValidationError(messages=[], children={'keyword': ValidationError(messages=['missing property'], children={}), 'pagesCount': ValidationError(messages=['missing property'], children={}), 'searchFilmsCountResult': ValidationError(messages=['missing property'], children={})})

Как исправить?

@Minuta18 Minuta18 changed the title Не рабочие примеры? Нерабочие примеры? May 24, 2023
@masterWeber
Copy link
Owner

Видимо изменился API, поробуйте просмотреть ответ, он соответствует схеме?

@Fan4Metal
Copy link

У меня этот код работает нормально. Python 3.10.8, kinopoisk-api-unofficial-client 2.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants