Python subprocess output and parsing

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Python subprocess output and parsing

Post by devster »

This is probably be more of a python question but I'll try anyway.
Based on the utorrent-postprocess.pyw script available on the filebot/plugins repo I was trying to convert my bash script for transmission to a python script.
I just wanted to have is to have easier access to parsing tools (csv, json) for other operations (web requests to services, symbolic link checking before processing, sqlite history with more information).
In some cases it's also useful to parse the output of the filebot command itself (line 60 of the script) does output to stdout but doesn't store the actual output as a variable; and I seem unable to achieve this. What I would like is to run filebot and, at the same time, output to stdout and store the same information as a variable. Does anyone know how?

Some examples of why this might be useful are, for example, sending email messages for movies which failed to match (wrong year sometimes messes up even in -non-strict mode) or fallback to other software if subtitles aren't found.

If there are alternative means to achieve any of this I'm open to them as well.
I only work in black and sometimes very, very dark grey. (Batman)
Post Reply