KBlixt / subcleaner

removes ads from subtitle files cleanly.
288 stars 13 forks source link

Radarr support? #63

Open Hello-World-Traveler opened 4 hours ago

Hello-World-Traveler commented 4 hours ago

Is Radarr support possible when Radarr import srt files?

inside of a bash file (subclean.sh path/to/python /config/subcleaner/subcleaner.py works on calling on the script but it doesn't pass on the srt file name or the movie folder.

KBlixt commented 2 hours ago

I'd take a look at radarr custom scripts

https://wiki.servarr.com/radarr/custom-scripts

There they have a field called radarr_movie_path, I'd suggest starting there.

Hello-World-Traveler commented 1 hour ago
#!/usr/bin/env python3

import os
import subprocess

# Get Radarr environment variables
movie_file_path = os.environ.get('radarr_moviefile_path')
event_type = os.environ.get('radarr_eventtype')

# Only run for Download events
if event_type == 'Download' and movie_file_path:
    # Path to SubCleaner script
    subcleaner_path = '/config/subcleaner/subcleaner.py'

    # Run SubCleaner
    subprocess.run([subcleaner_path, movie_file_path])

I am not sure if this will work.