posborne / putio-sync

Python daemon that automatically downloads files from put.io
MIT License
29 stars 12 forks source link

Add support for calling an external script upon download completion #17

Closed posborne closed 9 years ago

posborne commented 9 years ago

Suppose we have a file, myfile.ext that has just completed downloading. It would be nice to be able to invoke an external program to process this new file after the download is complete.

Pehraps something like...

putio-sync ... --postprocess='cmdline'

Where cmdline would have the full path to the file that was just completed tacked onto the end. So, if my command where 'python postprocess.py -v -d /home/posborne/blah', the final command that would be executed would be something like python postprocess.py -v -d /home/posborne/blah /path/to/myfile.ext1. We could have the user specify a python format string or similar, but I think this satisfies the basic need. Some users might need a shell shim if there is a mismatch with whatever tool they are using doesn't work with this model.