#!/usr/bin/python from sys import argv # title = show title # season = season # # fileNameBase is file name without path # dbName is your tdarr database name # adjust arrayOrPath to path name of fileNameBase # tdarr_url = "http://192.168.1.122:8266/api/v2/scan-files" # payload = {"data": {"scanConfig": { "dbID": dbName, "arrayOrPath": ["/media/TVShows/" + title + "/Season " + season + "/" + fileNameBase[:-3] + '.mkv'], "mode": "scanFolderWatcher"}}} # headers = {"content-type": "application/json"} # response = requests.post(tdarr_url, json=payload, headers=headers) fp = open('/opt/testlog.log', 'a', 0) fp.write("Testing") fp.write("%s" % argv)