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

Error in "КиноПоиск" code 200 from Kinopoisk API #13

Open
jahlib opened this issue Nov 17, 2023 · 2 comments
Open

Error in "КиноПоиск" code 200 from Kinopoisk API #13

jahlib opened this issue Nov 17, 2023 · 2 comments

Comments

@jahlib
Copy link

jahlib commented Nov 17, 2023

[2023-11-18 00:48:29.935 +03:00] [ERR] Received non-success result status code 200 from Kinopoisk API, response content is:

[2023-11-18 00:48:29.935 +03:00] [ERR] Error in "КиноПоиск"
HTTP Response:

KinopoiskUnofficialInfo.ApiClient.ApiException: Could not deserialize the response body stream as KinopoiskUnofficialInfo.ApiClient.VideoResponse.

Status: 200
Response:

---> Newtonsoft.Json.JsonSerializationException: Error converting value "YANDEX_DISK" to type 'KinopoiskUnofficialInfo.ApiClient.VideoResponse_itemsSite'. Path 'items[22].site', line 1, position 3111.
---> System.ArgumentException: Requested value 'YANDEX_DISK' was not found.
at Newtonsoft.Json.Utilities.EnumUtils.ParseEnum(Type enumType, NamingStrategy namingStrategy, String value, Boolean disallowNumber)
at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
--- End of inner exception stack trace ---
at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)
at KinopoiskUnofficialInfo.ApiClient.Client.ReadObjectResponseAsync[T](HttpResponseMessage response, IReadOnlyDictionary2 headers, CancellationToken cancellationToken) --- End of inner exception stack trace --- at KinopoiskUnofficialInfo.ApiClient.Client.ReadObjectResponseAsync[T](HttpResponseMessage response, IReadOnlyDictionary2 headers, CancellationToken cancellationToken)
at KinopoiskUnofficialInfo.ApiClient.Client.VideosAsync(Int32 id, CancellationToken cancellationToken)
at KinopoiskUnofficialInfo.ApiClient.KinopoiskApiClient.<>c__DisplayClass10_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at KinopoiskUnofficialInfo.ApiClient.KinopoiskApiClient.Invoke[T](Func2 method, Nullable1 ct, String memberName)
at KinopoiskUnofficialInfo.ApiClient.CachedKinopoiskApiClient.<>c__DisplayClass11_01.<<TryGetValue>b__0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreateAsync[TItem](IMemoryCache cache, Object key, Func2 factory)
at Jellyfin.Plugin.Kinopoisk.MetadataProviders.BaseVideoMetadataProvider2.GetMetadata(TLookupInfoType info, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.MetadataService2.ExecuteRemoteProviders(MetadataResult1 temp, String logName, TIdType id, IEnumerable1 providers, CancellationToken cancellationToken)

@shilin-da
Copy link

shilin-da commented Dec 30, 2023

[22:19:27] [ERR] [121] KinopoiskUnofficialInfo.ApiClient.KinopoiskApiClient: Received non-success result status code 200 from Kinopoisk API, response content is:

[22:19:27] [ERR] [121] MediaBrowser.Providers.Movies.MovieMetadataService: Error in КиноПоиск
HTTP Response: 


KinopoiskUnofficialInfo.ApiClient.ApiException: Could not deserialize the response body stream as KinopoiskUnofficialInfo.ApiClient.VideoResponse.

Response: 

 ---> Newtonsoft.Json.JsonSerializationException: Error converting value "YANDEX_DISK" to type 'KinopoiskUnofficialInfo.ApiClient.VideoResponse_itemsSite'. Path 'items[4].site', line 1, position 627.
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)

There is no YANDEX_DISK option in generated API client here: https://github.com/LinFor/jellyfin-plugin-kinopoisk/blob/376ca813/src/KinopoiskUnofficialInfo.ApiClient/GeneratedClient.generated.cs#L3939-L3951

I found nothing on this update in https://kinopoiskapiunofficial.tech/changes, however current docs states this one as a legit option: https://kinopoiskapiunofficial.tech/documentation/api/#/films/get_api_v2_2_films__id__videos

@LinFor can you please update the API client part?

UPD: here is an API response for https://kinopoiskapiunofficial.tech/api/v2.2/films/4448519/videos

{
  "total": 6,
  "items": [
    {
      "url": "https://trailers.s3.mds.yandex.net/video_original/188650-7245954783417397.mp4",
      "name": "Трейлер №2",
      "site": "UNKNOWN"
    },
    {
      "url": "https://trailers.s3.mds.yandex.net/video_original/191938-7918080831524326.mp4",
      "name": "Анимированный постер №2",
      "site": "UNKNOWN"
    },
    {
      "url": "https://youtu.be/a4ykVbK7hLA",
      "name": "Международный трейлер",
      "site": "YOUTUBE"
    },
    {
      "url": "https://trailers.s3.mds.yandex.net/video_original/191937-06793274589122045.mp4",
      "name": "Анимированный постер",
      "site": "UNKNOWN"
    },
    {
      "url": "https://disk.yandex.ru/i/uE7jSfA1HaMcSQ",
      "name": "Проморолик — впечатления космонавтов с МКС",
      "site": "YANDEX_DISK"
    },
    {
      "url": "https://disk.yandex.ru/i/5l9r_3CynRD0gg",
      "name": "Трейлер",
      "site": "YANDEX_DISK"
    }
  ]
}

@ThinkAndRun
Copy link

ThinkAndRun commented Jan 28, 2024

API расширилось новыми кайндами файлов, из-за этого была проблема. Пока пофиксил в своем форке. Кому нужен собранный плагин https://raw.githubusercontent.com/ThinkAndRun/jellyfin-plugin-kinopoisk/master/dist/manifest.json

Я не пишу на dotnet и не имею возможности поддерживать проект. Добавьте в текущий репо фикс на тип файлов YANDEX_DISK, как тут skrashevich/jellyfin-plugin-kinopoisk@master...ThinkAndRun:jellyfin-plugin-kinopoisk:master#diff-3dc18ceb1c956c954c9d9f8d55e8b584d273b69b21b832bb1ce7d1f5ffa990c7

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