yajrendrag

call tdarr to process file

Jan 6th, 2023
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #title = show title
  2. #season = season #
  3. #fileNameBase is file name without path
  4. #dbName is your tdarr database name
  5. #adjust arrayOrPath to path name of fileNameBase
  6. tdarr_url = "http://192.168.1.122:8266/api/v2/scan-files"
  7. payload = {"data": {"scanConfig": { "dbID": dbName, "arrayOrPath": ["/media/TVShows/" + title + "/Season " + season + "/" + fileNameBase[:-3] + '.mkv'], "mode": "scanFolderWatcher"}}}
  8. headers = {"content-type": "application/json"}
  9. response = requests.post(tdarr_url, json=payload, headers=headers)
Advertisement
Add Comment
Please, Sign In to add comment