Herjar / radarr_sonarr_watchmon

GNU General Public License v3.0
44 stars 14 forks source link

Radarr returned status code 200 #10

Open karan opened 3 years ago

karan commented 3 years ago

Radarr can return status code 200 however this has 2 problems:

  1. The movie is still not marked unmonitored.
  2. The error condition raises an error because r.json() is a list of all movies.

    Traceback (most recent call last):
      File "radarr_sonarr_watchmon.py", line 423, in <module>
        app.radarr(recent_days, radarr_address, radarr_apikey)
      File "radarr_sonarr_watchmon.py", line 130, in radarr
        print("   Error: "+str(r.json()["message"]))
    TypeError: list indices must be integers or slices, not str

Radarr Version: 3.2.2.5080

Herjar commented 3 years ago

I have not seen that on my end, but 200 is not an error so I made a small update to avoid printing the error message: 0075628e6da6bd06e9ba4bac0b00939ed5cd7975

200 is a successful request though, so not sure why it is not unmonitored. Do you have some steps to reproduce it?

karan commented 3 years ago

Okay now the script does not error but the movie is also not marked unmonitored. Here's radarr's trace logs (a single movie was supposed to be changed to unmonitored):

2021-06-29 16:51:17.9|Trace|Http|Req: 235 [GET] /api/v3/movie?apikey=(removed) (from ::ffff:$IP_REMOVED python-requests/2.22.0)
2021-06-29 16:51:17.9|Trace|Http|Res: 235 [GET] /api/v3/movie?apikey=(removed) 303.SeeOther (2 ms)
2021-06-29 16:51:17.9|Debug|Api|[GET] /api/v3/movie?apikey=(removed) 303.SeeOther (2 ms)
2021-06-29 16:51:17.9|Trace|Http|Req: 236 [GET] /api/v3/movie?apikey=(removed) (from ::ffff:$IP_REMOVED python-requests/2.22.0)
2021-06-29 16:51:17.9|Trace|ConfigService|Using default config value for 'movieinfolanguage' defaultValue:'1'
2021-06-29 16:51:17.9|Trace|ConfigService|Using default config value for 'availabilitydelay' defaultValue:'0'
2021-06-29 16:51:18.0|Trace|Http|Res: 236 [GET] /api/v3/movie?apikey=(removed) 200.OK (154 ms)
2021-06-29 16:51:18.0|Debug|Api|[GET] /api/v3/movie?apikey=(removed) 200.OK (154 ms)
2021-06-29 16:51:18.3|Trace|Http|Req: 237 [PUT] /api/v3/movie?apikey=(removed) (from ::ffff:$IP_REMOVED python-requests/2.22.0)
2021-06-29 16:51:18.3|Trace|Http|Res: 237 [PUT] /api/v3/movie?apikey=(removed) 303.SeeOther (0 ms)
2021-06-29 16:51:18.3|Debug|Api|[PUT] /api/v3/movie?apikey=(removed) 303.SeeOther (0 ms)
2021-06-29 16:51:18.3|Trace|Http|Req: 238 [GET] /api/v3/movie?apikey=(removed) (from ::ffff:$IP_REMOVED python-requests/2.22.0)
2021-06-29 16:51:18.3|Trace|ConfigService|Using default config value for 'movieinfolanguage' defaultValue:'1'
2021-06-29 16:51:18.3|Trace|ConfigService|Using default config value for 'availabilitydelay' defaultValue:'0'
2021-06-29 16:51:18.4|Trace|Http|Res: 238 [GET] /api/v3/movie?apikey=(removed) 200.OK (159 ms)
2021-06-29 16:51:18.4|Debug|Api|[GET] /api/v3/movie?apikey=(removed) 200.OK (159 ms)
2021-06-29 16:51:20.0|Trace|Http|Req: 239 [GET] /logfile/radarr.trace.txt (from ::ffff:172.21.0.2 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36)

I'll see what else I can find.

karan commented 3 years ago

So no luck. If I get the movie right after it updates it, I still see it's monitored.

It's not an auth issue since according to the logs the PUT response is a 303 (what? why not 200? the python script sees a 200 infact). Not sure if it's relevant but the response of the PUT request (r.json()) is a list of all the movies. Is that expected or should it only be the movie that was updated?

X-Light commented 10 months ago

Today I faced the same issue and found out that the reason for this is my URL Base. So you have to edit the python script and add it in front of /api/v3, for example -> /radarr/api/v3