qBitTorrent Doesn't Call FileBot After Completion

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
scottycope
Posts: 7
Joined: 15 Feb 2020, 04:45

qBitTorrent Doesn't Call FileBot After Completion

Post by scottycope »

I'm trying to call Filebot from qBitTorrent after download is completed. However, once the download is compete, FB never seems to be called as there is no entry to the log file. I am using qBT 4.2.1. At the time of download completion, FB is closed, not open and my download path is: C:\Users\Scott\Desktop\test movies\Media

Note that there is no backslash at the end but when I close and reopen the settings window, qBT automatically inserts an ending backslash.

To check that my FB command line call was working, I copied my FB call to my command window. Here it is:

Code: Select all

filebot -script fn:amc "C:/Users/Scott/Desktop/test movies/Media" --output "Y:/" --action test --conflict auto -no-xattr -non-strict --log-file "c:/users/scott/desktop/test movies/amc.log" --def @"c:/users/scott/desktop/test movies/args.txt"
The only difference between the above and the qBT call is here I am using --action test and in qBT, I am using --action move.

My args.txt file is here:

Code: Select all

excludeList=c:/users/scott/desktop/test movies/amc.txt
clean=y
movieFormat=Y:/Shared Movies/{n0 = n.sortName().replaceAll("'", "").charAt(0); n0.isDigit() ? '#' : n0}/{n} ({y})/{n} ({y}){ext=='srt' ? ".eng" : ''}
seriesFormat=Y:/Shared TV Shows/{n0 = n.sortName().replaceAll("'", "").charAt(0); n0.isDigit() ? '#' : n0}/{n}/{episode.special ? 'Specials' : 'Season '+s.pad(2)}/{n} {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t}{ext=='srt' ? ".eng" : ''}
And here is the output of my log file when run from the CL:

Code: Select all

Run script [fn:amc] at [Tue Feb 18 23:30:56 EST 2020]
Parameter: excludeList = c:/users/scott/desktop/test movies/amc.txt
Parameter: clean = y
Parameter: movieFormat = Y:/Shared Movies/{n0 = n.sortName().replaceAll("'", "").charAt(0); n0.isDigit() ? '#' : n0}/{n} ({y})/{n} ({y}){ext=='srt' ? ".eng" : ''}
Parameter: seriesFormat = Y:/Shared TV Shows/{n0 = n.sortName().replaceAll("'", "").charAt(0); n0.isDigit() ? '#' : n0}/{n}/{episode.special ? 'Specials' : 'Season '+s.pad(2)}/{n} {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t}{ext=='srt' ? ".eng" : ''}
Argument[0]: C:\Users\Scott\Desktop\test movies\Media
Use excludes: c:\users\scott\desktop\test movies\amc.txt (11)
Input: C:\Users\Scott\Desktop\test movies\Media\The Notebook (2004) [1080p]\The.Notebook.2004.1080p.BluRay.x264.YIFY.mp4
Group: [Movie:The Notebook (2004)] => [The.Notebook.2004.1080p.BluRay.x264.YIFY.mp4]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [C:\Users\Scott\Desktop\test movies\Media\The Notebook (2004) [1080p]\The.Notebook.2004.1080p.BluRay.x264.YIFY.mp4]
[TEST] from [C:\Users\Scott\Desktop\test movies\Media\The Notebook (2004) [1080p]\The.Notebook.2004.1080p.BluRay.x264.YIFY.mp4] to [Y:\Shared Movies\N\The Notebook (2004)\The Notebook (2004).mp4]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ
The command is successfully processed. Does FB need to be open in order to run? Do I need to invoke FB a different way? Am I missing something else along the way?

I should also add that I did try calling notepad.exe from qBT and that did successfully open.

Any insight you can give is greatly appreciated. Thank you!!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: qBitTorrent Doesn't Call FileBot After Completion

Post by rednoah »

scottycope wrote: 19 Feb 2020, 04:55 Does FB need to be open in order to run?
No. filebot commands run independently of the GUI. The GUI does not need to be open to run filebot commands.
scottycope wrote: 19 Feb 2020, 04:55 Do I need to invoke FB a different way?
Nope, filebot should work, since it works when you call it manually, it should work exactly the same when called by qBT, though the environment might be different.
scottycope wrote: 19 Feb 2020, 04:55 Am I missing something else along the way?
You're missing the console output. Since there's no filebot log, we can assume that filebot is never called. If filebot is never called, then there will be console error output that says why filebot wasn't called.



Step 1:
Confirm that you can run any command like notepad to make sure that works. Check.


Step 2:
Run a command that allows you to see console output so you can see the error message that explains why filebot can't be called.

e.g. this should open a cmd window and /k keep it open and /c run a command:

Code: Select all

cmd /k /c filebot -script fn:sysinfo
:idea: Windows CMD is not my area of expertise. Something like that though. Play with it. Google is your friend. ;)
:idea: Please read the FAQ and How to Request Help.
scottycope
Posts: 7
Joined: 15 Feb 2020, 04:45

Re: qBitTorrent Doesn't Call FileBot After Completion

Post by scottycope »

I got the following line of code working in the CMD window manually:

Code: Select all

cmd /k filebot -script fn:sysinfo
I could not get it to work with both /k and /c but the Google machine made it seem like either one or the other is required. The code runs and when I run that manually, I get the below results:

Code: Select all

FileBot 4.8.5 (r6224)
JNA Native: 5.2.2
MediaInfo: 18.12
7-Zip-JBinding: 9.20
Chromaprint: fpcalc version 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2019-05-15 (r565)
Groovy: 2.5.6
JRE: OpenJDK Runtime Environment 11.0.2
JVM: 64-bit OpenJDK 64-Bit Server VM
CPU/MEM: 4 Core / 1 GB Max Memory / 39 MB Used Memory
OS: Windows 7 (amd64)
Package: MSI
License: FileBot License P9380729 (Valid-Until: 2020-09-22)
Done ?(?????)?

So, just for fun, I put that same code in qBT to call that when a download is complete. When a download completes, I don't see any CMD window pop up. Just to make sure, I had qBT open notepad.exe upon completion and, sure enough, it opened. Am I incorrectly trying to invoke the console output? My guess is yes since it's not opening but I'm not sure where my mistake is. Any ideas? Thanks!
Last edited by scottycope on 19 Feb 2020, 12:59, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: qBitTorrent Doesn't Call FileBot After Completion

Post by rednoah »

No idea. Windows is hard.

You can try a different approach:
viewtopic.php?t=3067

The link above is for Linux, but the concept applies universally:
1. Create new .bat script
2. Have qBT call your .bat script
3. Have your .bat script call notepad to confirm that our .bat script is called
4. Have your .bat script call filebot and redirect standard and error output to a file so you can see the error message: https://ss64.com/nt/syntax-redirection.html
:idea: Please read the FAQ and How to Request Help.
scottycope
Posts: 7
Joined: 15 Feb 2020, 04:45

Re: qBitTorrent Doesn't Call FileBot After Completion

Post by scottycope »

Welp, after several hours of trying to get qBT to call a simple .bat file that opens notepad, either I am not skilled enough to do that or qBT doesn't allow it. My guess is the former. I tried several iterations, formats, etc. and none would work. I did see that some versions of qBT would not allow .bat files to be called. I believe I am on the latest version (4.2.1) so odds are that I am doing something wrong.

Anyway, this is all just so I can say that, as a last resort, I reverted back to just trying qBT to run my initial command line script above and it works.

I am not sure what happened yesterday that seemed to break the process but, for now, at least, things seem good.

rednoah, I greatly appreciate your help and insight. I am kind of bummed I couldn't get the .bat / debug piece of your suggestion working but I am also glad that things are functioning now. so, thank you again, very much. Your help and lightning fast responses are greatly appreciated. Thank you!!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: qBitTorrent Doesn't Call FileBot After Completion

Post by rednoah »

Alright, glad it's working again. No idea why it didn't work there for a while. Probably some issue unrelated to FileBot itself though.
:idea: Please read the FAQ and How to Request Help.
Post Reply