samwiseg0 / better-discord-notifications

Scripts that send better sonarr/radarr notifications to discord
GNU General Public License v3.0
15 stars 0 forks source link

Radarr Script giving errors - #5

Open xxtensazenxx opened 4 years ago

xxtensazenxx commented 4 years ago

https://puu.sh/FtfSZ/4fd360a2f7.png

Sonarr script is working perfectly but run into errors with the radarr one. I'm ok at troubleshooting but This is beyond me here. Can provide more info if needed

samwiseg0 commented 4 years ago

Are you running it in docker?

xxtensazenxx commented 4 years ago

No docker; I've never used it before

samwiseg0 commented 4 years ago

Did you set all the configuration perams? https://github.com/samwiseg0/better-discord-notifications/blob/master/script_config.example.py

Step 3

xxtensazenxx commented 4 years ago

Yup; everything is configured, I double checked

put my radarr API key under radarr_key=, made a movieDB api and put that key under moviedb_key =, and a IMDBAPI key too.

I think the errors may be python related?

samwiseg0 commented 4 years ago

Maybe. cd to the folder and just run the script example: python3 ./radarr-discord.py

Paste the output.

xxtensazenxx commented 4 years ago

Traceback (most recent call last): File "./radarr_discord.py", line 84, in radarr_data = radarr.json() File "/home/matt/.local/lib/python3.6/site-packages/requests/models.py", line 898, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.6/json/init.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

samwiseg0 commented 4 years ago

Your radarr URL is wrong or it cannot get to the API. Which is /api. Make sure you do not have basic auth enabled for /api. It is best to use localhost and the port and not through any reverse proxy.

xxtensazenxx commented 4 years ago

Ah my bad! updated the urls using localhost; new output when I run the radarr script

Traceback (most recent call last): File "./radarr_discord.py", line 87, in year = radarr_data['year'] KeyError: 'year'

and sonarr.py output is this Traceback (most recent call last): File "sonarr_discord.py", line 182, in main() File "sonarr_discord.py", line 58, in main title_slug = skyhook_data['slug'] KeyError: 'slug'

samwiseg0 commented 4 years ago

Radarr error is "normal" test it from the UI now. Same with sonarr? Try that one from the UI as well.

xxtensazenxx commented 4 years ago

Ok, sonarrr is working now; Radarr is doing nothing now, No output in Radarr logs or radarr_notification.log

samwiseg0 commented 4 years ago

try running radarr_eventtype='test' bash -c 'python3 radarr_discord.py' from the commandline. That would simulate the same thing as radarr running the test itself.

xxtensazenxx commented 4 years ago

Output

Traceback (most recent call last): File "radarr_discord.py", line 133, in quality_profile = get_profile_name(radarr_data['qualityProfileId']) KeyError: 'qualityProfileId'

samwiseg0 commented 4 years ago

Are you running v3?

xxtensazenxx commented 4 years ago

Radarr I'm running 0.2.0.1480, which is up to date I believe?

also here's the output when I tried again https://i.imgur.com/bwn4Qpz.png (On radarr)

samwiseg0 commented 4 years ago

That is v2. The script works for Aphrodite. I don't think it will work with that version. I never tested it with the older version. https://hub.docker.com/r/hotio/radarr hotio/radarr:aphrodite

samwiseg0 commented 4 years ago

You can pull the script before it was updated for v3. https://github.com/samwiseg0/better-discord-notifications/tree/787db54ae9ac9b8b43a8d2d01c788c8342f0bc49

xxtensazenxx commented 4 years ago

It seems V3 is still very nightly, so I'm hesitant to upgrade to it before its on github, also I have no idea how to use docker.

I re-did everything with the script you linked but the final error I get for radarr is

radarr_discord.py Traceback (most recent call last): 8:11pm radarr_discord.py File "/home/(removed)/scripts/discordnotify/radarr_discord.py", line 66, in 8:11pm radarr_discord.py year = radarr_data['year'] 8:11pm radarr_discord.py KeyError: 'year'

when I just run the script with your command radarr_eventtype='test' bash -c 'python3 radarr_discord.py'

It just posts the lego movie in the discord.

samwiseg0 commented 4 years ago

If it posts the lego movie then it worked. If there was an error it would not have posted at all. It should work now.

xxtensazenxx commented 4 years ago

Weird, I keep trying it It says the KeyError 'Year' in the radarr logs :O

samwiseg0 commented 4 years ago

have you tried just downloading a movie and see if it works?

xxtensazenxx commented 4 years ago

Yup, that's how i've been testing it. I just downloaded a few movies and each time it finishes it gives me the previous error with the "KeyError: 'year'" errors

samwiseg0 commented 4 years ago

But does it post to discord successfully?

xxtensazenxx commented 4 years ago

Nope, it does not post to the discord

samwiseg0 commented 4 years ago

What does http://URL:PORT/api/movie/10?apikey=APIKEYreturn?

xxtensazenxx commented 4 years ago

{ "message": "NotFound" }

should I maybe reset API key?

samwiseg0 commented 4 years ago

This is not making sense. 1) When testing the script does it post to discord? 2) When downloading something and having the script run it errors with KeyError: 'year'"? If that is the case something is still wrong with your radarr URL/API key in the config.

When doing the test it ignores anything coming from the radarr API and that is why it would succeed.

Make sure you are setting it exactly as the example shows in the config:

radarr_url = 'http://movies.domain.ltd/' # Make sure you include the trailing /
radarr_key = 'XXXXXXXXXXXXXXXX'

You do not need to reset the API key. You would get a different error.

samwiseg0 commented 4 years ago

@xxtensazenxx Did you get this figured out?

xxtensazenxx commented 4 years ago

Nope, not yet. I checked and its configured as you described... maybe I'll just upgrade to v3. Is there any way to download it besides the docker:?>

samwiseg0 commented 4 years ago

They only have docker images for v3 unless you build it yourself.