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

docker with docker-mods enabled #1645

Closed halfagascan closed 1 year ago

halfagascan commented 1 year ago

Linux gettech 5.10.0-20-amd64 #1 SMP Debian 5.10.158-2 (2022-12-13) x86_64 GNU/Linux

name: compose
services:
  sabnzbd:
    container_name: sabnzbd
    environment:
      PGID: "1000"
      PUID: "1000"
      DOCKER_MODS: "mdhiggins/sma-mod:latest"
      TZ: America/Mexico_City
    hostname: gettech
    image: lscr.io/linuxserver/sabnzbd
    logging:
      driver: json-file
      options:
        max-file: "10"
        max-size: 200k
    networks:
      default: null
    ports:
    - mode: ingress
      target: 8080
      published: "32700"
      protocol: tcp
    restart: unless-stopped
    volumes:
    - type: bind
      source: /etc/localtime
      target: /etc/localtime
      read_only: true
      bind:
        create_host_path: true
    - type: bind
      source: /home/me/.config/appdata/sabnzbd
      target: /config
      bind:
        create_host_path: true
    - type: bind
      source: /mnt/storage/
      target: /storage
      bind:
        create_host_path: true

$docker logs sabnzbd [custom-init] No custom services found, skipping... [mod-init] Attempting to run Docker Modification Logic [mod-init] Applying mdhiggins/sma-mod:latest files to container tar: can't open '/modtarball.tar.xz': No such file or directory cp: cannot stat '/tmp/mod/*': No such file or directory [mod-init] mdhiggins/sma-mod:latest applied to container [migrations] started [migrations] no migrations found

$docker exec -it sabnzbd /bin/bash root@gettech:/# ffmpeg bash: ffmpeg: command not found root@gettech:/# ffprobe bash: ffprobe: command not found

mdhiggins commented 1 year ago

Yeah just updated sma-mod to support the new s6v3 that the linuxserver is migrating all their packages to but it looks like sonarr:latest is the only one that hasn't crossed over yet, for now I would use either the develop tag for sonarr which is already on s6v3 or just roll back to the last version of sma-mod which is linked below if you don't want to use the develop sonarr tag, linuxserver should be dropping that sonarr update to get it in line with the rest of their fleet shortly

https://github.com/mdhiggins/sma-mod/pkgs/container/sma-mod/65189830

halfagascan commented 1 year ago

new pull this morning, new error: [custom-init] No custom services found, skipping... [mod-init] Attempting to run Docker Modification Logic [mod-init] Applying mdhiggins/sma-mod:latest files to container [mod-init] mdhiggins/sma-mod:latest at sha256:1a1d2b979022951a4453d5424d5f3a41c883093cfce027184739b0a5185b40a3 has been previously applied skipping [migrations] started [migrations] no migrations found usermod: no changes


      _         ()
     | |  ___   _    __
     | | / __| | |  /  \
     | | \__ \ | | | () |
     |_| |___/ |_|  \__/

Brought to you by linuxserver.io

To support the app dev(s) visit: SABnzbd: https://sabnzbd.org/donate

To support LSIO projects visit: https://www.linuxserver.io/donate/

GID/UID

User uid: 1000 User gid: 1000

s6-rc-oneshot-run: fatal: unable to exec /etc/s6-overlay/s6-rc.d/init-gid-video/run: Permission denied s6-rc: warning: unable to start service init-gid-video: command exited 126 [custom-init] No custom files found, skipping...

Inside docker: root@gettech:/# ls -all /etc/s6-overlay/s6-rc.d/init-gid-video/run -rw-r--r-- 1 root root 1572 Jan 27 07:01 /etc/s6-overlay/s6-rc.d/init-gid-video/run

root@gettech:/# /etc/s6-overlay/s6-rc.d/init-gid-video/run bash: /etc/s6-overlay/s6-rc.d/init-gid-video/run: Permission denied

I think from reading, this is looking for /dev/dri and /dev/dvb, I don't have any devices there, safe to ignore?

halfagascan commented 1 year ago

trying a DL, errors: Traceback (most recent call last): File "/usr/local/sma/SABPostProcess.py", line 8, in from resources.mediaprocessor import MediaProcessor File "/usr/local/sma/resources/mediaprocessor.py", line 12, in from resources.metadata import Metadata, MediaType File "/usr/local/sma/resources/metadata.py", line 8, in import tmdbsimple as tmdb ModuleNotFoundError: No module named 'tmdbsimple'

seems requirements not being followed

halfagascan commented 1 year ago

copy and paste the script into docker, seems to complete with no errors: https://github.com/mdhiggins/sma-mod/blob/master/root/etc/s6-overlay/s6-rc.d/init-sma-config/run

ffmpeg and ffprobe installed, anything else?

mdhiggins commented 1 year ago

Yeah the SMA setup scripts aren't running because of the s6 change. Rolling back to the old version should have fixed things but it looks like the mod version that's being applied isn't using the old version still. I'll probably have to make an old s6v2 tag to bridge the gap until they update the last Sonarr container

halfagascan commented 1 year ago

well, until there's a good docker, I'll play with what I have. Here is my ini [Converter] ffmpeg = /usr/local/bin/ffmpeg ffprobe = /usr/local/bin/ffprobe threads = 2 hwaccels = hwaccel-decoders = hwdevices = hwaccel-output-format = output-directory = output-directory-space-ratio = 0.0 output-format = mkv output-extension = mkv 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 = 0644 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 = copy 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 = eng default-language = eng include-original-language = True first-stream-of-language = False channel-bitrate = 128 variable-bitrate = 0 max-bitrate = 0 max-channels = 2 filter = profile = force-filter = False sample-rates = sample-format = copy-original = False aac-adtstoasc = False ignored-dispositions = force-default = False 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]

[Subtitle] codec = mov_text codec-image-based = languages = default-language = include-original-language = False 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 = force-default = False unique-dispositions = False attachment-codec = remove-bitstream-subs = False

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

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

[Subtitle.FFSubsync] enabled = False

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

[Subtitle.Subliminal.Auth]

[Sonarr] host = X.X.X.X port = 8989 apikey = REMOVED ssl = False webroot = force-rename = False rescan = True block-reprocess = False

[Radarr] host = localhost port = 7878 apikey = ssl = False webroot = 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 = tv 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 = False token =

I think the above should pass to ffmpeg to copy video, down mix from 6 channels to 2, don't think that is occurring: from ffprobe after Stream #0:0: Video: hevc Stream #0:1(eng): Audio: eac3, 48000 Hz, 6 channels

video is good, audio not also, any method to delete ALL subtitles? thanks

mdhiggins commented 1 year ago

Alright the new s6v2 tag has been published

ignore-embedded-subs = True

You can also just not specify any subtitle codecs

https://github.com/mdhiggins/sma-mod/pkgs/container/sma-mod/66445676?tag=s6v2

halfagascan commented 1 year ago

changed ignore-embedded-subs = True, no change 33 subtitles found no change in audio , still shows 6 channels

halfagascan commented 1 year ago

with empty values for subtitles, errors: 2023-01-27 17:36:20 - SABPostProcess - ERROR - Unexpected exception. Traceback (most recent call last): File "/usr/local/sma/SABPostProcess.py", line 33, in settings = ReadSettings() File "/usr/local/sma/resources/readsettings.py", line 463, in init self.readConfig(config) File "/usr/local/sma/resources/readsettings.py", line 645, in readConfig self.subtitle_original_language = config.getboolean(section, 'include-original-language') File "/usr/lib/python3.10/configparser.py", line 829, in getboolean return self._get_conv(section, option, self._convert_to_boolean, File "/usr/lib/python3.10/configparser.py", line 809, in _get_conv return self._get(section, conv, option, raw=raw, vars=vars, File "/usr/lib/python3.10/configparser.py", line 804, in _get return conv(self.get(section, option, **kwargs)) File "/usr/lib/python3.10/configparser.py", line 1167, in _convert_to_boolean raise ValueError('Not a boolean: %s' % value)

with null for values, errors: 2023-01-27 17:42:05 - SABPostProcess - ERROR - Unexpected exception. Traceback (most recent call last): File "/usr/local/sma/SABPostProcess.py", line 33, in settings = ReadSettings() File "/usr/local/sma/resources/readsettings.py", line 463, in init self.readConfig(config) File "/usr/local/sma/resources/readsettings.py", line 650, in readConfig self.embedsubs = config.getboolean(section, 'embed-subs') File "/usr/lib/python3.10/configparser.py", line 829, in getboolean return self._get_conv(section, option, self._convert_to_boolean, File "/usr/lib/python3.10/configparser.py", line 809, in _get_conv return self._get(section, conv, option, raw=raw, vars=vars, File "/usr/lib/python3.10/configparser.py", line 804, in _get return conv(self.get(section, option, **kwargs)) File "/usr/lib/python3.10/configparser.py", line 1167, in _convert_to_boolean raise ValueError('Not a boolean: %s' % value) ValueError: Not a boolean: null

mdhiggins commented 1 year ago

You're getting an error for a completely different option. Read the error. Can't have a null value for a Boolean, needs to be true or false

include-original-language

mdhiggins commented 1 year ago

Show the logs for ignore embedded subs. Just cause they are found in the source file doesn't mean they are necessarily copied to the output file

halfagascan commented 1 year ago

$docker logs sabnzbd [custom-init] No custom services found, skipping... [mod-init] Attempting to run Docker Modification Logic [mod-init] Applying mdhiggins/sma-mod:latest:s6v2 files to container tar: can't open '/modtarball.tar.xz': No such file or directory cp: cannot stat '/tmp/mod/*': No such file or directory [mod-init] mdhiggins/sma-mod:latest:s6v2 applied to container [migrations] started ^^^^^^ [migrations] no migrations found same errors as before docker exec -it sabnzbd /bin/bash root@gettech:/# ffmpeg bash: ffmpeg: command not found

halfagascan commented 1 year ago

Input #0, matroska,webm, from '/mnt/storage/medialibrary/tv/The.Lincoln.Lawyer/Season 1/The.Lincoln.Lawyer.S01E06.Bent.1080p.NF.WEB-DL.DDP5.1.Atmos.HEVC-SKiZOiD.mkv': Metadata: encoder : libebml v1.4.2 + libmatroska v1.6.4 creation_time : 2022-05-22T13:06:58.000000Z Duration: 00:47:57.47, start: 0.000000, bitrate: 4852 kb/s Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default) Metadata: BPS : 4216562 DURATION : 00:46:22.196000000 NUMBER_OF_FRAMES: 66706 NUMBER_OF_BYTES : 1466412854 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:1(eng): Audio: eac3, 48000 Hz, 6 channels, fltp (default) Metadata: title : English BPS : 768000 DURATION : 00:47:57.472000000 NUMBER_OF_FRAMES: 89921 NUMBER_OF_BYTES : 276237312 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:2(eng): Subtitle: subrip (default) Metadata: title : English BPS : 118 DURATION : 00:44:15.402000000 NUMBER_OF_FRAMES: 736 NUMBER_OF_BYTES : 39444 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:3(eng): Subtitle: subrip (forced) Metadata: title : Forced BPS : 0 DURATION : 00:33:07.485000000 NUMBER_OF_FRAMES: 6 NUMBER_OF_BYTES : 227 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:4(ara): Subtitle: subrip Metadata: title : Arabic BPS : 136 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 708 NUMBER_OF_BYTES : 47133 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:5(chi): Subtitle: subrip Metadata: title : Chinese Simplified BPS : 93 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 708 NUMBER_OF_BYTES : 32366 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:6(chi): Subtitle: subrip Metadata: title : Chinese Traditional BPS : 81 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 708 NUMBER_OF_BYTES : 28090 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:7(hrv): Subtitle: subrip Metadata: title : Croatian BPS : 75 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 702 NUMBER_OF_BYTES : 25992 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:8(cze): Subtitle: subrip Metadata: title : Czech BPS : 77 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 708 NUMBER_OF_BYTES : 26707 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:9(dan): Subtitle: subrip Metadata: title : Danish BPS : 77 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 705 NUMBER_OF_BYTES : 26830 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:10(dut): Subtitle: subrip Metadata: title : Dutch BPS : 73 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 687 NUMBER_OF_BYTES : 25535 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:11(fin): Subtitle: subrip Metadata: title : Finnish BPS : 72 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 707 NUMBER_OF_BYTES : 25162 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:12(fre): Subtitle: subrip Metadata: title : French BPS : 79 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 698 NUMBER_OF_BYTES : 27505 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:13(ger): Subtitle: subrip Metadata: title : German BPS : 77 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 708 NUMBER_OF_BYTES : 26776 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:14(gre): Subtitle: subrip Metadata: title : Greek BPS : 139 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 707 NUMBER_OF_BYTES : 48207 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:15(heb): Subtitle: subrip Metadata: title : Hebrew BPS : 134 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 708 NUMBER_OF_BYTES : 46356 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:16(hun): Subtitle: subrip Metadata: title : Hungarian BPS : 78 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 707 NUMBER_OF_BYTES : 27066 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:17(ind): Subtitle: subrip Metadata: title : Indonesian BPS : 78 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 707 NUMBER_OF_BYTES : 26936 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:18(ita): Subtitle: subrip Metadata: title : Italian BPS : 78 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 706 NUMBER_OF_BYTES : 27257 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:19(jpn): Subtitle: subrip Metadata: title : Japanese BPS : 77 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 742 NUMBER_OF_BYTES : 26577 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:20(kor): Subtitle: subrip Metadata: title : Korean BPS : 106 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 708 NUMBER_OF_BYTES : 36875 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:21(may): Subtitle: subrip Metadata: title : Malay BPS : 79 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 708 NUMBER_OF_BYTES : 27452 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:22(nob): Subtitle: subrip Metadata: title : Norwegian Bokmal BPS : 76 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 706 NUMBER_OF_BYTES : 26333 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:23(pol): Subtitle: subrip Metadata: title : Polish BPS : 74 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 699 NUMBER_OF_BYTES : 25851 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:24(por): Subtitle: subrip Metadata: title : Portuguese BPS : 82 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 707 NUMBER_OF_BYTES : 28611 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:25(por): Subtitle: subrip Metadata: title : Brazilian Portuguese BPS : 81 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 708 NUMBER_OF_BYTES : 28071 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:26(rum): Subtitle: subrip Metadata: title : Romanian BPS : 88 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 706 NUMBER_OF_BYTES : 30473 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:27(rus): Subtitle: subrip Metadata: title : Russian BPS : 134 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 708 NUMBER_OF_BYTES : 46562 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:28(spa): Subtitle: subrip Metadata: title : Spanish BPS : 78 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 701 NUMBER_OF_BYTES : 27016 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:29(spa): Subtitle: subrip Metadata: title : European Spanish BPS : 76 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 703 NUMBER_OF_BYTES : 26559 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:30(swe): Subtitle: subrip Metadata: title : Swedish BPS : 79 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 707 NUMBER_OF_BYTES : 27320 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:31(tha): Subtitle: subrip Metadata: title : Thai BPS : 225 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 708 NUMBER_OF_BYTES : 77679 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:32(tur): Subtitle: subrip Metadata: title : Turkish BPS : 82 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 707 NUMBER_OF_BYTES : 28464 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:33(ukr): Subtitle: subrip Metadata: title : Ukrainian BPS : 138 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 708 NUMBER_OF_BYTES : 47918 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:34(vie): Subtitle: subrip Metadata: title : Vietnamese BPS : 114 DURATION : 00:46:00.632000000 NUMBER_OF_FRAMES: 707 NUMBER_OF_BYTES : 39382 _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-05-22 13:06:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

That is the the output AFTER postprocessing

mdhiggins commented 1 year ago

You're still applying the wrong mod tag

Your logs show mdhiggins/sma-mod:latest

You need to do mdhiggins/sma-mod:s6v2

halfagascan commented 1 year ago

sma_mod

mdhiggins commented 1 year ago

Take out LATEST that's the wrong tag!

You can't have more than one tag and docker will only apply the first one

halfagascan commented 1 year ago

ok, bone headed on my part, fixed, DOCKER_MODS: mdhiggins/sma-mod:s6v2 but still issues: root@gettech:/# /usr/local/sma/manual.py Traceback (most recent call last): File "/usr/local/sma/manual.py", line 13, in import tmdbsimple as tmdb ModuleNotFoundError: No module named 'tmdbsimple'

I can pip install -r /app/sabnzbd/tests/requirements.txt, but there are many more errors

mdhiggins commented 1 year ago

All pip requirements are and always have been installed in a virtual environment. You need to use /usr/local/sma/venv/bin/python3 to execute any Python scripts not just the base Python installation in the container

halfagascan commented 1 year ago

well, I don't know what to say, other than I've tried this program on two different computers, and the errors are the same, indicating that the requirements.txt is not being installed, this occurs on both computers. docker exec -it sabnzbd /bin/bash cd /usr/local/sma/venv/bin/python3 pip3 install -r /app/sabnzbd/tests/requirements.txt installs from the requirements.txt After it finishes, the error: root@c887f2842b8f:/usr/local/sma/venv/bin# /usr/local/sma/manual.py Traceback (most recent call last): File "/usr/local/sma/manual.py", line 13, in import tmdbsimple as tmdb ModuleNotFoundError: No module named 'tmdbsimple'

root@c887f2842b8f:/usr/local/sma/venv/bin# pip3 install tmdbsimple WARNING: The directory '/config/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag. Collecting tmdbsimple Downloading tmdbsimple-2.9.1-py3-none-any.whl (38 kB) Requirement already satisfied: requests in /usr/lib/python3.10/site-packages (from tmdbsimple) (2.28.1) Requirement already satisfied: charset-normalizer<3,>=2 in /usr/lib/python3.10/site-packages (from requests->tmdbsimple) (2.1.1) Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3.10/site-packages (from requests->tmdbsimple) (1.26.13) Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3.10/site-packages (from requests->tmdbsimple) (3.4) Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.10/site-packages (from requests->tmdbsimple) (2022.12.7) Installing collected packages: tmdbsimple Successfully installed tmdbsimple-2.9.1 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

root@c887f2842b8f:/usr/local/sma/venv/bin# /usr/local/sma/manual.py Traceback (most recent call last): File "/usr/local/sma/manual.py", line 16, in from resources.mediaprocessor import MediaProcessor File "/usr/local/sma/resources/mediaprocessor.py", line 12, in from resources.metadata import Metadata, MediaType File "/usr/local/sma/resources/metadata.py", line 10, in from mutagen.mp4 import MP4, MP4Cover, MP4StreamInfoError ModuleNotFoundError: No module named 'mutagen'

root@c887f2842b8f:/usr/local/sma/venv/bin# pip3 install mutagen WARNING: The directory '/config/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag. Collecting mutagen Downloading mutagen-1.46.0-py3-none-any.whl (193 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 193.6/193.6 kB 1.8 MB/s eta 0:00:00 Installing collected packages: mutagen Successfully installed mutagen-1.46.0 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

root@c887f2842b8f:/usr/local/sma/venv/bin# /usr/local/sma/manual.py Manual processor started. Python 64-bit 3.10.9 (main, Dec 10 2022, 13:54:12) [GCC 11.2.1 20220219]. Guessit version: 3.5.0. /usr/bin/python3 Loading config file /usr/local/sma/config/autoProcess.ini. Enter path to file:

:

halfagascan commented 1 year ago

manual process log:

2023-01-28 13:19:39 - MANUAL - INFO - Manual processor started. 2023-01-28 13:19:39 - MANUAL - INFO - Python 64-bit 3.10.9 (main, Dec 10 2022, 13:54:12) [GCC 11.2.1 20220219]. 2023-01-28 13:19:39 - MANUAL - INFO - Guessit version: 3.5.0. 2023-01-28 13:19:39 - MANUAL - INFO - /usr/bin/python3 2023-01-28 13:19:39 - MANUAL - INFO - Loading config file /usr/local/sma/config/autoProcess.ini. 2023-01-28 13:20:33 - MANUAL - INFO - File /mnt/storage/medialibrary/ does not exist 2023-01-28 13:26:36 - MANUAL - INFO - Manual processor started. 2023-01-28 13:26:36 - MANUAL - INFO - Python 64-bit 3.10.9 (main, Dec 10 2022, 13:54:12) [GCC 11.2.1 20220219]. 2023-01-28 13:26:36 - MANUAL - INFO - Guessit version: 3.5.0. 2023-01-28 13:26:36 - MANUAL - INFO - /usr/bin/python3 2023-01-28 13:26:36 - MANUAL - INFO - Loading config file /usr/local/sma/config/autoProcess.ini. 2023-01-28 13:26:53 - MANUAL - INFO - File /mnt/storage/medialibrary/ does not exist 2023-01-28 13:27:30 - MANUAL - INFO - Manual processor started. 2023-01-28 13:27:30 - MANUAL - INFO - Python 64-bit 3.10.9 (main, Dec 10 2022, 13:54:12) [GCC 11.2.1 20220219]. 2023-01-28 13:27:30 - MANUAL - INFO - Guessit version: 3.5.0. 2023-01-28 13:27:30 - MANUAL - INFO - /usr/bin/python3 2023-01-28 13:27:30 - MANUAL - INFO - Loading config file /usr/local/sma/config/autoProcess.ini. 2023-01-28 13:27:44 - MANUAL - INFO - File /stoage/medialibrary/tv does not exist 2023-01-28 13:27:50 - MANUAL - INFO - Manual processor started. 2023-01-28 13:27:50 - MANUAL - INFO - Python 64-bit 3.10.9 (main, Dec 10 2022, 13:54:12) [GCC 11.2.1 20220219]. 2023-01-28 13:27:50 - MANUAL - INFO - Guessit version: 3.5.0. 2023-01-28 13:27:50 - MANUAL - INFO - /usr/bin/python3 2023-01-28 13:27:50 - MANUAL - INFO - Loading config file /usr/local/sma/config/autoProcess.ini. 2023-01-28 13:28:10 - MANUAL - INFO - Processing file /storage/medialibrary/tv/7b4ae2a8c839446d9df056635fc282c9.mkv 2023-01-28 13:28:12 - MANUAL - ERROR - Unable to retrieve rating. 2023-01-28 13:28:12 - MANUAL - INFO - Matched movie title as: Malin TV 2023-01-27 (TMDB ID: 1059441) 2023-01-28 13:30:16 - MANUAL - INFO - Processing Yellowstone Season 05 Episode 02 - The Sting of Wisdom 2023-01-28 13:30:17 - MANUAL - INFO - Input Data 2023-01-28 13:30:17 - MANUAL - INFO - { "format": "matroska,webm", "format-fullname": "Matroska / WebM", "video": { "index": 0, "codec": "h264", "bitrate": 8906181, "pix_fmt": "yuv420p", "profile": "high", "fps": 23.976023976023978, "framedata": { "pix_fmt": "yuv420p", "color_space": "bt709", "color_primaries": "bt709", "color_transfer": "bt709" }, "dimensions": "1920x1080", "level": 4.0, "field_order": "progressive" }, "audio": [ { "index": 3, "codec": "eac3", "bitrate": 640000, "channels": 6, "samplerate": 48000, "language": "eng", "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions" } ], "subtitle": [ { "index": 1, "codec": "subrip", "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions", "language": "eng" }, { "index": 2, "codec": "subrip", "disposition": "-default-dub-original-comment-lyrics-karaoke-forced+hearing_impaired-visual_impaired-captions", "language": "eng" } ], "attachment": [] } 2023-01-28 13:30:17 - MANUAL - INFO - Reading video stream. 2023-01-28 13:30:17 - MANUAL - INFO - Video codec detected: h264. 2023-01-28 13:30:17 - MANUAL - INFO - Pix Fmt: yuv420p. 2023-01-28 13:30:17 - MANUAL - INFO - Profile: high. 2023-01-28 13:30:17 - MANUAL - INFO - Video codec parameters None. 2023-01-28 13:30:17 - MANUAL - INFO - Creating copy video stream from source stream 0. 2023-01-28 13:30:17 - MANUAL - INFO - Reading audio streams. 2023-01-28 13:30:17 - MANUAL - INFO - The following stream indexes have been identified as being copies: [] [stream-codec-combinations]. 2023-01-28 13:30:17 - MANUAL - INFO - Audio detected for stream 3 - eac3 eng 6 channel. 2023-01-28 13:30:17 - MANUAL - INFO - Creating ac3 audio stream from source stream 3. 2023-01-28 13:30:17 - MANUAL - INFO - Creating aac audio stream from source audio stream 3 [universal-audio]. 2023-01-28 13:30:17 - MANUAL - INFO - Found 0 streams that can be removed from the output file since they will be duplicates [stream-codec-combinations]. 2023-01-28 13:30:17 - MANUAL - INFO - Final sorting: 2023-01-28 13:30:17 - MANUAL - INFO - ['0->0', '1->1'] 2023-01-28 13:30:17 - MANUAL - INFO - Final sorting: 2023-01-28 13:30:17 - MANUAL - INFO - ['0->0', '1->1'] 2023-01-28 13:30:17 - MANUAL - INFO - Default audio stream set to eng ac3 2 channel stream [audio-default-sorting: ['channels.d', 'map', 'd.comment']]. 2023-01-28 13:30:17 - MANUAL - INFO - Reading subtitle streams. 2023-01-28 13:30:17 - MANUAL - INFO - Subtitle detected for stream 1 - subrip eng. 2023-01-28 13:30:17 - MANUAL - INFO - Subtitle detected for stream 2 - subrip eng. 2023-01-28 13:30:17 - MANUAL - INFO - Scanned for external subtitles and found 0 results in your approved languages. 2023-01-28 13:30:17 - MANUAL - INFO - Final sorting: 2023-01-28 13:30:17 - MANUAL - INFO - [] 2023-01-28 13:30:17 - MANUAL - INFO - Input and output extensions are the same so passing back the original file [process-same-extensions: False]. 2023-01-28 13:30:17 - MANUAL - INFO - Bypassing conversion and setting outputfile to inputfile. 2023-01-28 13:30:17 - MANUAL - INFO - Tagging file: /storage/medialibrary/tv/7b4ae2a8c839446d9df056635fc282c9.mkv. 2023-01-28 13:32:48 - MANUAL - ERROR - Unexpected tagging error using FFMPEG fallback method. Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/mutagen/mp4/init.py", line 1050, in load moov = atoms[b"moov"] File "/usr/lib/python3.10/site-packages/mutagen/mp4/_atom.py", line 188, in getitem raise KeyError("%r not found" % names[0]) KeyError: "b'moov' not found"

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/sma/resources/metadata.py", line 188, in writeTags video = MP4(path) File "/usr/lib/python3.10/site-packages/mutagen/_file.py", line 47, in init self.load(*args, kwargs) File "/usr/lib/python3.10/site-packages/mutagen/_util.py", line 155, in wrapper return func(self, h, *args, *kwargs) File "/usr/lib/python3.10/site-packages/mutagen/mp4/init.py", line 1181, in load self.info.load(atoms, fileobj) File "/usr/lib/python3.10/site-packages/mutagen/_util.py", line 184, in wrapper return func(args, kwargs) File "/usr/lib/python3.10/site-packages/mutagen/mp4/init.py", line 1052, in load raise MP4StreamInfoError("not a MP4 file") mutagen.mp4.MP4StreamInfoError: not a MP4 file

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/sma/resources/metadata.py", line 224, in writeTags for timecode, debug in conv: File "/usr/local/sma/converter/init.py", line 237, in tag for timecode, debug in self.ffmpeg.convert(outfile, opts): File "/usr/local/sma/converter/ffmpeg.py", line 795, in convert raise FFMpegConvertError('Exited with code %d' % p.returncode, cmd, converter.ffmpeg.FFMpegConvertError:

@debiancam:/mnt/storage/medialibrary/tv$ ls -all total 7122948 drwxrwxr-x 2 me me 4096 Jan 28 13:30 . drwxrwxr-x 4 me me 4096 Nov 30 14:58 .. -rw-r--r-- 1 root root 2703474688 Jan 28 13:32 7b4ae2a8c839446d9df056635fc282c9.mkv -rw-r--r-- 1 jerry jerry 4590290222 Jan 28 13:23 7b4ae2a8c839446d9df056635fc282c9.mkv.tag

mdhiggins commented 1 year ago

There continues to be a misunderstanding and I don't mean to be condescending but I think you are missing some core concepts about how linux command lines function and determine which executable is chosen when entering a command that is making this harder than it needs to be, link below might provide some insight into the PATH and how execs are chosen; you may also want to read up on how which execs are associated with which file extensions

https://unix.stackexchange.com/a/3837

docker exec -it sabnzbd /bin/bash
cd /usr/local/sma/venv/bin/python3
pip3 install -r /app/sabnzbd/tests/requirements.txt
installs from the requirements.txt
After it finishes, the error:
root@c887f2842b8f:/usr/local/sma/venv/bin# /usr/local/sma/manual.py
Traceback (most recent call last):
File "/usr/local/sma/manual.py", line 13, in
import tmdbsimple as tmdb
ModuleNotFoundError: No module named 'tmdbsimple'

From your sample above, you open bash on the docker container on line one which is fine

Line 2 you try to change into the virtual environment python3 executable like its a directory which is not possible and probably threw an error, running that same command inside the radarr container for me shows bash: cd: /usr/local/sma/venv/bin/python3: Not a directory Presumably you were trying to go into the bin directory, so lets assume you got there for the rest of the walk-through using cd /usr/local/sma/venv/bin

Line 3 you install the requirements using pip3 but you do this on the system level python installation. The virtual environment already has the requirements anyone so this step is unnecessary. When you navigate to a directory with an executable in it, in this case /usr/local/sma/venv/bin but then just type the plain command as you've done, you're still not using the executable in that directory you're using one somewhere in your system PATH To test this, see the following

Python 3.10.9 (main, Dec 12 2022, 17:52:15) [GCC 12.2.1 20220924] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.executable)
/usr/bin/python3
>>> exit()
root@64357fa7e9db:/usr/local/sma/venv/bin# ./python3
Python 3.10.9 (main, Dec 12 2022, 17:52:15) [GCC 12.2.1 20220924] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.executable)
/usr/local/sma/venv/bin/python3
>>> exit()

See the difference? manual.py actually prints this path for you at the start of its execution to hopefully inform the user which python3 executable is being used which is how I know you're still using the wrong one; from your logs: 2023-01-28 13:19:39 - MANUAL - INFO - /usr/bin/python3 The preceding ./ before python3 above tells the operating system that you want to use the current directory not the system PATH. You can also use the which command to have the operating system tell you where its getting an executable

root@64357fa7e9db:/usr/local/sma/venv/bin# which python3
/usr/bin/python3

The final line of your sample is root@c887f2842b8f:/usr/local/sma/venv/bin# /usr/local/sma/manual.py which shows that you managed to browse to the bin directory but then execute manual.py by file extension which basically means you're still using /usr/bin/python3. Being in a random directory does not magically change the executable. This is confirmed by manual.py when it starts in the logs. You would need to do one of the following options

Specify the ./python3 while inside the directory

root@64357fa7e9db:/usr/local/sma/venv/bin# ./python3 /usr/local/sma/manual.py
Manual processor started.
Python 64-bit 3.10.9 (main, Dec 12 2022, 17:52:15) [GCC 12.2.1 20220924].
Guessit version: 3.5.0.
/usr/local/sma/venv/bin/python3
Loading config file /usr/local/sma/config/autoProcess.ini.
Enter path to file:
#:

OR just use the full absolute paths which can be done from any directory

root@64357fa7e9db:/# /usr/local/sma/venv/bin/python3 /usr/local/sma/manual.py
Manual processor started.
Python 64-bit 3.10.9 (main, Dec 12 2022, 17:52:15) [GCC 12.2.1 20220924].
Guessit version: 3.5.0.
/usr/local/sma/venv/bin/python3
Loading config file /usr/local/sma/config/autoProcess.ini.
Enter path to file:
#:

Now, moving on your your most recent logs

It looks like despite these issues you managed to get enough installed on the main system python3 environment to avoid exceptions due to missing requirements. Manual.py is able to run through its process and you're getting an FFMPEG error at the very end of the file when trying to tag your MKV file.

Your first exception mutagen.mp4.MP4StreamInfoError: not a MP4 file is a normal exception if you're using an MKV instead of an MP4, no big deal SMA then falls back to using FFMPEG to try to write tags to the MKV which appears to be failing with converter.ffmpeg.FFMpegConvertError: It appears however that the logs are cut off and so I can't tell you what the reason FFMPEG is failing might be but that's the last piece of information I have but there can be tons of reasons why FFMPEG might fail tagging, could be permissions, corrupt MKV, bad metadata, who knows. If you want to include the rest of the logs go ahead

But you don't need to keep installing requirements. This is a docker container with millions of downloads that comes with all the requirements preinstalled and aside from the recent hiccup related to the parent container switching to s6v3 its well tested and has what you need included

mdhiggins commented 1 year ago

Also as another aside

2023-01-28 13:30:17 - MANUAL - INFO - Input and output extensions are the same so passing back the original file [process-same-extensions: False].

It appears you are going from an MKV source to an MKV output which is fine. By default the script will not actually process/convert these files if they are already in the same extension but instead just tag them and move on

You may wish to turn on process-same-extensions in autoProcess.ini if that's not your desired behavior

halfagascan commented 1 year ago

well, I'm going to confuse you even more. It's my belief, the requirements.txt file is NOT being installed. On a clean install with your mod applied, exec into the docker. cat your requirements.txt pip show pytest-httpbin On mine, was not installed pip install pytest-httpbin, lots of errors ended up installing python3-dev and build-base to satisfy dependancies I went thru the whole list, pip show, pip install the missing The end result, no errors on running manual.py, but the output mkv Stream #0:0: Video: h264 , Stream #0:1(eng): Audio: eac3, 48000 Hz, 6 channels, Stream #0:2(eng): Subtitle: subrip, Stream #0:3(eng): Subtitle: subrip

halfagascan commented 1 year ago

from the computer that has not pip show, pip install run root@5119a63244a0:/# pwd / root@5119a63244a0:/# /usr/local/sma/venv/bin/python3 /usr/local/sma/config/manual.py Traceback (most recent call last): File "/usr/local/sma/config/manual.py", line 5, in import guessit ModuleNotFoundError: No module named 'guessit'

you said: "Line 2 you try to change into the virtual environment python3 executable like its a directory which is not possible and probably threw an error, running that same command inside the radarr container for me shows"

root@c887f2842b8f:/config# cd /usr/local/sma/venv/bin root@c887f2842b8f:/usr/local/sma/venv/bin#

mdhiggins commented 1 year ago

I can only go by the exact information you post but it appears the logs are mixed together or tweaked in some way since some of the responses and logging are inconsistent. I tried to be as detailed as I can be in the above post.

With regards to

"Line 2 you try to change into the virtual environment python3 executable like its a directory which is not possible and probably threw an error, running that same command inside the radarr container for me shows"

This is because you included /python3 at the end of your cd command that you sent in the sample which would not work. The exact command copied from you post says cd /usr/local/sma/venv/bin/python3 which would fail. The sample in your most recent comment correctly shows the directory without the /python3 at the end which is why it worked

For the next comment - even if you're installing the requirements you're still installing them on the main python installation at the system level not the virtual environment, you would need to use pip3 inside the venv directory to act only on the virtual environment.

Now, the guessit import failure does suggest that you are missing the requirements and the command you linked appears correct but there's been so many modifications to the container its hard to say for sure why this isn't working. There are docker-compose setups for multiple different images and a mix and match of all kinds of logs and output that don't logically follow. The installation of the pip requirements is handled by the startup script (90-sma-config for s6v2, init-sma-config/run for s6v3), but this same script is also what creates the virtual environment so its odd that you would have one and not the other unless there was a failure during that initial startup script somewhere in between those two steps

I think at this point I just need a fresh, direct copy paste full set of logs including the following:

All of this stuff needs to be direct copy and paste from the source and not pieced together, no excerpts of segments, and not merged from multiple attempts as the confounding information from doing those things makes it very difficult to determine what's going on with your setup. I need all 3 of these things. With that information, since its docker, I can recreate your exact setup and reproduce the problem and fix the image if its truly an image/mod problem or maybe tell you where you're doing wrong.

Assume all information is relevant when copying that information, don't remove anything

mdhiggins commented 1 year ago

So, I dug through your original post and recreated your original container. I realize however that I was operating under incorrect information, I think early on I had mixed up your issue with another recent issue and thought you were applying sma-mod to Sonarr. My early posts all refer to Sonarr. I realized when trying to recreate your container that you are actually using SABNZBD

I went and checked Linuxserver's github and it looks like SABNZBD is actually on s6v3 not v2 like Sonarr. That means my initial assumption that you needed to roll back to an older version was inaccurate, I believe only Sonarr remains on that version.

I used the following test configuration

  sabtest:
    container_name: sabtest
    environment:
      PGID: ${PGID}
      PUID: ${PUID}
      DOCKER_MODS: "mdhiggins/sma-mod:latest"
      TZ: America/Mexico_City
    image: lscr.io/linuxserver/sabnzbd
    ports:
      - "8080:8080"
    restart: unless-stopped

Running that on the first launch of the container with no modifications, I'm able to open it up and run manual.py without issue

michael@plexrack:~$ dcp exec sabtest bash
root@d51048a37ca0:/# /usr/local/sma/venv/bin/python3 /usr/local/sma/manual.py
Manual processor started.
Python 64-bit 3.10.9 (main, Dec 10 2022, 13:54:12) [GCC 11.2.1 20220219].
Guessit version: 3.5.0.
/usr/local/sma/venv/bin/python3
Loading config file /usr/local/sma/config/autoProcess.ini.
Enter path to file:

So I think the initial problem was that you were using the wrong environment, but then by having you switch to the s6v2 tag I inadvertently broke your virtual environment due to the mismatch because I was thinking you were on Sonarr no SABNZBD which then when you started using the correct path didn't work

Try and mirror the options above and see what you get, you may be able to disregard the last post since I think that's the issue

halfagascan commented 1 year ago

well, different os, different computer, same docker set up, its all in the zip I'll cut to the chase with a pic tmdbsimple

If you want me to enter commands, please be specific. Thanks edit: this was posted prior to reading the prior post

mdhiggins commented 1 year ago

well, different os, different computer, same docker set up, its all in the zip

Since we're mostly dealing with Python exceptions and input errors I think the OS being the same inside the container is more than enough to consider it the same, not worried about kernel/driver level variances at this point lol

Skimmed through the zip and I'm thinking the solution offered in https://github.com/mdhiggins/sickbeard_mp4_automator/issues/1645#issuecomment-1407678357 should close this out and solve the problem

halfagascan commented 1 year ago

/usr/local/sma/venv/bin/python3 /usr/local/sma/manual.py Manual processor started. Python 64-bit 3.10.9 (main, Dec 10 2022, 13:54:12) [GCC 11.2.1 20220219]. Guessit version: 3.5.0. /usr/local/sma/venv/bin/python3 Loading config file /usr/local/sma/config/autoProcess.ini. Enter path to file:

:

name: compose services: sabnzbd: container_name: sabnzbd environment: PGID: "1000" PUID: "1000" SMA_CONFIG: /opt/appdata/sma/ DOCKER_MODS: mdhiggins/sma-mod:latest TZ: America/Mexico_City hostname: nuc

- type: bind
  source: /home/jerry/.config/appdata/sabnzbd
  target: /config
  source: /opt/appdata/sma
  target: /usr/local/sma/config

on the host: jerry@nuc:/opt/appdata/sma$ ls -all /opt/appdata/sma total 308 drwxr-xr-x 3 jerry jerry 4096 Jan 29 13:31 . drwxr-xr-x 3 root root 4096 Jan 29 08:47 .. -rw-r--r-- 1 jerry jerry 4482 Jan 29 13:22 autoProcess.ini -r--r--r-- 1 jerry jerry 4460 Jan 29 13:16 autoProcess.ini.sample -rw-r--r-- 1 jerry jerry 0 Jan 29 12:24 init.py -rw-r--r-- 1 root root 1209 Jan 29 12:28 logging.ini -rw-r--r-- 1 jerry jerry 4350 Jan 29 12:03 old.autoProcess.ini -rwxr-xr-x 1 jerry jerry 4203 Jan 29 11:51 old.SABPostProcess.py drwxr-xr-x 2 root root 4096 Jan 29 12:28 pycache -rwxr-xr-x 1 jerry jerry 4203 Jan 29 12:17 SABPostProcess.py -rw-r--r-- 1 root root 61824 Jan 29 15:15 sma.log -rw-r--r-- 1 root root 98979 Jan 29 12:30 sma.log.1 -rw-r--r-- 1 root root 88876 Jan 29 12:30 sma.log.2 jerry@nuc:/opt/appdata/sma$

in the docker: root@nuc:/# ls -all /usr/local/sma/config total 308 drwxr-xr-x 3 abc users 4096 Jan 29 13:31 . drwxr-xr-x 11 abc users 4096 Jan 29 12:25 .. -rwxr-xr-x 1 abc users 4203 Jan 29 12:17 SABPostProcess.py -rw-r--r-- 1 abc users 0 Jan 29 12:24 init.py drwxr-xr-x 2 root root 4096 Jan 29 12:28 pycache -rw-r--r-- 1 abc users 4482 Jan 29 13:22 autoProcess.ini -r--r--r-- 1 abc users 4460 Jan 29 13:16 autoProcess.ini.sample -rw-r--r-- 1 root root 1209 Jan 29 12:28 logging.ini -rwxr-xr-x 1 abc users 4203 Jan 29 11:51 old.SABPostProcess.py -rw-r--r-- 1 abc users 4350 Jan 29 12:03 old.autoProcess.ini -rw-r--r-- 1 root root 61824 Jan 29 15:15 sma.log -rw-r--r-- 1 root root 98979 Jan 29 12:30 sma.log.1 -rw-r--r-- 1 root root 88876 Jan 29 12:30 sma.log.2 root@nuc:/# traceback manual.py runs fine

mdhiggins commented 1 year ago

Good, so your virtual environment is working correctly as evidenced by manual.py launching without import errors

Now its kind of looking like you might have then moved SABPostProcess.py to its own directory inside your /config/scripts folder without its dependencies and tried to run it as a .py file without specifying the virtual python environment again essentially circumventing the virtual environment all over again after all that. Moving SABPostProcess.py also breaks it since it depends on many of those other python files in the SMA directory which is why you're getting all those new import errors

So, first I would change your SAB scripts directory to /usr/local/sma Screenshot 2023-01-30 094432

Then, setup your categories and choose SABPostProcess.sh NOT SABPostProcess.py

Screenshot 2023-01-30 094415

This is because as I tried to explain earlier, .py files will execute with whatever the operating system default PATH setting is which in this case is /usr/bin/python3. SABPostProcess.sh is a wrapper that points it to the correct python environment similar to what you were doing with manual.py manually

For your info, this is what that file looks like

#!/usr/bin/env bash

# env check
if [[ -z "${SMA_PATH}" ]]; then
    export SMA_PATH="/usr/local/sma"
fi

$SMA_PATH/venv/bin/python3 $SMA_PATH/SABPostProcess.py "$@"

You'll also want to make sure that your category name, in this case "sonarr" matches whatever category name you have in autoProcess.ini under the SABNZBD section

Screenshot 2023-01-30 094529

If for some reason you don't want to use /usr/local/sma as your scripts directory (like you have other scripts etc) you can copy SABPostProcess.sh wherever you want, it uses absolute paths so it does not need to remain in the /usr/local/sma directory

halfagascan commented 1 year ago

Without your patience, understanding and hand holding, my problems are solved. I thank you for providing this software, and maintaining. Thank you.

mdhiggins commented 1 year ago

Glad it's all working 👍