mdhiggins / sickbeard_mp4_automator

Automatically convert video files to a standardized format with metadata tagging to create a beautiful and uniform media library
MIT License
1.52k stars 202 forks source link

Issue with Setup on New Container #1610

Closed zeieri closed 2 years ago

zeieri commented 2 years ago

Describe the bug When installing, get an error stating the location of the scripts is invalid:

NZBGetPostProcess: Wrong path to sickbeard_mp4_automator: /root/downloads/sickbeard_mp4_automator/ --

Command or context you are trying to run This occurs within Nzbget. File downloads, post process begins, hits the above error and goes to a status of "PP-Failure"

autoProcess.ini settings `[Converter] ffmpeg = ffmpeg.exe ffprobe = ffprobe.exe threads = 0 hwaccels = hwaccel-decoders = hwdevices = hwaccel-output-format = output-directory = output-format = mp4 output-extension = mp4 temp-extension = minimum-size = 0 ignored-extensions = nfo, dsstore copy-to = move-to = delete-original = True process-same-extensions = False bypass-if-copying-all = False force-convert = False post-process = False wait-post-process = False detailed-progress = False opts-separator = , preopts = postopts = regex-directory-replace = [^\w-. ]

[Permissions] chmod = 0777 uid = -1 gid = -1

[Metadata] relocate-moov = True full-path-guess = True tag = True tag-language = eng download-artwork = poster sanitize-disposition = strip-metadata = False keep-titles = False

[Video] codec = h264, x264 max-bitrate = 0 bitrate-ratio = crf = -1 crf-profiles = preset = codec-parameters = dynamic-parameters = False max-width = 0 profile = max-level = 0.0 pix-fmt = prioritize-source-pix-fmt = True filter = force-filter = False

[HDR] codec = pix-fmt = space = bt2020nc transfer = smpte2084 primaries = bt2020 preset = codec-parameters = filter = force-filter = False profile =

[Audio] codec = ac3 languages = default-language = first-stream-of-language = False allow-language-relax = True channel-bitrate = 128 variable-bitrate = 0 max-bitrate = 0 max-channels = 0 filter = profile = force-filter = False sample-rates = sample-format = copy-original = False aac-adtstoasc = False ignored-dispositions = unique-dispositions = False stream-codec-combinations =

[Audio.Sorting] sorting = language, channels.d, map, d.comment default-sorting = channels.d, map, d.comment codecs =

[Universal Audio] codec = aac channel-bitrate = 128 variable-bitrate = 0 first-stream-only = False filter = profile = force-filter = False

[Audio.ChannelFilters] 6-2 = pan=stereo|FL=0.5FC+0.707FL+0.707BL+0.5LFE|FR=0.5FC+0.707FR+0.707BR+0.5LFE

[Subtitle] codec = mov_text codec-image-based = languages = default-language = first-stream-of-language = False encoding = burn-subtitles = False burn-dispositions = embed-subs = True embed-image-subs = False embed-only-internal-subs = False filename-dispositions = forced ignore-embedded-subs = False ignored-dispositions = unique-dispositions = False attachment-codec = remove-bitstream-subs = False

[Subtitle.Sorting] sorting = language, d.comment, d.default.d, d.forced.d codecs =

[Subtitle.CleanIt] enabled = False config-path = tags =

[Subtitle.Subliminal] download-subs = False download-hearing-impaired-subs = False providers =

[Subtitle.Subliminal.Auth] opensubtitles = tvsubtitles =

[Sonarr] host = sonarr port = 8990 apikey = ssl = False webroot = /sonarr force-rename = False rescan = True block-reprocess = False

[Radarr] host = radarr port = 7878 apikey = ssl = False webroot = /radarr force-rename = False rescan = True block-reprocess = False

[Sickbeard] host = localhost port = 8081 ssl = False apikey = webroot = username = password =

[Sickrage] host = localhost port = 8081 ssl = False apikey = webroot = username = password =

[SABNZBD] convert = True sickbeard-category = sickbeard sickrage-category = sickrage sonarr-category = sonarr radarr-category = radarr bypass-category = bypass output-directory = path-mapping =

[Deluge] sickbeard-label = sickbeard sickrage-label = sickrage sonarr-label = sonarr radarr-label = radarr bypass-label = bypass convert = True host = localhost port = 58846 username = password = output-directory = remove = False path-mapping =

[qBittorrent] sickbeard-label = sickbeard sickrage-label = sickrage sonarr-label = sonarr radarr-label = radarr bypass-label = bypass convert = True action-before = action-after = host = localhost port = 8080 ssl = False username = password = output-directory = path-mapping =

[uTorrent] sickbeard-label = sickbeard sickrage-label = sickrage sonarr-label = sonarr radarr-label = radarr bypass-label = bypass convert = True webui = False action-before = action-after = host = localhost ssl = False port = 8080 username = password = output-directory = path-mapping =

[Plex] host = localhost port = 32400 refresh = True token =

`

Log files Include log files for the specific job (not just a dump of all your logs for the past month) that's causing the issue. Please turn on debug level logging Log files are found in your script root config folder ./sma/config/sma.log No log found in the specific location. Here is the logs from Nzbget:

`

[INFO] nzbget 21.1 server-mode -- Mon, Aug 22 2022 3:42:21 pm | [INFO] Post-processing again Last.Week.Tonight.with.John.Oliver.S09E21.720p.WEB.H264-GLHF Mon, Aug 22 2022 3:42:21 pm | [INFO] Last.Week.Tonight.with.John.Oliver.S09E21.720p.WEB.H264-GLHF returned from history back to download queue Mon, Aug 22 2022 3:42:21 pm | [INFO] Queueing Last.Week.Tonight.with.John.Oliver.S09E21.720p.WEB.H264-GLHF for post-processing Mon, Aug 22 2022 3:42:21 pm | [INFO] Cleaning up Last.Week.Tonight.with.John.Oliver.S09E21.720p.WEB.H264-GLHF Mon, Aug 22 2022 3:42:21 pm | [INFO] Nothing to cleanup for Last.Week.Tonight.with.John.Oliver.S09E21.720p.WEB.H264-GLHF Mon, Aug 22 2022 3:42:21 pm | [INFO] Executing post-process-script NZBGetPostProcess.py for Last.Week.Tonight.with.John.Oliver.S09E21.720p.WEB.H264-GLHF Mon, Aug 22 2022 3:42:21 pm | [INFO] NZBGetPostProcess: /usr/lib/python3.9/site-packages/requests/__init__.py:102: RequestsDependencyWarning: urllib3 (1.26.7) or chardet (5.0.0)/charset_normalizer (2.0.7) doesn't match a supported version! Mon, Aug 22 2022 3:42:21 pm | [INFO] NZBGetPostProcess: warnings.warn("urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn't match a supported " Mon, Aug 22 2022 3:42:22 pm | [INFO] NZBGetPostProcess: Traceback (most recent call last): Mon, Aug 22 2022 3:42:22 pm | [INFO] NZBGetPostProcess: File "/downloads/sickbeard_mp4_automator/NZBGetPostProcess.py", line 81, in Mon, Aug 22 2022 3:42:22 pm | [INFO] NZBGetPostProcess: from resources.mediaprocessor import MediaProcessor Mon, Aug 22 2022 3:42:22 pm | [INFO] NZBGetPostProcess: File "/downloads/sickbeard_mp4_automator/resources/mediaprocessor.py", line 12, in Mon, Aug 22 2022 3:42:22 pm | [INFO] NZBGetPostProcess: from resources.metadata import Metadata, MediaType Mon, Aug 22 2022 3:42:22 pm | [INFO] NZBGetPostProcess: File "/downloads/sickbeard_mp4_automator/resources/metadata.py", line 8, in Mon, Aug 22 2022 3:42:22 pm | [INFO] NZBGetPostProcess: import tmdbsimple as tmdb Mon, Aug 22 2022 3:42:22 pm | [INFO] NZBGetPostProcess: ModuleNotFoundError: No module named 'tmdbsimple' Mon, Aug 22 2022 3:42:22 pm | [ERROR] NZBGetPostProcess: Wrong path to sickbeard_mp4_automator: /root/downloads/sickbeard_mp4_automator/ Mon, Aug 22 2022 3:42:22 pm | [ERROR] NZBGetPostProcess: None Mon, Aug 22 2022 3:42:22 pm | [ERROR] Post-process-script NZBGetPostProcess.py for Last.Week.Tonight.with.John.Oliver.S09E21.720p.WEB.H264-GLHF failed (terminated with unknown status) Mon, Aug 22 2022 3:42:22 pm | [INFO] Collection Last.Week.Tonight.with.John.Oliver.S09E21.720p.WEB.H264-GLHF added to history

`

FFMpeg headers Run ffmpeg and post the headers, example [headers]https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/FFMPEG-Headers

System Information

  • OS: Docker
  • Python 3
  • Docker config (if relevant)

Expected behavior Expect post-processing to proceed and convert file before handing back to Sonarr.

Additional context I had this working previously using a docker container that hasn't been maintained. I'm trying to get this updated and am now using the linuxserver.io Nzbget (latest) container with a startup script installing ffmpeg and python3.

Issues posted without any logs or autoProcess settings will be closed

mdhiggins commented 2 years ago

You might want to share you startup script as it looks like it's not configured correctly; you've got windows formatted executables for ffmpeg despite being on linux, looks like 2 different paths pointing to the script directory, and missing dependencies (tmdbsimple not found)

Also if you're using the linuxserver containers you might just want to use sma-mod which will handle all that for you

https://github.com/mdhiggins/sma-mod

https://github.com/linuxserver/docker-mods

zeieri commented 2 years ago

Well I just wasted the last couple hours! Give me some time do digest this and I'll report back.

Separate note - absolutely wonderful tool. I've been using it for many years (even pre docker). Always reliable once I get it working!

zeieri commented 2 years ago

Same issue!

ERROR Mon Aug 22 2022 23:58:42 Post-process-script NZBGetPostProcess.py for Media_Folder failed (terminated with unknown status)
ERROR Mon Aug 22 2022 23:58:42 NZBGetPostProcess: None
ERROR Mon Aug 22 2022 23:58:42 NZBGetPostProcess: Wrong path to sickbeard_mp4_automator: /usr/local/sma/
INFO Mon Aug 22 2022 23:58:42 NZBGetPostProcess: ModuleNotFoundError: No module named 'tmdbsimple'
INFO Mon Aug 22 2022 23:58:42 NZBGetPostProcess: import tmdbsimple as tmdb
INFO Mon Aug 22 2022 23:58:41 NZBGetPostProcess: File "/usr/local/sma/resources/metadata.py", line 8, in
INFO Mon Aug 22 2022 23:58:41 NZBGetPostProcess: from resources.metadata import Metadata, MediaType
INFO Mon Aug 22 2022 23:58:41 NZBGetPostProcess: File "/usr/local/sma/resources/mediaprocessor.py", line 12, in
INFO Mon Aug 22 2022 23:58:41 NZBGetPostProcess: from resources.mediaprocessor import MediaProcessor
INFO Mon Aug 22 2022 23:58:41 NZBGetPostProcess: File "/usr/local/sma/NZBGetPostProcess.py", line 81, in
INFO Mon Aug 22 2022 23:58:41 NZBGetPostProcess: Traceback (most recent call last):

I have the DOCKER_MODS env set to "mdhiggins/sma-mod:latest". I confirmed the files show up and Python is installed. I have the autoProcess.ini under /usr/local/sma/config and can confirm I can browse to it.

I do not have a "sma.log" file under "/usr/local/sma/config" to give you.

Is it possible that I need a different autoProcess.ini file (re-using the same one from earlier, windows version maybe?).

Thanks!

mdhiggins commented 2 years ago

Make sure for NZBGet you're pointing it to NZBGetPostProcess.venv.py and not the regular one

zeieri commented 2 years ago

I changed it over to that but same set of errors:

ERROR Tue Aug 23 2022 09:16:33 NZBGetPostProcess: None
ERROR Tue Aug 23 2022 09:16:33 NZBGetPostProcess: Wrong path to sickbeard_mp4_automator: /usr/local/sma/
INFO Tue Aug 23 2022 09:16:33 NZBGetPostProcess: ModuleNotFoundError: No module named 'tmdbsimple'
INFO Tue Aug 23 2022 09:16:33 NZBGetPostProcess: import tmdbsimple as tmdb
INFO Tue Aug 23 2022 09:16:33 NZBGetPostProcess: File "/usr/local/sma/resources/metadata.py", line 8, in
INFO Tue Aug 23 2022 09:16:33 NZBGetPostProcess: from resources.metadata import Metadata, MediaType
INFO Tue Aug 23 2022 09:16:33 NZBGetPostProcess: File "/usr/local/sma/resources/mediaprocessor.py", line 12, in
INFO Tue Aug 23 2022 09:16:33 NZBGetPostProcess: from resources.mediaprocessor import MediaProcessor
INFO Tue Aug 23 2022 09:16:33 NZBGetPostProcess: File "/usr/local/sma/NZBGetPostProcess.py", line 81, in
INFO Tue Aug 23 2022 09:16:33 NZBGetPostProcess: Traceback (most recent call last):

I've confirmed the path is correct both under paths (in NZBGet) and in the NZBGetPostProcess.venv area. Is there a third area to update it in?

mdhiggins commented 2 years ago

In the extension scripts settings section of NZBGet try adding this to the shell override option

.py=/usr/local/sma/venv/bin/python3

That path should be getting set by the shebang of the .venv.py file but if for some reason its not honoring it that should override things

zeieri commented 2 years ago

Worked like a charm!

Do I need to do something on the Sonarr side? The file downloads, converts and is left in the root downloads folder. However, Sonarr doesn't pick it up, rename it and move it to the correct directory. My settings are:

image

From what I understood in the documentation, I can have completed download handling on and let it take care of it without needing the postSonarr script. Is that correct?

Side note, love that a percentage shows on conversion. I'm sure there are a many great features for me to discover from the 3 y.o. version of sma to present! Great work on this tool!

Cheers!

mdhiggins commented 2 years ago

You want completed download handling turned off otherwise it might grab the file while it's still being processed

NZBGetPostProcess will notify Sonarr to scan the directory when it's done but you'll need to make sure the paths are the same across both docker containers and that your Sonarr API info is up to date in autoProcess.ini. Can check logs to see if there are any errors related to the Sonarr notification

zeieri commented 2 years ago

Nevermind! In NZBGet, I had specified an Output directory which apparently isn't required as it's smart enough to sort that out. Confirmed it's all working with Sonarr!

Regarding paths, does Sonarr need to be able to see the postSonarr.py script? The downloads directory is identical on both sides!

mdhiggins commented 2 years ago

Only if you want to run postSonarr

That script will tag the file and do finishing touches but it's not required

zeieri commented 2 years ago

It is working well! All set and thanks for the help!