vche/pycliarr

Error with a certain movie tt1583279 (not sure if this a Radarr problem or a Pycliarr problem)

Closed this issue · 1 comments

Not sure if this is a Radarr problem or a Pycliarr problem (I can add the movie by hand to Radarr though)

pycliarr.api.exceptions.CliServerError: Error from server http://192.168.178.7:7878/api/v3/movie, status: 500, msg: ('{\n'
 '  "message": "String \\u0027\\u0027 was not recognized as a valid '
 'DateTime.",\n'
 '  "description": "System.FormatException: String \\u0027\\u0027 was not '
 'recognized as a valid DateTime.\\n   at '

The script:

from pycliarr.api import (
    RadarrCli
)

import logging

logging.basicConfig(
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
    level=logging.DEBUG)

radarr_node = RadarrCli('http://192.168.178.7:7878',
                        '4a04e500c4bc401ab3acb61ea907a65a')

res = radarr_node.add_movie(imdb_id="tt1583279", quality=1)

print(res)

The output:

2021-05-16 18:05:52,163 - pycliarr.api.base_api - DEBUG - Request sent: GET http://192.168.178.7:7878/api/movie/lookup/imdb params: {'imdbId': 'tt1583279'} data: None
2021-05-16 18:05:52,168 - urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): 192.168.178.7:7878
2021-05-16 18:05:52,306 - urllib3.connectionpool - DEBUG - http://192.168.178.7:7878 "GET /api/movie/lookup/imdb?imdbId=tt1583279 HTTP/1.1" 200 None
2021-05-16 18:05:52,307 - pycliarr.api.base_api - DEBUG - Request sent: GET http://192.168.178.7:7878/api/rootfolder params: None data: None
2021-05-16 18:05:52,345 - urllib3.connectionpool - DEBUG - http://192.168.178.7:7878 "GET /api/rootfolder HTTP/1.1" 200 None
2021-05-16 18:05:52,346 - pycliarr.api.base_api - DEBUG - Request sent: POST http://192.168.178.7:7878/api/v3/movie params: None data: {'title': 'Jake', 'sortTitle': 'jake', 'sizeOnDisk': 0, 'overview': 'The story of Jacob, a man whose life is stolen when he is inexplicably recast by a shadowy agency. When the actor who takes his place rekindles a long lost love, Jacob will do whatever it takes to fight for the role of his life.', 'inCinemas': '2013-06-28T00:00:00Z', 'physicalRelease': '', 'status': 'released', 'images': [], 'website': 'http://www.jakethemovie.com', 'downloaded': False, 'year': 2013, 'hasFile': False, 'youTubeTrailerId': '', 'studio': '', 'path': '/movies/Jake', 'rootFolderPath': '', 'profileId': 1, 'monitored': True, 'minimumAvailability': 'tba', 'isAvailable': True, 'folderName': '', 'runtime': 88, 'cleanTitle': 'jake', 'imdbId': 'tt1583279', 'tmdbId': 203952, 'titleSlug': '203952', 'certification': '', 'genres': ['Comedy', 'Drama'], 'tags': [], 'added': '0001-01-01T00:00:00Z', 'ratings': {'votes': 1, 'value': 7.5}, 'collection': {}, 'alternativeTitles': [], 'qualityProfileId': 1, 'id': 0, 'addOptions': {'searchForMovie': True}}
2021-05-16 18:05:52,366 - urllib3.connectionpool - DEBUG - http://192.168.178.7:7878 "POST /api/v3/movie HTTP/1.1" 500 None
Traceback (most recent call last):
  File "/Users/marco/Documents/GitHub/pixlovarr/./test/pixlovarr_add_movie..py", line 16, in <module>
    res = radarr_node.add_movie(imdb_id="tt1583279", quality=1)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pycliarr/api/radarr.py", line 175, in add_movie
    return self.add_item(json_data=movie_info.to_dict())
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pycliarr/api/base_media.py", line 127, in add_item
    return self.request_post(self.api_url_item, json_data=json_data)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pycliarr/api/base_api.py", line 98, in request_post
    return self.request("POST", path, json_data=json_data)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pycliarr/api/base_api.py", line 81, in request
    raise CliServerError(
pycliarr.api.exceptions.CliServerError: Error from server http://192.168.178.7:7878/api/v3/movie, status: 500, msg: ('{\n'
 '  "message": "String \\u0027\\u0027 was not recognized as a valid '
 'DateTime.",\n'
 '  "description": "System.FormatException: String \\u0027\\u0027 was not '
 'recognized as a valid DateTime.\\n   at '
 'System.DateTimeParse.Parse(ReadOnlySpan\\u00601 s, DateTimeFormatInfo dtfi, '
 'DateTimeStyles styles)\\n   at '
 'NzbDrone.Common.Serializer.STJUtcConverter.Read(Utf8JsonReader\\u0026 '
 'reader, Type typeToConvert, JsonSerializerOptions options) in '
 'D:\\\\a\\\\1\\\\s\\\\src\\\\NzbDrone.Common\\\\Serializer\\\\System.Text.Json\\\\STJUtcConverter.cs:line '
 '11\\n   at '
 'System.Text.Json.Serialization.Converters.NullableConverter\\u00601.Read(Utf8JsonReader\\u0026 '
 'reader, Type typeToConvert, JsonSerializerOptions options)\\n   at '
 'System.Text.Json.JsonPropertyInfo\\u00601.ReadJsonAndSetMember(Object obj, '
 'ReadStack\\u0026 state, Utf8JsonReader\\u0026 reader)\\n   at '
 'System.Text.Json.Serialization.Converters.ObjectDefaultConverter\\u00601.OnTryRead(Utf8JsonReader\\u0026 '
 'reader, Type typeToConvert, JsonSerializerOptions options, ReadStack\\u0026 '
 'state, T\\u0026 value)\\n   at '
 'System.Text.Json.Serialization.JsonConverter\\u00601.TryRead(Utf8JsonReader\\u0026 '
 'reader, Type typeToConvert, JsonSerializerOptions options, ReadStack\\u0026 '
 'state, T\\u0026 value)\\n   at '
 'System.Text.Json.Serialization.JsonConverter\\u00601.ReadCore(Utf8JsonReader\\u0026 '
 'reader, JsonSerializerOptions options, ReadStack\\u0026 state)\\n   at '
 'System.Text.Json.Serialization.JsonConverter\\u00601.ReadCoreAsObject(Utf8JsonReader\\u0026 '
 'reader, JsonSerializerOptions options, ReadStack\\u0026 state)\\n   at '
 'System.Text.Json.JsonSerializer.ReadCore[TValue](JsonConverter '
 'jsonConverter, Utf8JsonReader\\u0026 reader, JsonSerializerOptions options, '
 'ReadStack\\u0026 state)\\n   at '
 'System.Text.Json.JsonSerializer.ReadCore[TValue](JsonReaderState\\u0026 '
 'readerState, Boolean isFinalBlock, ReadOnlySpan\\u00601 buffer, '
 'JsonSerializerOptions options, ReadStack\\u0026 state, JsonConverter '
 'converterBase)\\n   at '
 'System.Text.Json.JsonSerializer.ReadAsync[TValue](Stream utf8Json, Type '
 'returnType, JsonSerializerOptions options, CancellationToken '
 'cancellationToken)\\n   at '
 'NzbDrone.Common.Serializer.STJson.Deserialize(Stream input, Type type) in '
 'D:\\\\a\\\\1\\\\s\\\\src\\\\NzbDrone.Common\\\\Serializer\\\\System.Text.Json\\\\STJson.cs:line '
 '50\\n   at Radarr.Http.Extensions.ReqResExtensions.FromJson[T](Stream body, '
 'Type type) in '
 'D:\\\\a\\\\1\\\\s\\\\src\\\\Radarr.Http\\\\Extensions\\\\ReqResExtensions.cs:line '
 '26\\n   at '
 'Radarr.Http.REST.RestModule\\u00601.ReadResourceFromRequest(Boolean '
 'skipValidate, Boolean skipSharedValidate) in '
 'D:\\\\a\\\\1\\\\s\\\\src\\\\Radarr.Http\\\\REST\\\\RestModule.cs:line '
 '253\\n   at '
 'Radarr.Http.REST.RestModule\\u00601.\\u003Cset_CreateResource\\u003Eb__43_0(Object '
 'options) in '
 'D:\\\\a\\\\1\\\\s\\\\src\\\\Radarr.Http\\\\REST\\\\RestModule.cs:line '
 '206\\n   at '
 'Nancy.NancyModule.\\u003C\\u003Ec__DisplayClass38_0\\u00601.\\u003CPost\\u003Eb__0(Object '
 'args)\\n   at '
 'Nancy.NancyModule.\\u003C\\u003Ec__DisplayClass40_0\\u00601.\\u003CPost\\u003Eb__0(Object '
 'args, CancellationToken ct)\\n   at '
 'Nancy.Routing.Route\\u00601.Invoke(DynamicDictionary parameters, '
 'CancellationToken cancellationToken)\\n   at '
 'Nancy.Routing.DefaultRouteInvoker.Invoke(Route route, CancellationToken '
 'cancellationToken, DynamicDictionary parameters, NancyContext context)\\n   '
 'at Nancy.Routing.DefaultRequestDispatcher.Dispatch(NancyContext context, '
 'CancellationToken cancellationToken)\\n   at '
 'Nancy.NancyEngine.InvokeRequestLifeCycle(NancyContext context, '
 'CancellationToken cancellationToken, IPipelines pipelines)"\n'
 '}')
marco@MacBook-Pro-van-Marco ~/D/G/pixlovarr (main) [1]> 

vche commented

probably an issue in pycliarr, i'll take a look, thanks the details