crazydevman / mute-profanity

XBMC add-on used to mute profanity
GNU General Public License v3.0
34 stars 14 forks source link

Question: Any way to run from command line and create EDL? #38

Closed wallheater closed 4 years ago

wallheater commented 4 years ago

I'm just starting to test EDL files with Kodi. This plugin looks great! If I want to edit an EDL manually though, to fine-tune timings, is there a way one of your modules could just generate EDL from subtitles via Python on the command line? Input would be SRT file (and block list), output would be EDL text. Thanks!

crazydevman commented 4 years ago

Yes, you should be able to run (via python2) the script create_edl.py which exists in the 'lib' directory.

crazydevman commented 4 years ago

Just did a quick check and looks like it's a little out dated (I originally wrote this a long time ago). Here's the diff I used to make it work:


index c7b550e..4622c6d 100644
--- a/resources/lib/create_edl.py
+++ b/resources/lib/create_edl.py
@@ -14,12 +14,12 @@ import filter
 def main():
     args = sys.argv
     if len(args) < 3:
-        print "Usage: srtFile filterFile"
+        print "Usage: srtFile filterFile outputfile"
         sys.exit()

     categories = filter.parse_file(args[2])
     profanity = filter.get_all_words(categories)
-    worker = EDLManager(args[1], profanity)
+    worker = EDLManager(args[1], args[3], profanity)

     if len(args) == 4:
         worker.setEDLName(args[3])```