mdhiggins / sonarr-sma

Sonarr docker based on linuxserver/sonarr with SMA built in using python3
MIT License
39 stars 18 forks source link

Can't get SMA to delete torrent after conversion #62

Closed tj1816 closed 2 weeks ago

tj1816 commented 2 weeks ago

I recently installed sonarr-sma and radarr-sma and it's been working great so far. Unfortunately I'm not able to get the action-after=deletedata to work with qBittorrent. The last log entry is saying the sonarr/radarr's response for the Rename command is queued. I assume the deletedata action happens after that but for whatever reason isn't running. Any help is greatly appreciated.

sma.log:

2024-10-06 13:12:38 - SonarrPostProcess - INFO - Sonarr extra script post processing started.
2024-10-06 13:12:38 - resources.readsettings - INFO - /usr/local/sma/venv/bin/python3
2024-10-06 13:12:38 - resources.readsettings - INFO - Loading config file /usr/local/sma/config/autoProcess.ini.
2024-10-06 13:12:38 - resources.mediaprocessor - INFO - Processing /tv/Saturday Night Live/Season 50/Saturday.Night.Live.S50E02.Nate.Bargatze.Coldplay.1080p.HULU.WEB-DL.H264-None.mkv.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Input Data
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - {
    "format": "matroska,webm",
    "format-fullname": "Matroska / WebM",
    "video": {
        "index": 1,
        "codec": "h264",
        "pix_fmt": "yuv420p",
        "profile": "high",
        "fps": 59.94006309148265,
        "framedata": {
            "pix_fmt": "yuv420p",
            "side_data_list": [
                {
                    "side_data_type": "ATSC A53 Part 4 Closed Captions"
                }
            ]
        },
        "dimensions": "1920x1080",
        "level": 4.2,
        "field_order": "progressive"
    },
    "audio": [
        {
            "index": 2,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "eng",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        }
    ],
    "subtitle": [
        {
            "index": 0,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "eng"
        }
    ],
    "attachment": []
}
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Reading video stream.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Video codec detected: h264.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Pix Fmt: yuv420p.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Profile: high.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Video codec parameters None.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Creating copy video stream from source stream 1.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Reading audio streams.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - The following stream indexes have been identified as being copies: [] [stream-codec-combinations].
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Audio detected for stream 2 - eac3 eng 6 channel.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Creating ac3 audio stream from source stream 2.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Creating aac audio stream from source audio stream 2 [universal-audio].
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Found 0 streams that can be removed from the output file since they will be duplicates [stream-codec-combinations].
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Final sorting:
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - ['0->0', '1->1']
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Final sorting:
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - ['0->0', '1->1']
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Default audio stream set to eng ac3 6 channel stream [audio-default-sorting: ['channels.d', 'map', 'd.comment']].
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Reading subtitle streams.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Subtitle detected for stream 0 - subrip eng.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Stream 0 is text-based subtitle for codec subrip.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Creating mov_text subtitle stream from source stream 0.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Scanned for external subtitles and found 0 results in your approved languages.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Final sorting:
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - ['0->0']
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Output Data
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - {
    "source": [
        "/tv/Saturday Night Live/Season 50/Saturday.Night.Live.S50E02.Nate.Bargatze.Coldplay.1080p.HULU.WEB-DL.H264-None.mkv"
    ],
    "format": "mp4",
    "video": {
        "codec": "copy",
        "map": 1,
        "bitrate": 7772.51145,
        "crf": -1,
        "maxrate": null,
        "bufsize": null,
        "level": 0.0,
        "profile": null,
        "preset": null,
        "pix_fmt": null,
        "field_order": "progressive",
        "width": null,
        "filter": null,
        "params": null,
        "framedata": null,
        "bsf": "filter_units=remove_types=6",
        "debug": "video",
        "title": "FHD"
    },
    "audio": [
        {
            "map": 2,
            "codec": "ac3",
            "channels": 6,
            "bitrate": 768,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "eng",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "bsf": null,
            "debug": "audio",
            "title": "5.1 Channel"
        },
        {
            "map": 2,
            "codec": "aac",
            "channels": 2,
            "bitrate": 256,
            "quality": 0,
            "profile": null,
            "samplerate": null,
            "sampleformat": "",
            "filter": null,
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "debug": "universal-audio",
            "title": "Stereo"
        }
    ],
    "subtitle": [
        {
            "map": 0,
            "codec": "mov_text",
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "debug": "subtitle.embed-subs",
            "title": null
        }
    ],
    "attachment": []
}
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Preopts
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - []
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Postopts
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - [
    "-threads",
    "0",
    "-metadata:g",
    "encoding_tool=SMA"
]
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - Starting conversion.
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - FFmpeg command:
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - ======================
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - /usr/local/bin/ffmpeg -fix_sub_duration -i "/tv/Saturday Night Live/Season 50/Saturday.Night.Live.S50E02.Nate.Bargatze.Coldplay.1080p.HULU.WEB-DL.H264-None.mkv" -vcodec copy -map 0:1 -bsf:v filter_units=remove_types=6 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -c:a:0 ac3 -map 0:2 -ac:a:0 6 -b:a:0 768k -metadata:s:a:0 BPS=768000 -metadata:s:a:0 BPS-eng=768000 -metadata:s:a:0 "title=5.1 Channel" -metadata:s:a:0 "handler_name=5.1 Channel" -metadata:s:a:0 language=eng -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:1 aac -map 0:2 -ac:a:1 2 -b:a:1 256k -metadata:s:a:1 BPS=256000 -metadata:s:a:1 BPS-eng=256000 -metadata:s:a:1 title=Stereo -metadata:s:a:1 handler_name=Stereo -metadata:s:a:1 language=eng -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -strict experimental -c:s:0 mov_text -map 0:0 -metadata:s:s:0 title= -metadata:s:s:0 handler_name= -metadata:s:s:0 language=eng -disposition:s:0 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f mp4 -threads 0 -metadata:g encoding_tool=SMA -y "/tv/Saturday Night Live/Season 50/Saturday.Night.Live.S50E02.Nate.Bargatze.Coldplay.1080p.HULU.WEB-DL.H264-None.mp4"
2024-10-06 13:12:39 - resources.mediaprocessor - INFO - ======================
2024-10-06 13:19:39 - resources.mediaprocessor - INFO - /tv/Saturday Night Live/Season 50/Saturday.Night.Live.S50E02.Nate.Bargatze.Coldplay.1080p.HULU.WEB-DL.H264-None.mp4 created.
2024-10-06 13:19:40 - resources.mediaprocessor - INFO - Tagging /tv/Saturday Night Live/Season 50/Saturday.Night.Live.S50E02.Nate.Bargatze.Coldplay.1080p.HULU.WEB-DL.H264-None.mkv with TMDB ID 1667.
2024-10-06 13:19:40 - resources.metadata - INFO - Tagging file: /tv/Saturday Night Live/Season 50/Saturday.Night.Live.S50E02.Nate.Bargatze.Coldplay.1080p.HULU.WEB-DL.H264-None.mp4.
2024-10-06 13:19:41 - resources.metadata - INFO - Trying to write tags.
2024-10-06 13:19:42 - resources.metadata - INFO - Tags written successfully using mutagen.
2024-10-06 13:19:42 - resources.mediaprocessor - INFO - Relocating MOOV atom to start of file.
2024-10-06 13:19:42 - qtfaststart - INFO - Patching co64 with 231382 entries
2024-10-06 13:19:42 - qtfaststart - INFO - Patching co64 with 129292 entries
2024-10-06 13:19:42 - qtfaststart - INFO - Patching co64 with 193939 entries
2024-10-06 13:19:42 - qtfaststart - INFO - Patching co64 with 1727 entries
2024-10-06 13:19:42 - qtfaststart - INFO - Patching stco with 1 entries
2024-10-06 13:19:42 - qtfaststart - INFO - Writing output...
2024-10-06 13:20:34 - SonarrPostProcess - INFO - Sonarr response from RescanSeries command: ID 9002 started.
2024-10-06 13:20:44 - SonarrPostProcess - INFO - Rescan command completed.
2024-10-06 13:20:44 - SonarrPostProcess - INFO - Sonarr monitoring information updated for episode Nate Bargatze / Coldplay.
2024-10-06 13:20:45 - SonarrPostProcess - INFO - Sonarr response from Rename command: ID 9004 queued.

autoProcess.ini:

[Converter]
ffmpeg = ffmpeg
ffprobe = ffprobe
threads = 0
hwaccels = 
hwaccel-decoders = 
hwdevices = 
hwaccel-output-format = 
output-directory = 
output-directory-space-ratio = 0.0
output-format = mp4
output-extension = mp4
temp-extension = 
minimum-size = 0
ignored-extensions = nfo, ds_store
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 = 0664
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 = 
include-original-language = True
first-stream-of-language = False
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 = 
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 = 
force-default = False
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 = 
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 = 192.168.1.6
port = 8998
apikey = [redacted]
ssl = False
webroot = 
force-rename = False
rescan = True
in-progress-check = True
block-reprocess = False

[Radarr]
host = 192.168.1.6
port = 7887
apikey = [redacted]
ssl = False
webroot = 
force-rename = False
rescan = True
in-progress-check = True
block-reprocess = False

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

[Plex]
username = 
password = 
servername = 
host = 192.168.1.161
port = 32400
refresh = False
token = [redacted]
ssl = True
ignore-certs = False
path-mapping = 
mdhiggins commented 2 weeks ago

The deletedata function is only part of the qBittorrentPostProcess.py post processing script, which sonarr-sma and radarr-sma do not make use of. If you want this functionality you'll need to disable completed download handling and configure that script to use with qbt or configure sonarr to delete the torrents for you instead

Having sonarr do it is probably the easiest option image

tj1816 commented 2 weeks ago

Oh ok gotcha, thanks