nandyalu / trailarr

Trailarr is a Docker application to download and manage trailers for your media library. It integrates with your existing services, such as Plex, Radarr, and Sonarr!
GNU General Public License v3.0
98 stars 7 forks source link

Error when parsing data from Radarr #7

Closed SerinitySW closed 1 month ago

SerinitySW commented 1 month ago

Hello! Thanks for this project, I've been excited for something like it for awhile!

Unfortunately, when attempting to parse data from Radarr, I seem to get the following error:

For further information visit https://errors.pydantic.dev/2.8/v/missing

Field required [type=missing, input_value={'title': 'Smith', 'origi...roups': []}, 'id': 1686}, input_type=dict]

youTubeTrailerId

pydantic_core._pydantic_core.ValidationError: 1 validation error for RadarrDataParser

self.__pydantic_validator__.validate_python(data, self_instance=self)

File "/usr/local/lib/python3.12/site-packages/pydantic/main.py", line 193, in __init__

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

movie_parsed = RadarrDataParser(**movie_data)

File "/app/backend/core/radarr/data_parser.py", line 39, in parse_movie

self.parse_media(self.connection_id, each_media_data)

File "/app/backend/core/base/connection_manager.py", line 83, in _parse_data

^^^^^^^^^^^^^^^^^^^^^^^^

parsed_media = await self._parse_data()

File "/app/backend/core/base/connection_manager.py", line 156, in refresh

await connection_db_manager.refresh()

File "/app/backend/core/tasks/api_refresh.py", line 45, in api_refresh_by_id

await api_refresh_by_id(connection, image_refresh=False)

File "/app/backend/core/tasks/api_refresh.py", line 24, in api_refresh

File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete

new_loop.run_until_complete(task())

File "/app/backend/core/tasks/schedules.py", line 20, in run_async

run_async(api_refresh)

File "/app/backend/core/tasks/schedules.py", line 27, in _refresh_api_data

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

retval = job.func(*job.args, **job.kwargs)

File "/usr/local/lib/python3.12/site-packages/apscheduler/executors/base.py", line 125, in run_job

Traceback (most recent call last):

2024-08-06T10:20:23-0500 [ERROR|base|L131]: Job "Arr Data Refresh (trigger: interval[1:00:00], next run at: 2024-08-06 11:18:06 CDT)" raised an exception

2024-08-06T10:19:03-0500 [INFO|api_refresh|L032]: APIRefreshTasks: Refreshing data from API for connection: Radarr

I tried restarting Radarr to no avail. I tried readding Radarr to the connection settings, but that also didn't help. Finally, I tried restarting the trailarr container, which unfortunately didn't work either.

I'm on version 0.0.4-beta of Trailarr, running with the CA listing on unRAID (Docker). Radarr is version 5.8.3.8933, also docker.

Thanks for your assistance!

SerinitySW commented 1 month ago

I made two separate Trailarr containers as suggested in #8, however the one for Radarr is still experiencing the same issue as above.

nandyalu commented 1 month ago

Can you go to below address and post the result?

http://192.168.0.15:7878/api/v3/movie?tmdbId=123456&apikey=abcd1234abcd1234abcd1234abcd1234

Replace the following in above:

  1. http://192.168.0.15:7878 with your RADARR_URL
  2. abcd1234abcd1234abcd1234abcd1234 with RADARR_APIKEY
  3. 123456 with tmdbId for 'Smith' movie in your Radarr (For example, when you open a movie in Radarr, if the URL is http://192.168.0.15:7878/movie/533535 then 533535 is tmdbId)
SerinitySW commented 1 month ago

Sure:

[
  {
    "title": "The Adventures of Sharkboy and Lavagirl",
    "originalTitle": "The Adventures of Sharkboy and Lavagirl",
    "originalLanguage": {
      "id": 1,
      "name": "English"
    },
    "alternateTitles": [
      {
        "sourceType": "tmdb",
        "movieMetadataId": 1100,
        "title": "The Adventures of Sharkboy and Lavagirl in 3-D",
        "id": 811
      },
      {
        "sourceType": "tmdb",
        "movieMetadataId": 1100,
        "title": "Sharkboy and Lavagirl",
        "id": 812
      },
      {
        "sourceType": "tmdb",
        "movieMetadataId": 1100,
        "title": "샤크 보이와 라바 걸의 모험",
        "id": 9894
      },
      {
        "sourceType": "tmdb",
        "movieMetadataId": 1100,
        "title": "As Aventuras de Sharkboy e Lavagirl em 3D",
        "id": 45585
      },
      {
        "sourceType": "tmdb",
        "movieMetadataId": 1100,
        "title": "Die Abenteuer von Sharkboy und Lavagirl in 3-D",
        "id": 45709
      },
      {
        "sourceType": "tmdb",
        "movieMetadataId": 1100,
        "title": "Las aventuras del niño Tiburon y la niña de fuego en 3-D",
        "id": 45710
      },
      {
        "sourceType": "tmdb",
        "movieMetadataId": 1100,
        "title": "הרפתקאות שראקבוי ולבהגירל",
        "id": 65120
      }
    ],
    "secondaryYearSourceId": 0,
    "sortTitle": "adventures sharkboy lavagirl",
    "sizeOnDisk": 8529879116,
    "status": "released",
    "overview": "Everyone always knew that Max had a wild imagination, but no one believed that his wildest creations -- a boy raised by watchful great white sharks and a girl with the force of a volcano -- were real. Now, these two pint-sized action masters will show Max that even an ordinary kid has what it takes to be extraordinary.",
    "inCinemas": "2005-06-10T00:00:00Z",
    "physicalRelease": "2006-03-08T00:00:00Z",
    "digitalRelease": "2005-07-28T00:00:00Z",
    "images": [
      {
        "coverType": "poster",
        "url": "/MediaCover/1102/poster.jpg?lastWrite=637914670818201309",
        "remoteUrl": "https://image.tmdb.org/t/p/original/wyXPANZMYYbKh8Ic8qFLqMkolyV.jpg"
      },
      {
        "coverType": "fanart",
        "url": "/MediaCover/1102/fanart.jpg?lastWrite=638452528970922421",
        "remoteUrl": "https://image.tmdb.org/t/p/original/4ZOr50be8XntKw5Eq5n9HmRspNX.jpg"
      }
    ],
    "website": "http://www.miramax.com/movie/the-adventures-of-sharkboy-and-lavagirl/",
    "year": 2005,
    "youTubeTrailerId": "mJP65NQwII8",
    "studio": "Troublemaker Studios",
    "path": "/media/The Adventures of Sharkboy and Lavagirl (2005)",
    "qualityProfileId": 1,
    "hasFile": true,
    "movieFileId": 954,
    "monitored": true,
    "minimumAvailability": "tba",
    "isAvailable": true,
    "folderName": "/media/The Adventures of Sharkboy and Lavagirl (2005)",
    "runtime": 92,
    "cleanTitle": "theadventuressharkboylavagirl",
    "imdbId": "tt0424774",
    "tmdbId": 14199,
    "titleSlug": "14199",
    "rootFolderPath": "/media/",
    "certification": "PG",
    "genres": [
      "Adventure",
      "Family",
      "Science Fiction"
    ],
    "tags": [],
    "added": "2019-03-24T02:52:31Z",
    "ratings": {
      "imdb": {
        "votes": 42927,
        "value": 3.8,
        "type": "user"
      },
      "tmdb": {
        "votes": 1461,
        "value": 5.2,
        "type": "user"
      },
      "metacritic": {
        "votes": 0,
        "value": 38,
        "type": "user"
      },
      "rottenTomatoes": {
        "votes": 0,
        "value": 20,
        "type": "user"
      }
    },
    "movieFile": {
      "movieId": 1102,
      "relativePath": "The Adventures of Sharkboy and Lavagirl (2005) Bluray-1080p.mkv",
      "path": "/media/The Adventures of Sharkboy and Lavagirl (2005)/The Adventures of Sharkboy and Lavagirl (2005) Bluray-1080p.mkv",
      "size": 8529879116,
      "dateAdded": "2019-03-24T02:52:35Z",
      "edition": "",
      "languages": [
        {
          "id": 1,
          "name": "English"
        }
      ],
      "quality": {
        "quality": {
          "id": 7,
          "name": "Bluray-1080p",
          "source": "bluray",
          "resolution": 1080,
          "modifier": "none"
        },
        "revision": {
          "version": 1,
          "real": 0,
          "isRepack": false
        }
      },
      "customFormatScore": 0,
      "indexerFlags": 0,
      "mediaInfo": {
        "audioBitrate": 1536000,
        "audioChannels": 5.1,
        "audioCodec": "DTS",
        "audioLanguages": "eng",
        "audioStreamCount": 1,
        "videoBitDepth": 8,
        "videoBitrate": 0,
        "videoCodec": "x264",
        "videoFps": 23.976,
        "videoDynamicRange": "",
        "videoDynamicRangeType": "",
        "resolution": "1920x1080",
        "runTime": "1:32:33",
        "scanType": "Progressive",
        "subtitles": "eng"
      },
      "qualityCutoffNotMet": false,
      "id": 954
    },
    "collection": {
      "title": "Sharkboy and Lavagirl Collection",
      "tmdbId": 727089
    },
    "popularity": 42.952,
    "statistics": {
      "movieFileCount": 1,
      "sizeOnDisk": 8529879116,
      "releaseGroups": []
    },
    "id": 1102
  }
]

Edit: Realized I used a movie that wasn't downloaded, replaced with one that is.

nandyalu commented 1 month ago

"youTubeTrailerId": "mJP65NQwII8",

I can see that this has "youTubeTrailerId", this would parse without any errors! Can you check with the movie 'Smith' that couldn't parse, see if it has "youTubeTrailerId" coming from Radarr?

SerinitySW commented 1 month ago

Ah! My apologies. I had figured Smith was just an example. Here is the output for that film:

[
  {
    "title": "Smith",
    "originalLanguage": {
      "id": 1,
      "name": "English"
    },
    "alternateTitles": [],
    "secondaryYearSourceId": 0,
    "sortTitle": "smith",
    "sizeOnDisk": 0,
    "status": "deleted",
    "overview": "A sci-fi, horror, comedy hybrid about a secret government agency dedicated to responding to crank calls. While on a routine investigation, Agents Smith & Salisbury discover that a report about a homicidal alien on the loose in the woods who is killing off campers is actually true.",
    "inCinemas": "2019-12-01T06:00:00Z",
    "physicalRelease": "2019-12-01T00:00:00Z",
    "images": [
      {
        "coverType": "poster",
        "url": "/MediaCover/1686/poster.jpg?lastWrite=637781855870383152",
        "remoteUrl": "http://image.tmdb.org/t/p/original/2MOYQrjRCmtVDArEoxR3B5Ictig.jpg"
      }
    ],
    "website": "",
    "year": 2019,
    "studio": "Blinky Productions",
    "path": "/media/Smith (2019)",
    "qualityProfileId": 1,
    "hasFile": false,
    "movieFileId": 0,
    "monitored": true,
    "minimumAvailability": "announced",
    "isAvailable": true,
    "folderName": "/media/Smith (2019)",
    "runtime": 0,
    "cleanTitle": "smith",
    "imdbId": "tt3493042",
    "tmdbId": 422760,
    "titleSlug": "422760",
    "rootFolderPath": "/media/",
    "genres": [],
    "tags": [],
    "added": "2019-03-24T03:58:09Z",
    "ratings": {
      "tmdb": {
        "votes": 1,
        "value": 10.0,
        "type": "user"
      }
    },
    "popularity": 0,
    "statistics": {
      "movieFileCount": 0,
      "sizeOnDisk": 0,
      "releaseGroups": []
    },
    "id": 1686
  }
]
nandyalu commented 1 month ago

That is weird! There is no youTubeTrailerId in that movie data, Radarr API says an empty field is sent (like website below) even if it's not available.

"website": "",

Anyways, I will fix the parser to parse data even if it's not available.