[GUIDE] Fully Automated Media Center with qBittorrent

Running FileBot from the console, Groovy scripting, shell scripts, etc
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by rednoah »

1.
Why would you run it as Administrator?

2.
The output indicates that you're not passing in any files. Maybe Z:\Downloads is empty. Maybe Z:\Downloads appears empty to the filebot process due to permissions. If subtitles are downloaded, or if files are ignored, then the log will clearly indicate that.

3.
Do not use filebot.launcher.exe unless you know what you're doing: viewtopic.php?f=3&t=1961
:idea: Please read the FAQ and How to Request Help.
benzoto
Posts: 12
Joined: 04 Oct 2016, 09:50

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by benzoto »

Yeah, it seems the issue with the script was running it as Admin. Now it ran however it is requesting for Opensubtitles Login details - error below

OpenSubtitles: Please enter your login details by calling `filebot -script fn:configure`

Would you be able to help me combine the two scripts? Is this even possible.

Regards,
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by rednoah »

Is this message not clear?

Code: Select all

OpenSubtitles: Please enter your login details by calling `filebot -script fn:configure`

1. Open CMD
2. Run this command and follow the instructions:

Code: Select all

filebot -script fn:configure
You only have to enter you login details once.
:idea: Please read the FAQ and How to Request Help.
benzoto
Posts: 12
Joined: 04 Oct 2016, 09:50

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by benzoto »

It is pretty clear indeed, however if an automation has to be created is there a way to combine the scripts.

I've ran the comment and typed the Login Details and all is OK, subs are downloaded for most of the files. What i'm trying to understand if those two scripts can be combined and how the fn:configure script will look so that it can log me in without ME typing the username and the password but somehow embed those within the script.

If those can't be combined i can create two scripts - first to log me in and second to run through the files, but I'm aiming to fully automated solution :)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by rednoah »

1.
You need to manually call configure once per user. ONCE. Not every single time you call suball. Only ONCE. So unless you're automating the whole filebot install & setup I don't see your problem.

2.
Then you can call suball whenever you want.
:idea: Please read the FAQ and How to Request Help.
benzoto
Posts: 12
Joined: 04 Oct 2016, 09:50

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by benzoto »

Hi, thank you for the reply.

So I assume once would mean once per PC session, in case of a reboot or sort of event this has to happen again, meaning that the automation is failing.

Any suggestions on that?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by rednoah »

benzoto wrote:So I assume once would mean once per PC session, in case of a reboot or sort of event this has to happen again
No, that'd be stupid.
:idea: Please read the FAQ and How to Request Help.
benzoto
Posts: 12
Joined: 04 Oct 2016, 09:50

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by benzoto »

So this would be stupid however is the reality. I've just restarted the PC that i've setup the suball script, i've downloaded new file and once again the script is requesting to run the fn:configure command to login in OpenSubtitles.

This is what i've expected as well so not sure how this sounded strange.

Any advises on that?

Regards,
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by rednoah »

When you enter your login details FileBot will store them in the Windows registry for your current user. So unless you delete registry entries or log in as a different user (or run as different user!) these settings will not (and could not possibly) be affected by a reboot.
:idea: Please read the FAQ and How to Request Help.
benzoto
Posts: 12
Joined: 04 Oct 2016, 09:50

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by benzoto »

Thx a lot rednoah, you really helped me a lot.
Vanarchy
Posts: 15
Joined: 23 May 2017, 12:30

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by Vanarchy »

Hi quick update - I still cant get filebot to autolaunch with Qbitorrent.

Everything is fresh install from two days ago.
(I had that 4k issue and another "file exists already" error which no long are problems now lol)

The filebot program doesnt appear to even visibly launch at completion of torrents. Filebot works fine as standalone doing one movie at a time but is not launching from qbitorrent.

Im guessing it's something easy Im missing. (I used to use filebot all the time for years no problems, it was about 6 months ago it just stopped autolaunching from qbitorrent. I was having all kinds of problems after reinstalling things and tinkering for over a month to get it working again so I decided fresh install for everything).


System:
Filebot from Windows Store
Windows 10 (64) Creators Update = Just fresh installed new OS
Java (64) (latest version as of the other day)
Qbittorent download folder is : H:/downloads



script=

Code: Select all

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

amc.log=

Code: Select all

Illegal Argument: java.nio.file.NoSuchFileException: C:\Program Files (x86)\Google\Chrome\Application\59.0.3071.115\%f (%f)
Run script [fn:amc] at [Sun Jul 09 12:39:56 PDT 2017]
Parameter: music = y
Parameter: subtitles = en
Parameter: artwork = y
Parameter: excludeList = amc.txt
Argument[0]: File does not exist: %f
Use excludes: H:\amc.txt (5695)
No files selected for processing
Done ヾ(@⌒ー⌒@)ノ
Illegal Argument: java.nio.file.NoSuchFileException: C:\Windows\system32\%f (%f)
Run script [fn:amc] at [Sun Jul 09 17:08:32 CDT 2017]
Parameter: music = y
Parameter: subtitles = en
Parameter: artwork = y
Parameter: excludeList = amc.txt
Argument[0]: File does not exist: %f
Use excludes: H:\amc.txt (5695)
No files selected for processing
Done ヾ(@⌒ー⌒@)ノ


Any insight is appreciated ;)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by rednoah »

I'd recommend using the utorrent-postprocess.pyw script to glue qBT and FileBot together:
viewtopic.php?f=4&t=5157

You'll also want to read the Troubleshooting section of the amc script, because your way of testing if it's working couldn't possibly work. ;)
:idea: Please read the FAQ and How to Request Help.
Vanarchy
Posts: 15
Joined: 23 May 2017, 12:30

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by Vanarchy »

Im not sure how to use python or any of that - it doesnt seem like a normal thing to get involved with. Im just a layperson, dont really know anything about codes.

Shouldnt I just be able to use that script above inside qbitorrent (run external program after torrent completion), that's where I put it but it's not launching after torrent.
I mean this: filebot -script fn:amc --output "H:" --log-file amc.log --action copy --conflict override -non-strict --def music=y subtitles=en artwork=y excludeList=amc.txt "%f"



I figured after reinstalling windows, java, and getting filebot from windows store all would be good. Im not clear on why it wouldnt just launch at the completion of a torrent.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by rednoah »

1.
Yes, but if it doesn't work out of the box, then you will need basic CMD skills to diagnose the problem. Depending on what you're doing, using python to call FileBot will make diagnosing problems much easier, because your customizations (if any) will be in the python script, and not in the qBT command template, making it easier to test from CMD.


2.
One obvious problem is that newer versions of qBT use %VARIABLE names similar to uT. So qBT won't replace %f with the actual file path. Newer versions use %F (case matters) and add additional variables.

I highly recommend following the instructions here which do work with newer versions of qBT out of the box:
viewtopic.php?f=4&t=5157

There is zero coding involved. Just editing a text file. Just like editing the qBT settings text field. Nothing more. ;)
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by rednoah »

Vanarchy wrote:11 Jul 2017, 12:10 "Fetch the utorrent-postprocess.pyw python script and modify it to your needs:"

Ive been all over that page for a half hour and there's no download link for that pyw file. It's unclear how to use this. Copy and paste it to a notepad and rename it to something? If it's an exe I dont see a download link, and dont even know where to put it (i did try searching)
I install python 3.x (it's 32 bit btw) and there is no GUI at all. It's all cmd window stuff.

I went on youtube and couldnt find instruction I need , also used google search which brings up a bunch of Jetbrain stuff.

I think Im going to just try utorrent, this is turning out to be a bit much. It's like going down a long rabbit hole lol
1. Click on utorrent-postprocess.pyw
2. Click Raw to go to the raw text file, right-click, Save as... and save the file somewhere. Alternatively, you can also create a new text file and copy & paste the code.
3. Open the file with a text editor and change X:/Media to your output folder.

(Optional) 4. Start CMD and test your postprocess script without qBT first. You didn't do that last time you set up filebot, so maybe you get lucky again.
:idea: Please read the FAQ and How to Request Help.
Vanarchy
Posts: 15
Joined: 23 May 2017, 12:30

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by Vanarchy »

Hi, I saved the file to my downloads file for convenience. So when I open a CMD window it is H:\downloads>>

Then I opened cmd window and ran a test file but nothing happened.

I typed in: utorrent-postprocess.pyw test.mkv

Apparently there is a LOT to learn just getting this to autorun from qbittorent. In the morning I'll try uTorrent and see if that's easier.
Vanarchy
Posts: 15
Joined: 23 May 2017, 12:30

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by Vanarchy »

Filebot works perfect with uTorrent right out of the box. :-D

(I needed python anyway to run Plexpy, so that works out too).

Thanks for all your help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by rednoah »

The usage is documented with examples at the beginning of the script. The script will expect the correct number of arguments in the correct order.

e.g.

Code: Select all

python "C:\path\to\utorrent-postprocess.pyw" "Movie" "5" "Avatar" "multi" "" "X:\Files\Avatar"
:idea: Please read the FAQ and How to Request Help.
tip2tail
Posts: 2
Joined: 16 Jul 2017, 18:56

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by tip2tail »

Hello all,

First off - what a fantastic tool FileBot is! It has made my life so much easier when it comes to renaming and organising my media.

I use qBittorrent and followed the guide on this forum successfully, however I ran into one slight issue. A quirk on the Windows version of qBittorrent means that it sometimes does not release a handle/file lock on downloaded media. This prevents the AMC script/FileBot from moving the media to it's intended destination.

To circumvent this, I have written a batch file script that will do the following:
  • Terminate the running qBittorrent process
  • Execute the AMC script on the newly downloaded media
  • Restart qBittotrrent
I thought that this may be helpful for anyone else suffering from the same issues. As such I have uploaded it to GitHub and make it freely available.

Hope this is of interest...
https://gist.github.com/tip2tail/4be77c ... 7df2997600

t2t
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with qBittorrent

Post by rednoah »

qBT is not supposed to release files because it's supposed to keep seeding them. All amc script examples use --action duplicate for that reason, so that your torrent client can keep seeding, because leeching without seeding is not cool. ;)
:idea: Please read the FAQ and How to Request Help.
Post Reply