Does "Upcoming Media Card" "Sonarr Upcoming Media" still work?

I’m no expert either. But both my Sonarr V3 and Radarr V4 use the path below:

http://{insert your sonarr/radarr 
address:port}/api/v3/calendar?apikey={insert your sonarr/radarr API 
key}

I know that Sonarr V4 beta mentioned they removed the V2 API. However, I think it still uses API V3 looking at the path above. Maybe it’s wishful thinking. Can you please double-check on Discord if they also removed API V3?

mkanet,

can you run a /api call and send me the raw JSON (un-truncated, preferably).

I have a Python coder willing to help me parse through the returned data and try to figure this out.

you could pastebin it

Totally! Ill provide the full raw API response later this evening via PM. I have to go pickup the kids from school. I will also provide any other information youll need after that until we hopefully have a solution. Thanks!

Just an FYI, my guy said he would look at the two JSON outputs and the scripts tomorrow. I sent him mine already; we just need yours.

If you’re running Sonarr v4 change the following lines

card_item['fanart'] = re.sub('.jpg', '_t.jpg', img['url']) to card_item['fanart'] = re.sub('.jpg', '_t.jpg', img['remoteUrl'])

and

card_item['poster'] = re.sub('.jpg', '_t.jpg', img['url']) to card_item['poster'] = re.sub('.jpg', '_t.jpg', img['remoteUrl'])

@bacco007 so, if I have Sonarr V4,

Edit the file:
\config\custom_components\sonarr_upcoming_media\sensor.py

Change:

card_item['fanart'] = re.sub('.jpg', '_t.jpg', img['url'])

to

card_item['fanart'] = re.sub('.jpg', '_t.jpg', img['remoteUrl'])

.

AND…
.

Change:

card_item['poster'] = re.sub('.jpg', '_t.jpg', img['url']) 

to

card_item['poster'] = re.sub('.jpg', '_t.jpg', img['remoteUrl'])

I will do this as soon a Sonarr V4 is out of beta. Thank you so much for this!

1 Like

Yes, that should fix the problem (did for me)

1 Like

This still does not address the change in URL for API calls in v4.

edit line 142 to add in ‘v3’

api = requests.get('http{0}://{1}:{2}/{3}api/v3/calendar?start={4}'

I’m not sure which lines you are referring to. I’ve looked at my sensor.py, and those lines do not exist.

Which lines are you referring to in this source code?

@quadcom thanks for replying. Here they are:

Change:

Change:

You can edit your local sensor.py. Mine is located here:
\config\custom_components\sonarr_upcoming_media\sensor.py

I still haven’t upgraded to Sonarr V4 since its still in beta. Maybe you can try it after changing these lines? I can’t imagine Sonarr V4 being that much different than Radarr V4. The developer purposefully tried to keep things consistent between the 2 projects.

In any case, maybe @bacco007 can elaborate.

Having some trouble getting the card to populate here.

I’ve done all the sensor.py edits and it’s connecting, according to the HA states, but not populating and reads as 0 upcoming, but calling the API works fine.

(I can only post one embed per post as a new member, sorry if you get too many notifications!)

I still haven’t upgraded to Sonarr V4. I’m hoping @bacco007 or someone else here who’s successfully done this for Sonarr V4 can elaborate. I’m not sure how else to get a hold of @bacco007

I’m here :wink:

I’m pretty sure I’m running sonarr 4 and it works fine - I’ll check tonight though

2 Likes

Thank you. We just need to see what specifically you modified in the original code for Sonarr V4 support. A couple of people unsuccessfully tried to follow your suggestion. I think there may be something we’re missing besides making the changes below:

This is sensor.py file that I run - you should be able to copy this completely and paste it into your sensor.py (overwrite the whole file) and it should work fine

(To confirm, yes, I’m running Sonarr v4)

4 Likes

Thanks @bacco007! It finally works! v4 here.

1 Like

@seriosbrad @bacco007 thank you so much! We finally have have a confirmed working solution we can just copy. I am going to upgrade to Sonarr V4 soon since this is now confirmed as working.

1 Like

Hey, maybe you guys knows this

I need to connect to an seedbox but get cannot reach xx.xxx

both with sonarr and radarr, is there someway to test it?

  - platform: radarr_upcoming_media
    api_key: API key here
    host: 46.232.xxx.xxx
    port: 12XXX
    days: 14
    ssl: false
    theaters: false
    max: 10

i get an JSON when i run this

http://{insert your sonarr/radarr 
address:port}/api/v3/calendar?apikey={insert your sonarr/radarr API 
key}