System info:
Aleinware M14x R2 running Windows 10
Filebot from windows store
Latest python and filebot installed (the rest of the script works eg, file rename and moving)
So this is my python script:
Code: Select all
# Run Program:
# "C:\Users\me\Documents\utorrent-postprocess.pyw" "%L" "" "%N" "multi" "" "%F"
#
# Test with Console:
# py "C:\Users\me\Documents\utorrent-postprocess.pyw" "" "" "The.Big.Bang.Theory.S11E02.HDTV.x264-LOL[eztv].mkv" "multi" "" "D:\Downloads"
import sys
import subprocess
# configuration
output = 'D:/Transfer'
# custom formats (use / instead of \ as directory separator)
movieFormat = '''D:/Transfer/Movies/{n} ({y})'''
seriesFormat = '''I:/TV Shows/{n}/Season {s}/{n} {s00e00} {t}'''
animeFormat = '''{plex}'''
musicFormat = '''{plex}'''
# required args
label, state, title, kind, file, directory = sys.argv[1:7]
command = [
'filebot', '-script', 'fn:amc',
'--output', output,
'--action', 'duplicate',
'--conflict', 'skip',
'-non-strict',
'--log-file', output + '/amc.log',
'--def',
'excludeList=amc.txt',
'unsorted=y',
'movieFormat=' + movieFormat,
'seriesFormat=' + seriesFormat,
'animeFormat=' + animeFormat,
'musicFormat=' + musicFormat,
'ut_label=' + label,
'ut_state=' + state,
'ut_title=' + title,
'ut_kind=' + kind,
'ut_file=' + file,
'ut_dir=' + directory,
'kodi=Kodi:[email protected]:8080'
]
# execute command only for certain conditions (disabled by default)
'''
if state not in ['5', '11']:
print('Illegal state: %s' % state)
sys.exit(0)
'''
# execute command (and hide cmd window)
subprocess.run(command, creationflags=0x08000000)
Code: Select all
Notify Kodi: [host:Kodi:[email protected], port:8080]
POST: http://Kodi:[email protected]:8080/jsonrpc {"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"FileBot finished processing 1 files","message":"The.Big.Bang.Theory.S11E02.HDTV.x264-LOL[eztv].mkv","image":"https://app.filebot.net/icon.png"},"id":1}
IOException: Server returned HTTP response code: 401 for URL: http://Kodi:[email protected]:8080/jsonrpc
Done ヾ(@⌒ー⌒@)ノ
