Getting the episode name for custom script

Hi!

I discovered Sonarr like two days ago and I have already forgot about sickbeard, it is so much better and the hability of having custom scripts is really awesome. I am implemeting my own notification script to send message to the Telegram IM service using bots. While doing this I was reading the wiki

and I dont see any field which gives the episode name itself. Just the number and the series name and so on but not the episode name. Am I missing something? Maybe this is a very simple question.

Thanks a lot!
Juanpe

I have my custom bot for telegram in bash, i use it for sending some commands, add series, retrieve information and send me messages for downloads. For downloads i just use the release name. But if you want the episode name ( i also don’t see it in the vars) you can fetch it with the sonarr api with seriesId and epsiodefileId.

curl -s http://10.10.10.12:8989/api/episode?seriesId=41 -H "$API_SONARR" --compressed

41 is the value id for homeland, this will output the whole series, so then you need to filter with then episodefileid

To parse the json output. In my case i use jq from here https://stedolan.github.io/jq/

thanks so much! I didin’t even thought tha tI could do that with Sonar API. I will take alook into it. Just one question, what is the API_SONARR var you are using for header.?

Is the api key. Is in general settings of the Webui.

The header is

“X-Api-Key: longkey”

Thanks again, sorry for the stupid question, when I went looking to the api I figured it out. I have it working now! Thanks!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.