Author Topic: Can't run external program  (Read 3382 times)

aaronsher

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Can't run external program
« on: November 28, 2015, 01:51:44 pm »
I'm trying to use FileBot to process videos after they're downloaded, but as far as I can tell the "Run an external program on torrent completion" option just doesn't do anything. I've tried a whole bunch of different variations (down to "echo foo >> ~/debug.txt"), and I can't see any effect. Am I missing something?

ciaobaby

  • Forum addict
  • ****
  • Posts: 2771
  • Karma: +98/-25
  • No quarter asked... No quarter given.
    • View Profile
    • WMTeu
Re: Can't run external program
« Reply #1 on: November 28, 2015, 03:43:31 pm »
We are missing what client version you are using.
Smarter than the av-er-age bear, Boo Boo.

http://qbforums.shiki.hu/index.php/topic,3084.0.html

aaronsher

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Can't run external program
« Reply #2 on: November 28, 2015, 03:46:35 pm »
Sorry, it's 3.2.5 running on Mac OS X 10.9.5. It's an old machine, so I'd prefer not to upgrade the OS unless there's a compelling reason to.

ciaobaby

  • Forum addict
  • ****
  • Posts: 2771
  • Karma: +98/-25
  • No quarter asked... No quarter given.
    • View Profile
    • WMTeu
Re: Can't run external program
« Reply #3 on: November 28, 2015, 04:25:50 pm »
Okay,

Maybe just the way you typed it here, but is "echo foo >> ~/debug.txt" a literal copy from the options -> downloads dialogue (including the quotes)?

Smarter than the av-er-age bear, Boo Boo.

http://qbforums.shiki.hu/index.php/topic,3084.0.html

aaronsher

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Can't run external program
« Reply #4 on: November 28, 2015, 05:33:13 pm »
I've tried a bunch of different things, but no, there were no quotes. Here's what I have at the moment:

filebot -script fn:amc --output "/Users/asher/Media" --log-file amc.log --action copy --conflict override -non-strict --def music=y subtitles=en artwork=y excludeList=amc.txt "%f"

Regardless of what I enter, though, it seems like the command just doesn't get run.

aaronsher

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Can't run external program
« Reply #5 on: November 28, 2015, 05:34:35 pm »
Update: I went back and retried this command (copied and pasted from the entry field), just to be sure:

echo foo >> ~/debug.txt

I then downloaded a test file, and the debug.txt file does not contain the word "foo" as expected.
« Last Edit: November 28, 2015, 06:36:55 pm by aaronsher »

ciaobaby

  • Forum addict
  • ****
  • Posts: 2771
  • Karma: +98/-25
  • No quarter asked... No quarter given.
    • View Profile
    • WMTeu
Re: Can't run external program
« Reply #6 on: November 28, 2015, 09:00:35 pm »
Was debug.txt created at that point or did it already exist?
Smarter than the av-er-age bear, Boo Boo.

http://qbforums.shiki.hu/index.php/topic,3084.0.html

aaronsher

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Can't run external program
« Reply #7 on: November 28, 2015, 11:45:44 pm »
It already existed. And I ran the same command on the command line to prove that I didn't mistype it somehow.

aaronsher

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Can't run external program
« Reply #8 on: December 04, 2015, 04:53:39 pm »
Any thoughts on this? Is there an official support channel I can use? I assume this feature isn't entirely broken for everybody, so it's presumably something about my setup.

ciaobaby

  • Forum addict
  • ****
  • Posts: 2771
  • Karma: +98/-25
  • No quarter asked... No quarter given.
    • View Profile
    • WMTeu
Re: Can't run external program
« Reply #9 on: December 04, 2015, 10:40:52 pm »
This is the "official support channel", what is needed is another Mac user, I'm running 3.3.0 on Linux triggering a python script that logs the time and dates that tasks complete that has no problems.

The script is below if you want to give it a try.

saved as qbt-log.py ( chmod +x to mark it as executable code)
Code: [Select]
#!/usr/bin/python
import sys
import time
# change the path to suit your user name
logfile = open("/home/chris/qbt-completed","a")
logfile.write(str("\n"))
logfile.write(time.strftime("%a")+"\t")
logfile.write(time.strftime("%d")+"/")
logfile.write(time.strftime("%b")+"/")
logfile.write(time.strftime("%Y")+"\t")
logfile.write(time.strftime("%H")+":")
logfile.write(time.strftime("%M")+"\t")
# write CL arguments to file
if (sys.argv[1]):
  logfile.write(str(sys.argv[1]))
else:
  logfile.write(str(sys.argv[2]))

logfile.close()

and the command line is:
Code: [Select]
/home/scripts/qbt-log.py "%F"  "%D/"

Change the paths to suit your system,  I have all my utility scripts in /home/scripts/ so some can run without me logged in.

Smarter than the av-er-age bear, Boo Boo.

http://qbforums.shiki.hu/index.php/topic,3084.0.html

aaronsher

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Can't run external program
« Reply #10 on: December 04, 2015, 11:06:19 pm »
Thanks - I don't think it's going to make a difference, since I'm 99% certain that it's not even reading the command line I enter, but I've gone ahead and set it up to call your script (with appropriate path changes) anyway. I've verified that I can call the script manually. Unfortunately, I'm having a separate problem at the moment (https://qbforums.shiki.hu/index.php/topic,4008.0.html) that's going to prevent me from testing this until it's resolved.

aaronsher

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Can't run external program
« Reply #11 on: December 19, 2015, 12:52:17 am »
I've had endless problems with qbittorrent being unstable, but it does in fact appear to be calling the Python script. It's not obvious why this would be different than the ten different shell scripts I've tried, but it is.