Sonarr version (exact version): 3.0.10.1567, release-657f4ee by hotio Mono version (if Sonarr is not running on Windows): 6.12.0.182 OS: Docker Container on a Synology NAS setup using Trash Guides Debug logs: Description of issue: I am trying to mark an episode unmonitored on download (grab). I found someone that provided this python script that is supposed to do this (please don’t ask me why I want to do this, I just want to do it, thank you). I am attempting to learn Python but my knowledge is not very good right now. I used this script here:
I added all of my variables, sonarr_ip, sonarr_port and sonarr_api_token and tested it.
It did not work. Looking at the logs, the first error I see is an error on line 40 to “import requests”. Whatever this is, it isn’t working.
Next, I am getting unauthorized errors in trying to pass the URL that will unmonitor the show.
2023-03-25 11:39:44.5|Error|unmonitor_downloaded_episodes.py|Traceback (most recent call last): 2023-03-25 11:39:44.5|Error|unmonitor_downloaded_episodes.py| File “/config/Scripts/unmonitor_downloaded_episodes.py”, line 40, in 2023-03-25 11:39:44.5|Error|unmonitor_downloaded_episodes.py| import requests
2023-03-25 11:39:44.5|Error|unmonitor_downloaded_episodes.py|ModuleNotFoundError: No module named ‘requests’
2023-03-25 11:41:48.2|Info|DiskScanService|Scanning Shrinking
2023-03-25 11:41:48.2|Info|DiskScanService|Completed scanning disk for Shrinking
2023-03-25 11:41:48.2|Info|ExistingMetadataImporter|Found 0 existing metadata files
2023-03-25 11:41:48.2|Info|ExistingSubtitleImporter|Found 1 existing subtitle files
2023-03-25 11:41:48.4|Info|ExistingOtherExtraImporter|Found 0 existing other extra files
2023-03-25 11:41:48.4|Info|ExistingExtraFileService|Found 8 possible extra files, imported 8 files. 2023-03-25 11:44:04.9|Info|Auth|Auth-Unauthorized ip 172.20.0.1 url ‘http://192.168.86.34:8989/api/v3/episode/monitor,411364,'monitored’: False’ 2023-03-25 11:44:08.3|Info|Auth|Auth-Unauthorized ip 172.20.0.1 url 'http://192.168.86.34:8989/series/shrinking’ 2023-03-25 11:44:10.0|Info|Auth|Auth-Unauthorized ip 172.20.0.1 url 'http://192.168.86.34:8989/initialize.js’ 2023-03-25 11:44:16.6|Info|Auth|Auth-Unauthorized ip 172.20.0.1 url 'http://192.168.86.34:8989/api/v3/episode/monitor’ 2023-03-25 11:44:20.9|Info|Auth|Auth-Unauthorized ip 172.20.0.1 url 'http://192.168.86.34:8989/series/shrinking’ 2023-03-25 11:44:22.7|Info|Auth|Auth-Unauthorized ip 172.20.0.1 url 'http://192.168.86.34:8989/initialize.js’ 2023-03-25 11:44:30.3|Info|Auth|Auth-Unauthorized ip 172.20.0.1 url 'http://192.168.86.34:8989/api/v3/episode’
Funnily enough ive come across this exact issue with the same docker image and script. I think its because hotio sonarr doesnt have python installed so the script wont run. If i use the ‘sma’ sonarr image and then install ‘requests’ on the docker container the .py file passes (green tick) on sonarr
Hold on, hotio does have python (linuxserver does not). If you cli to the container, run /usr/bin/python3 -m ensurepip , then run /usr/bin/python3 -m pip install requests
Try the script now. Trouble being this wont persist across container recreations…
Dumb question. How do I do that? I am familiar with ssh into a PC but I am not sure how to do it into a docker container. I tried ssh’ing into the NAS IP and Sonarr port as user docker. But that didn’t work.
If I go into DSM and then I to docker, and then try to terminal into the sonarr container I get a terminal screen but I cannot type into it.
Thanks. I found a way to enter one command at a time into the Synology GUI…but it told me that the owner was different (I was logged into DSM as a different user than the container install). And it still isn’t working.
So when my container upgrades/rebuilds using Pullio, it will revert back correct? I am fine with that right now…I can keep working with it, but it would be good to know it will go back in case I screw it up too bad.
Yep it will revert. Use the commands in my.latest post and itll.work, I’ve just tried it. BUT the commands have to be entered on the running docker container, not Synology host itself (use portainer).
Very cool, thank you. I am going to try to get the whole thing working on what I have (so I can easily reset it) and when I fully understand what’s going on, I can move over to this version. I am not a yaml expert either and will need to modify the existing yaml that currently, neatly installs and upgrades my entire system.
I think the reason why we’re struggling with the script is because it’s assumed you’ll be running Sonarr on a system where you can easily install python i.e Windows or a LInux distribution and not inside a Docker container. I’m using it on a Synology NAS with a docker-compose file - now when an episode is downloaded it’ll automatically unmonitor rather than download an ‘upgrade’ (preferred words) even when I have upgrades disabled. The sonarr team have no interest in changing this behaviour but at least with some effort we can get this script working.