Skip to content

Instantly share code, notes, and snippets.

@goose-ws
Last active August 29, 2024 20:30
Show Gist options
  • Save goose-ws/fb5ba309081b03f77ff39127f7bc563f to your computer and use it in GitHub Desktop.
Save goose-ws/fb5ba309081b03f77ff39127f7bc563f to your computer and use it in GitHub Desktop.
Script to fix TBA titled episodes in Sonarr
This script has been rewritten and improved, and is now located in my `bash scripts` repository: https://github.com/goose-ws/bash-scripts
More specifically, here is the script: https://github.com/goose-ws/bash-scripts/blob/main/sonarr-update-tba.bash
And here is the corresponding `.env` file you need to put in the same directory as the script: https://github.com/goose-ws/bash-scripts/blob/main/sonarr-update-tba.env.example
@SlingerAJ
Copy link

You need to put the script inside /mnt/user/appdata/unmanic and then restart the container. When you restart the container the proper modules will be installed inside the container

OK, moved the script to /mnt/user/appdata/unmanic/startup.sh - it's the only thing in there except the two hidden folders.

Just ran it, one error and two warnings. Can I now restart unmanic or do we need to resolve the problem in line 3?

image

@Egrirt
Copy link

Egrirt commented May 23, 2024

Restart the container and check the logs. You should see both modules being pulled, then make sure that Sonarr plugin in unmanic has the rename option enabled and it should work.

@SlingerAJ
Copy link

Restart the container and check the logs. You should see both modules being pulled, then make sure that Sonarr plugin in unmanic has the rename option enabled and it should work.

Container startup logs - looks ok?

**** (permissions_config) Setting permissions ****
**** (permissions_config) Adding run user to video group ****
**** (custom-setup-script) Calling custom user setup script ****
Get:1 https://deb.nodesource.com/node_20.x nodistro InRelease [12.1 kB]
Get:2 https://deb.nodesource.com/node_20.x nodistro/main amd64 Packages [7,133 B]
Get:3 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:4 https://repo.jellyfin.org/ubuntu jammy InRelease [6,660 B]
Get:5 https://sgp1.mirror.jellyfin.org/files/ubuntu jammy/main amd64 Packages [1,895 B]
Get:6 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:7 https://repositories.intel.com/gpu/ubuntu jammy InRelease [15.4 kB]
Err:7 https://repositories.intel.com/gpu/ubuntu jammy InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 28DA432DAAC8BAEA
Get:8 http://archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy/multiverse Sources [361 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy/main Sources [1,668 kB]
Get:11 http://archive.ubuntu.com/ubuntu jammy/restricted Sources [28.2 kB]
Get:12 http://archive.ubuntu.com/ubuntu jammy/universe Sources [22.0 MB]
Get:13 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1,792 kB]
Get:15 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
Get:16 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy-updates/universe Sources [415 kB]
Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse Sources [21.9 kB]
Get:19 http://archive.ubuntu.com/ubuntu jammy-updates/main Sources [611 kB]
Get:20 http://archive.ubuntu.com/ubuntu jammy-updates/restricted Sources [78.2 kB]
Get:21 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [2,125 kB]
Get:22 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [2,468 kB]
Get:23 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1,375 kB]
Get:24 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [51.1 kB]
Get:25 http://archive.ubuntu.com/ubuntu jammy-security/universe Sources [238 kB]
Get:26 http://archive.ubuntu.com/ubuntu jammy-security/restricted Sources [73.9 kB]
Get:27 http://archive.ubuntu.com/ubuntu jammy-security/main Sources [337 kB]
Get:28 http://archive.ubuntu.com/ubuntu jammy-security/multiverse Sources [12.2 kB]
Get:29 http://archive.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [2,395 kB]
Get:30 http://archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages [1,853 kB]
Get:31 http://archive.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [1,083 kB]
Get:32 http://archive.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [44.7 kB]
Reading package lists...
Collecting pyarr
Downloading pyarr-5.2.0-py3-none-any.whl (39 kB)
Requirement already satisfied: requests<3.0.0,>=2.28.2 in /usr/local/lib/python3.10/dist-packages (from pyarr) (2.31.0)
Collecting types-requests<3.0.0.0,>=2.28.11.17
Downloading types_requests-2.32.0.20240523-py3-none-any.whl (15 kB)
Collecting overrides<8.0.0,>=7.3.1
Downloading overrides-7.7.0-py3-none-any.whl (17 kB)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.28.2->pyarr) (2024.2.2)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.28.2->pyarr) (3.3.2)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.28.2->pyarr) (2.2.1)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.28.2->pyarr) (3.7)
Installing collected packages: types-requests, overrides, pyarr
Successfully installed overrides-7.7.0 pyarr-5.2.0 types-requests-2.32.0.20240523
Collecting humanfriendly
Downloading humanfriendly-10.0-py2.py3-none-any.whl (86 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.8/86.8 KB 2.4 MB/s eta 0:00:00
Installing collected packages: humanfriendly
Successfully installed humanfriendly-10.0
[custom-init] No custom files found, skipping...
[ls.io-init] done.

@Egrirt
Copy link

Egrirt commented May 23, 2024

Yep it should work now

@SlingerAJ
Copy link

It works - YOU BEAUTY!

Thanks for all the support, so what did we just do, install python3 in the container so python based plugins can work? I wonder why this isn't installed as standard if it's a dependency for some of the plugins.

For some reason Unmanic (since the first re-start) has now found 1500 files to transcode, most of which are failing (output file larger than the input file). The only prior change was to set the minimum file size to 300M (it was 500M). Might change it back as small x264 files don't seem to benefit from transcoding in terms of size reduction.

Thanks so much, wouldn't have figured this out myself in a month of Sundays and didn't find anything when i googled the problem for the plugin/unmanic.

@Egrirt
Copy link

Egrirt commented May 23, 2024

We just installed the missing modules needed by the Sonarr and Radarr plugins. Python3 already comes installed by default, but the modules were missing. By keeping the startup script there it will always reinstall them even if you rebuild the container. Enjoy

@SlingerAJ
Copy link

Brilliant, thanks again!

@SlingerAJ
Copy link

Been watching it for a day now, it's very cool to see it all working properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment