export processed files in json format
export processed files in json format
Is there any way to export the log of files that were just processed in JSON format?
I want to connect my CLI script to feed another script which logs the information.
I want to connect my CLI script to feed another script which logs the information.
Re: export processed files in json format
What kind of information are you looking for specifically?
* the console output is generally just line-by-line human-readable and there's no machine-readable option for log files
* the console output is generally just line-by-line human-readable and there's no machine-readable option for log files
Re: export processed files in json format
well the more information the better really. Just a list of the items renamed would be good but ideally, having file name, tvdb id, seperated episode/season etc. etc.
Re: export processed files in json format
After processing files with FileBot, completely unrelated to logging, you'll be able to read episode / movie metadata from xattr:
viewtopic.php?f=3&t=324
e.g.
viewtopic.php?f=3&t=324
e.g.
Code: Select all
filebot -script fn:xattr /path/to/files
Re: export processed files in json format
yeah i saw that one. But i only want the data of the most recently run rename script.
Re: export processed files in json format
You can have your own post-process script do things, whatever these things may be:
doSomething.sh
viewtopic.php?f=4&t=5047
Code: Select all
-exec /path/to/doSomething.sh {f} {json}
Code: Select all
#!/bin/sh -xu
echo "FILE: $1"
echo "META: $2"

Re: export processed files in json format
thats bloody perfect.
cheers mate.
cheers mate.
Re: export processed files in json format
Sorry mate one last thing.
Is there any way to get the number of processed files (other than working it out from the json output etc. within the script?)
Or better yet, is there are reference anywhere of all the output options that can be parsed to the script? f.whatever ?
Is there any way to get the number of processed files (other than working it out from the json output etc. within the script?)
Or better yet, is there are reference anywhere of all the output options that can be parsed to the script? f.whatever ?
Re: export processed files in json format
1.
You could use [+] to make -exec combine all arguments into a single call, so the number of arguments will be the number of files processed:
or
In this case, it's probably easier to read the json metadata from each file in the script, so you don't have to interpret arguments in some complicated way. I'm using | here because it's typically not allowed in file paths.
2.
I've added some docs on how to navigate references here:
viewtopic.php?f=9&t=10824
You could use [+] to make -exec combine all arguments into a single call, so the number of arguments will be the number of files processed:
Code: Select all
-exec /path/to/doSomething.sh {f} +
Code: Select all
-exec /path/to/doSomething.sh "{f} | {json}" +

2.
I've added some docs on how to navigate references here:
viewtopic.php?f=9&t=10824