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.53k stars 200 forks source link

configparser.InterpolationSyntaxError #1668

Closed gaben67 closed 1 year ago

gaben67 commented 1 year ago

Describe the bug Config parser error from SABnzbd, same result running manual.py

Command or context you are trying to run Both Sonarr and Radarr produce the same error in SABnzbd: configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%#444rDT^nctV5A2'

autoProcess.ini settings [Sickbeard] host = localhost port = 8081 username = password = webroot = ssl = False apikey =

[Sonarr] host = localhost port = 8989 webroot = /sonarr ssl = False apikey = x force-rename = False rescan = True block-reprocess = False in-progress-check = True

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

[Converter] ffmpeg = C:\ffmpeg\bin\ffmpeg.exe ffprobe = C:\ffmpeg\bin\ffprobe.exe threads = 0 output-directory = copy-to = move-to = output-extension = mp4 output-format = mp4 delete-original = True post-process = False postopts = preopts = temp-extension = force-convert = False hwaccels = qsv hwaccel-decoders = hevc_qsv, h264_qsv minimum-size = 0 ignored-extensions = nfo, dsstore sort-streams = True process-same-extensions = True hwdevices = vaapi:/dev/dri/renderD128 hwaccel-output-format = vaapi:vaapi bypass-if-copying-all = False wait-post-process = False detailed-progress = False opts-separator = , regex-directory-replace = [^\w-. ] temp-output = False output-directory-space-ratio = 0.0

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

[Video] codec = h264,x264,h265,X265,hevc,H264,X264,H265,X265,HEVC bitrate = 0 crf = -1 max-width = 0 max-level = 5.1 pix-fmt = profile = crf-profiles = max-bitrate = 0 preset = codec-parameters = dynamic-parameters = False filter = force-filter = False bitrate-ratio = prioritize-source-pix-fmt = True

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

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

[Subtitle] codec = srt, mov_txt languages = eng default-language = eng embed-subs = False embed-only-internal-subs = False encoding = str codec-image-based = first-stream-of-language = False burn-subtitles = False embed-image-subs = False ignore-embedded-subs = False attachment-codec = burn-dispositions = filename-dispositions = forced ignored-dispositions = unique-dispositions = False remove-bitstream-subs = False include-original-language = False force-default = False

[CouchPotato] host = localhost port = 5050 username = password = webroot = ssl = False apikey = delay = 65 method = renamer delete-failed = False

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

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

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

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

[Plex] host = 10.0.0.4 port = 32400 refresh = True token = x username = password = servername = ssl = True ignore-certs = False path-mapping =

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

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

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

[Subtitle.Subliminal] download-subs = True download-hearing-impaired-subs = False providers = download-forced-subs = False include-hearing-impaired-subs = 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.Subliminal.Auth] opensubtitles = x:x tvsubtitles =

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

[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

Log files 2023-08-13 12:53:55 - SABPostProcess - INFO - SAB post processing started. 2023-08-13 12:53:55 - resources.readsettings - INFO - C:\Users\x\AppData\Local\Programs\Python\Python311\python.exe 2023-08-13 12:53:55 - resources.readsettings - INFO - Loading config file C:\MP4Automator\config\autoProcess.ini. 2023-08-13 12:53:55 - SABPostProcess - ERROR - Unexpected exception. Traceback (most recent call last): File "C:\MP4Automator\SABPostProcess.py", line 33, in settings = ReadSettings() ^^^^^^^^^^^^^^ File "C:\MP4Automator\resources\readsettings.py", line 474, in init self.readConfig(config) File "C:\MP4Automator\resources\readsettings.py", line 698, in readConfig for key, value in config.items(section): ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\configparser.py", line 875, in items return [(option, value_getter(option)) for option in orig_keys] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\configparser.py", line 875, in return [(option, value_getter(option)) for option in orig_keys] ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Gabe\AppData\Local\Programs\Python\Python311\Lib\configparser.py", line 871, in value_getter = lambda option: self._interpolation.before_get(self, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\configparser.py", line 396, in before_get self._interpolate_some(parser, option, L, value, section, defaults, 1) File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\configparser.py", line 443, in _interpolate_some raise InterpolationSyntaxError( configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%#444rDT^nctV5A2'

FFMpeg headers ffmpeg version git-2020-01-24-e931119 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9.2.1 (GCC) 20200122 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf libavutil 56. 38.100 / 56. 38.100 libavcodec 58. 66.100 / 58. 66.100 libavformat 58. 35.104 / 58. 35.104 libavdevice 58. 9.103 / 58. 9.103 libavfilter 7. 71.100 / 7. 71.100 libswscale 5. 6.100 / 5. 6.100 libswresample 3. 6.100 / 3. 6.100 libpostproc 55. 6.100 / 55. 6.100 Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

System Information

Expected behavior Scripts were running fine, converting files to desired format.

mdhiggins commented 1 year ago

Its failing to parse something in your subliminal [Subtitle.Subliminal.Auth] section, do you have special characters in one of the passwords maybe?

mdhiggins commented 1 year ago

Yeah looks like this is because your password contains a % character which python is trying to resolve

d8bff492c01d186c7092ee7a436723fca1b9c7df f2bc4a21bfab5af07ee1e88c11e76dab6b38e368

This should disable interpolation for the subliminal auth section while preserving it elsewhere

Also, it looks like you leaked your own password in the logs so you might want to change that

configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: 'PASSWORD'

mdhiggins commented 1 year ago

0aee6af0d26ed79c6c32b4d168b6e26221469438 5cbc33749bf771678702c7196302f7c1515758ae

Cleaned up the code a little and removed some unneeded logic, feel free to close this if it resolves your issue

gaben67 commented 1 year ago

Thanks for the quick response, that fixed the problem. Looks like it only leaked after the % but I still changed after testing with the old password.