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.51k stars 201 forks source link

Issues Running Plex_autoscan Post Process Script #1276

Closed psychoflame closed 4 years ago

psychoflame commented 4 years ago

Hey,

I'm trying to get your plex_autoscan script you have in the post process folder to work when running your docker SMA containers. I have edited the plex_autoscan.py to add my webhook and have mounted it into the container using a bind mount. The file mounts correctly and the permissions are correct or at least the same as other files in the sma folder. I've also set to true the option in the autoProcess.ini to run post process scripts as defined in the readme. The script runs and converts everything exactly as expected however it nevers calls the plex_autoscan service. I can see in the sma logs that it does supposely run the plex_autoscan.py script however there is no logging output. if the script fails does it output loggjng to the sma.log file? My sma.logs are below


2020-06-30 17:02:07 - SonarrPostProcess - INFO - Sonarr extra script post processing started.
2020-06-30 17:02:07 - resources.readsettings - INFO - /usr/local/sma/venv/bin/python3
2020-06-30 17:02:07 - resources.readsettings - INFO - Loading config file /usr/local/sma/config/autoProcess.ini.
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Processing /main/Remote/Media/TV/The Twilight Zone (2019)/Season 2/The Twilight Zone (2019) - S02E04 - Ovation WEBDL-1080p.mkv.
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Input Data
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - {
    "format": "matroska,webm",
    "format-fullname": "Matroska / WebM",
    "video": {
        "index": 0,
        "codec": "h264",
        "pix_fmt": "yuv420p",
        "profile": "high",
        "fps": 24.0,
        "level": 4.0,
        "field_order": "progressive"
    },
    "audio": [
        {
            "index": 1,
            "codec": "eac3",
            "channels": 6,
            "samplerate": 48000,
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired"
        }
    ],
    "subtitle": [
        {
            "index": 2,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "eng"
        },
        {
            "index": 3,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "eng"
        }
    ],
    "attachment": []
}
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Reading video stream.
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Video codec detected: h264.
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Pix Fmt: yuv420p.
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Profile: high.
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Reading audio streams.
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Audio detected for stream 1 - eac3 eng 6 channel.
2020-06-30 17:02:07 - resources.mediaprocessor - WARNING - Universal audio channel bitrate must be greater than 0, defaulting to 128 [universal-audio-channel-bitrate].
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Creating aac audio stream source audio stream 1 [universal-audio].
2020-06-30 17:02:07 - resources.mediaprocessor - WARNING - Unable to determine audio bitrate from source stream 1, defaulting to 128 per channel.
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Creating ac3 audio stream from source stream 1.
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Default audio stream set to eng ac3 6 channel stream [default-more-channels: True].
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Reading subtitle streams.
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 2 - subrip eng.
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 3 - subrip eng.
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Scanned for external subtitles and found 0 results in your approved languages.
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Output Data
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - {
    "source": [
        "/main/Remote/Media/TV/The Twilight Zone (2019)/Season 2/The Twilight Zone (2019) - S02E04 - Ovation WEBDL-1080p.mkv"
    ],
    "format": "mp4",
    "video": {
        "codec": "copy",
        "map": 0,
        "bitrate": 7976.411,
        "crf": -1,
        "maxrate": null,
        "bufsize": null,
        "level": 0.0,
        "profile": null,
        "pix_fmt": null,
        "field_order": "progressive",
        "width": null,
        "filter": null,
        "debug": "video"
    },
    "audio": [
        {
            "map": 1,
            "codec": "aac",
            "channels": 2,
            "bitrate": 256,
            "samplerate": null,
            "filter": null,
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "title": "Stereo",
            "debug": "universal-audio"
        },
        {
            "map": 1,
            "codec": "ac3",
            "channels": 6,
            "bitrate": 768,
            "filter": null,
            "samplerate": null,
            "language": "eng",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "bsf": null,
            "title": "5.1 Channel",
            "debug": "audio"
        }
    ],
    "subtitle": [],
    "attachment": []
}
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Preopts
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - []
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Postopts
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - [
    "-threads",
    "0",
    "-metadata:g",
    "encoding_tool=SMA"
]
2020-06-30 17:02:07 - resources.mediaprocessor - INFO - Starting conversion.
2020-06-30 17:04:57 - resources.mediaprocessor - INFO - /main/Remote/Media/TV/The Twilight Zone (2019)/Season 2/The Twilight Zone (2019) - S02E04 - Ovation WEBDL-1080p.mp4 created.
2020-06-30 17:04:58 - resources.mediaprocessor - INFO - Tagging /main/Remote/Media/TV/The Twilight Zone (2019)/Season 2/The Twilight Zone (2019) - S02E04 - Ovation WEBDL-1080p.mkv with TMDB ID 83135.
2020-06-30 17:04:58 - resources.metadata - INFO - Tagging file: /main/Remote/Media/TV/The Twilight Zone (2019)/Season 2/The Twilight Zone (2019) - S02E04 - Ovation WEBDL-1080p.mp4.
2020-06-30 17:04:58 - resources.metadata - INFO - Trying to write tags.
2020-06-30 17:04:58 - resources.metadata - INFO - Tags written successfully.
2020-06-30 17:04:58 - resources.mediaprocessor - INFO - Relocating MOOV atom to start of file.
2020-06-30 17:04:58 - qtfaststart - INFO - Removing free atom at 32 (8 bytes)
2020-06-30 17:04:58 - qtfaststart - INFO - Patching stco with 59777 entries
2020-06-30 17:04:58 - qtfaststart - INFO - Patching stco with 97451 entries
2020-06-30 17:04:58 - qtfaststart - INFO - Patching stco with 77836 entries
2020-06-30 17:04:58 - qtfaststart - INFO - Writing output...
2020-06-30 17:06:44 - resources.mediaprocessor - INFO - Running script '/usr/local/sma/resources/../post_process/iTunes.py'.
2020-06-30 17:06:44 - resources.mediaprocessor - INFO - Running script '/usr/local/sma/resources/../post_process/plex_autoscan.py'.
2020-06-30 17:06:44 - resources.mediaprocessor - INFO - Running script '/usr/local/sma/resources/../post_process/sample.py'.
2020-06-30 17:06:44 - SonarrPostProcess - INFO - Sonarr response RescanSeries command: ID 42447 queued.
2020-06-30 17:06:44 - SonarrPostProcess - INFO - Requesting episode information from Sonarr for series ID 408.
2020-06-30 17:06:44 - SonarrPostProcess - INFO - State: started.
2020-06-30 17:06:54 - SonarrPostProcess - INFO - Final state: completed.
2020-06-30 17:06:54 - SonarrPostProcess - INFO - Rescan command completed
2020-06-30 17:06:54 - SonarrPostProcess - INFO - Requesting updated episode information from Sonarr for series ID 408.
2020-06-30 17:06:54 - SonarrPostProcess - INFO - Sonarr monitoring information updated for episode Ovation.
2020-06-30 17:06:54 - SonarrPostProcess - INFO - Sonarr response RenameSeries command: ID 42448 queued.
mdhiggins commented 4 years ago

Could you post your config? It doesn’t look likes it’s running. The rescan line is a Sonarr function.

mdhiggins commented 4 years ago

Oh wait never mind I see it now, do the other scripts run? If you put a basic test script in there that does something you can easily check work?

psychoflame commented 4 years ago

So ripped this script and created it in the docker container under the post process folder, running it manually it worked fine, however when having it called by sma script it doesn't run. It should created a folder, but doesn't when being called by sma script. My script and logs are below

#!/usr/bin/env python3
import os

# define the name of the directory to be created
path = "/tmp/sma"

try:
    os.mkdir(path)
except OSError:
    print ("Creation of the directory %s failed" % path)
else:
    print ("Successfully created the directory %s " % path)

2020-06-30 18:09:14 - SonarrPostProcess - INFO - Sonarr extra script post processing started.
2020-06-30 18:09:14 - resources.readsettings - INFO - /usr/local/sma/venv/bin/python3
2020-06-30 18:09:14 - resources.readsettings - INFO - Loading config file /usr/local/sma/config/autoProcess.ini.
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Processing /main/Remote/Media/TV/The Twilight Zone (2019)/Season 2/The Twilight Zone (2019) - S02E06 - 8 WEBDL-1080p.mkv.
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Input Data
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - {
    "format": "matroska,webm",
    "format-fullname": "Matroska / WebM",
    "video": {
        "index": 0,
        "codec": "h264",
        "pix_fmt": "yuv420p",
        "profile": "high",
        "fps": 24.0,
        "level": 4.0,
        "field_order": "progressive"
    },
    "audio": [
        {
            "index": 1,
            "codec": "eac3",
            "channels": 6,
            "samplerate": 48000,
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired"
        }
    ],
    "subtitle": [
        {
            "index": 2,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "eng"
        },
        {
            "index": 3,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "eng"
        }
    ],
    "attachment": []
}
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Reading video stream.
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Video codec detected: h264.
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Pix Fmt: yuv420p.
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Profile: high.
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Reading audio streams.
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Audio detected for stream 1 - eac3 eng 6 channel.
2020-06-30 18:09:14 - resources.mediaprocessor - WARNING - Universal audio channel bitrate must be greater than 0, defaulting to 128 [universal-audio-channel-bitrate].
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Creating aac audio stream source audio stream 1 [universal-audio].
2020-06-30 18:09:14 - resources.mediaprocessor - WARNING - Unable to determine audio bitrate from source stream 1, defaulting to 128 per channel.
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Creating ac3 audio stream from source stream 1.
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Default audio stream set to eng ac3 6 channel stream [default-more-channels: True].
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Reading subtitle streams.
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 2 - subrip eng.
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 3 - subrip eng.
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Scanned for external subtitles and found 0 results in your approved languages.
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Output Data
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - {
    "source": [
        "/main/Remote/Media/TV/The Twilight Zone (2019)/Season 2/The Twilight Zone (2019) - S02E06 - 8 WEBDL-1080p.mkv"
    ],
    "format": "mp4",
    "video": {
        "codec": "copy",
        "map": 0,
        "bitrate": 5527.26,
        "crf": -1,
        "maxrate": null,
        "bufsize": null,
        "level": 0.0,
        "profile": null,
        "pix_fmt": null,
        "field_order": "progressive",
        "width": null,
        "filter": null,
        "debug": "video"
    },
    "audio": [
        {
            "map": 1,
            "codec": "aac",
            "channels": 2,
            "bitrate": 256,
            "samplerate": null,
            "filter": null,
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "title": "Stereo",
            "debug": "universal-audio"
        },
        {
            "map": 1,
            "codec": "ac3",
            "channels": 6,
            "bitrate": 768,
            "filter": null,
            "samplerate": null,
            "language": "eng",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "bsf": null,
            "title": "5.1 Channel",
            "debug": "audio"
        }
    ],
    "subtitle": [],
    "attachment": []
}
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Preopts
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - []
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Postopts
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - [
    "-threads",
    "0",
    "-metadata:g",
    "encoding_tool=SMA"
]
2020-06-30 18:09:14 - resources.mediaprocessor - INFO - Starting conversion.
2020-06-30 18:10:43 - resources.mediaprocessor - INFO - /main/Remote/Media/TV/The Twilight Zone (2019)/Season 2/The Twilight Zone (2019) - S02E06 - 8 WEBDL-1080p.mp4 created.
2020-06-30 18:10:44 - resources.mediaprocessor - INFO - Tagging /main/Remote/Media/TV/The Twilight Zone (2019)/Season 2/The Twilight Zone (2019) - S02E06 - 8 WEBDL-1080p.mkv with TMDB ID 83135.
2020-06-30 18:10:44 - resources.metadata - INFO - Tagging file: /main/Remote/Media/TV/The Twilight Zone (2019)/Season 2/The Twilight Zone (2019) - S02E06 - 8 WEBDL-1080p.mp4.
2020-06-30 18:10:44 - resources.metadata - INFO - Trying to write tags.
2020-06-30 18:10:44 - resources.metadata - INFO - Tags written successfully.
2020-06-30 18:10:44 - resources.mediaprocessor - INFO - Relocating MOOV atom to start of file.
2020-06-30 18:10:44 - qtfaststart - INFO - Removing free atom at 32 (8 bytes)
2020-06-30 18:10:44 - qtfaststart - INFO - Patching stco with 44894 entries
2020-06-30 18:10:45 - qtfaststart - INFO - Patching stco with 73189 entries
2020-06-30 18:10:45 - qtfaststart - INFO - Patching stco with 58458 entries
2020-06-30 18:10:45 - qtfaststart - INFO - Writing output...
2020-06-30 18:11:21 - resources.mediaprocessor - INFO - Running script '/usr/local/sma/resources/../post_process/iTunes.py'.
2020-06-30 18:11:21 - resources.mediaprocessor - INFO - Running script '/usr/local/sma/resources/../post_process/plex_autoscan.py'.
2020-06-30 18:11:21 - resources.mediaprocessor - INFO - Running script '/usr/local/sma/resources/../post_process/sample.py'.
2020-06-30 18:11:21 - resources.mediaprocessor - INFO - Running script '/usr/local/sma/resources/../post_process/test.py'.
2020-06-30 18:11:21 - SonarrPostProcess - INFO - Sonarr response RescanSeries command: ID 42558 queued.
2020-06-30 18:11:21 - SonarrPostProcess - INFO - Requesting episode information from Sonarr for series ID 408.
2020-06-30 18:11:21 - SonarrPostProcess - INFO - State: started.
2020-06-30 18:11:31 - SonarrPostProcess - INFO - Final state: completed.
2020-06-30 18:11:31 - SonarrPostProcess - INFO - Rescan command completed
2020-06-30 18:11:31 - SonarrPostProcess - INFO - Requesting updated episode information from Sonarr for series ID 408.
2020-06-30 18:11:31 - SonarrPostProcess - INFO - Sonarr monitoring information updated for episode 8.
2020-06-30 18:11:31 - SonarrPostProcess - INFO - Sonarr response RenameSeries command: ID 42559 queued.
mdhiggins commented 4 years ago

Depending on how you have your operating system setup you might need to wrap things in a small shell script and point to your python executable The post script execution is essentially just calling those files as executables so if the filetype isn't associated with python it may not launch

My dev machine is on windows and for example if I just use .py files it opens them in visual studio code instead of executing them because that's what the OS does with .py files but if I wrap things in a .bat file and point to python it works fine

psychoflame commented 4 years ago

The environment is your Sonarr/Radarr-SMA docker container images. I did check to see if the file would run if it was not called via python but as a shell script and you were partially right, it would error out with a permissions issue as scripts in your Sonarr-SMA post_process folder do not have executable rights. Once i chmod +x the folder i could run the scripts. However now there is a new issue, where when i go to run the script i get an error saying there is no module called requests. I actual get it on running any script using the call, ./postSonarr.py, it can't find any of its imported modules. However running the script normally called through sonarr it works fine and does convert stuff. However for the post_processing scripts i think it is erroring out with that module error however im not certain as it still doesnt show log output when called via the SMA scripts. I did change the shebang in the plex_autoscan.py file to be "#!/usr/bin/env python3" similar to other scripts in the SMA folder however i still get that import error. Any idea what it could be

Log error i get

root@8360cffa3a9e:/usr/local/sma/post_process# ls -l
total 20
-rw-r--r--  1 abc abc 1115 Jun 25 03:44 iTunes.py
-rwxrwxr-x+ 1 abc abc  652 Jun 30 17:49 plex_autoscan.py
drwxr-xr-x  1 abc abc 4096 Jun 25 03:44 resources
-rw-r--r--  1 abc abc  231 Jun 25 03:44 sample.py
root@8360cffa3a9e:/usr/local/sma/post_process# ./plex_autoscan.py
Traceback (most recent call last):
  File "./plex_autoscan.py", line 4, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'
root@8360cffa3a9e:/usr/local/sma/post_process# cat plex_autoscan.py
#!/usr/bin/env python3
import os
import json
import requests

def main():
    print("plex_autoscan Post-processing Script")
    url = "http://1**.19.*7.1*:3467/1181d0e45ac3*09c87619c95***388bc2b"

    files = json.loads(os.environ.get('SMA_FILES'))
    if not (files):
        print("Error - Did not find environment variables.")
        return

    for filename in files:
        dirname = os.path.dirname(filename)
        payload = {'eventType': 'Manual', 'filepath': dirname}
    try:
        requests.post(url, json=payload)
    except Exception as e:
        print("Error - Request failed")
        print(e)

if __name__ == "__main__":
    main()root@8360cffa3a9e:/usr/local/sma/post_process#
psychoflame commented 4 years ago

So i took your advice and created a shell script and placed that in the post_process folder, it seems to be called according to the sma log but again it doesn't look like the plex_autoscan.py script is being called. Relevent logs and shell script below


2020-06-30 22:47:57 - SonarrPostProcess - INFO - Sonarr extra script post processing started.
2020-06-30 22:47:57 - resources.readsettings - INFO - /usr/local/sma/venv/bin/python3
2020-06-30 22:47:57 - resources.readsettings - INFO - Loading config file /usr/local/sma/config/autoProcess.ini.
2020-06-30 22:47:57 - resources.mediaprocessor - INFO - Processing /main/Remote/Media/TV/The Twilight Zone (2019)/Season 2/The Twilight Zone (2019) - S02E08 - A Small Town WEBDL-1080p.mkv.
2020-06-30 22:47:57 - resources.mediaprocessor - INFO - Input Data
2020-06-30 22:47:57 - resources.mediaprocessor - INFO - {
    "format": "matroska,webm",
    "format-fullname": "Matroska / WebM",
    "video": {
        "index": 0,
        "codec": "h264",
        "pix_fmt": "yuv420p",
        "profile": "high",
        "fps": 24.0,
        "level": 4.0,
        "field_order": "progressive"
    },
    "audio": [
        {
            "index": 1,
            "codec": "eac3",
            "channels": 6,
            "samplerate": 48000,
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired"
        }
    ],
    "subtitle": [
        {
            "index": 2,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "eng"
        },
        {
            "index": 3,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "eng"
        }
    ],
    "attachment": []
}
2020-06-30 22:47:57 - resources.mediaprocessor - INFO - Reading video stream.
2020-06-30 22:47:57 - resources.mediaprocessor - INFO - Video codec detected: h264.
2020-06-30 22:47:57 - resources.mediaprocessor - INFO - Pix Fmt: yuv420p.
2020-06-30 22:47:57 - resources.mediaprocessor - INFO - Profile: high.
2020-06-30 22:47:57 - resources.mediaprocessor - INFO - Reading audio streams.
2020-06-30 22:47:57 - resources.mediaprocessor - INFO - Audio detected for stream 1 - eac3 eng 6 channel.
2020-06-30 22:47:57 - resources.mediaprocessor - WARNING - Universal audio channel bitrate must be greater than 0, defaulting to 128 [universal-audio-channel-bitrate].
2020-06-30 22:47:57 - resources.mediaprocessor - INFO - Creating aac audio stream source audio stream 1 [universal-audio].
2020-06-30 22:47:57 - resources.mediaprocessor - WARNING - Unable to determine audio bitrate from source stream 1, defaulting to 128 per channel.
2020-06-30 22:47:57 - resources.mediaprocessor - INFO - Creating ac3 audio stream from source stream 1.
2020-06-30 22:47:57 - resources.mediaprocessor - INFO - Default audio stream set to eng ac3 6 channel stream [default-more-channels: True].
2020-06-30 22:47:57 - resources.mediaprocessor - INFO - Reading subtitle streams.
2020-06-30 22:47:58 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 2 - subrip eng.
2020-06-30 22:47:58 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 3 - subrip eng.
2020-06-30 22:47:58 - resources.mediaprocessor - INFO - Scanned for external subtitles and found 0 results in your approved languages.
2020-06-30 22:47:58 - resources.mediaprocessor - INFO - Output Data
2020-06-30 22:47:58 - resources.mediaprocessor - INFO - {
    "source": [
        "/main/Remote/Media/TV/The Twilight Zone (2019)/Season 2/The Twilight Zone (2019) - S02E08 - A Small Town WEBDL-1080p.mkv"
    ],
    "format": "mp4",
    "video": {
        "codec": "copy",
        "map": 0,
        "bitrate": 6339.696,
        "crf": -1,
        "maxrate": null,
        "bufsize": null,
        "level": 0.0,
        "profile": null,
        "pix_fmt": null,
        "field_order": "progressive",
        "width": null,
        "filter": null,
        "debug": "video"
    },
    "audio": [
        {
            "map": 1,
            "codec": "aac",
            "channels": 2,
            "bitrate": 256,
            "samplerate": null,
            "filter": null,
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "title": "Stereo",
            "debug": "universal-audio"
        },
        {
            "map": 1,
            "codec": "ac3",
            "channels": 6,
            "bitrate": 768,
            "filter": null,
            "samplerate": null,
            "language": "eng",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "bsf": null,
            "title": "5.1 Channel",
            "debug": "audio"
        }
    ],
    "subtitle": [],
    "attachment": []
}
2020-06-30 22:47:58 - resources.mediaprocessor - INFO - Preopts
2020-06-30 22:47:58 - resources.mediaprocessor - INFO - []
2020-06-30 22:47:58 - resources.mediaprocessor - INFO - Postopts
2020-06-30 22:47:58 - resources.mediaprocessor - INFO - [
    "-threads",
    "0",
    "-metadata:g",
    "encoding_tool=SMA"
]
2020-06-30 22:47:58 - resources.mediaprocessor - INFO - Starting conversion.
2020-06-30 22:49:32 - resources.mediaprocessor - INFO - /main/Remote/Media/TV/The Twilight Zone (2019)/Season 2/The Twilight Zone (2019) - S02E08 - A Small Town WEBDL-1080p.mp4 created.
2020-06-30 22:49:33 - resources.mediaprocessor - INFO - Tagging /main/Remote/Media/TV/The Twilight Zone (2019)/Season 2/The Twilight Zone (2019) - S02E08 - A Small Town WEBDL-1080p.mkv with TMDB ID 83135.
2020-06-30 22:49:33 - resources.metadata - INFO - Tagging file: /main/Remote/Media/TV/The Twilight Zone (2019)/Season 2/The Twilight Zone (2019) - S02E08 - A Small Town WEBDL-1080p.mp4.
2020-06-30 22:49:33 - resources.metadata - INFO - Trying to write tags.
2020-06-30 22:49:34 - resources.metadata - INFO - Tags written successfully.
2020-06-30 22:49:34 - resources.mediaprocessor - INFO - Relocating MOOV atom to start of file.
2020-06-30 22:49:34 - qtfaststart - INFO - Removing free atom at 32 (8 bytes)
2020-06-30 22:49:34 - qtfaststart - INFO - Patching stco with 50790 entries
2020-06-30 22:49:34 - qtfaststart - INFO - Patching stco with 82801 entries
2020-06-30 22:49:34 - qtfaststart - INFO - Patching stco with 66135 entries
2020-06-30 22:49:34 - qtfaststart - INFO - Writing output...
2020-06-30 22:50:31 - resources.mediaprocessor - INFO - Running script '/usr/local/sma/resources/../post_process/iTunes.py'.
2020-06-30 22:50:31 - resources.mediaprocessor - INFO - Running script '/usr/local/sma/resources/../post_process/plex_autoscan.py'.
2020-06-30 22:50:31 - resources.mediaprocessor - INFO - Running script '/usr/local/sma/resources/../post_process/plex_autoscan.sh'.
2020-06-30 22:50:31 - resources.mediaprocessor - INFO - Running script '/usr/local/sma/resources/../post_process/sample.py'.
2020-06-30 22:50:32 - SonarrPostProcess - INFO - Sonarr response RescanSeries command: ID 43038 started.
2020-06-30 22:50:32 - SonarrPostProcess - INFO - Requesting episode information from Sonarr for series ID 408.
2020-06-30 22:50:32 - SonarrPostProcess - INFO - State: started.

#!/usr/bin/env bash

$SMA_PATH/venv/bin/python3 $SMA_PATH/post_process/plex_autoscan.py
psychoflame commented 4 years ago

i got it to work finally, you were right we do need that shell script to actual get the python files to execute properly. My issue from above was that i forgot to make that shell script i created executable as well. Once i did, the plex_autoscan script started calling the webhook as expected. Thanks for you help with this issue