uTorrent to qTorrent Script Help

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

uTorrent to qTorrent Script Help

Post by onyxius »

Hello,
I have been looking through posts and am trying to see if there is a conversion list of ut commands if you will from uTorrent to qTorrent.

This is what is working in uTorrent
filebot -script fn:amc --output "My address to plex" --action move --conflict skip -non-strict --log-file amc.log --def unsorted=y music=y artwork=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" --def subtitles=en --def plex=my plex info

However when qBittorrent finishes, I get this:

Code: Select all

Finished without processing any files
Failure (°_°)
Run script [fn:amc] at [Thu Dec 05 08:59:08 CST 2019]
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = y
Parameter: ut_label = %L
Parameter: ut_state = %S
Parameter: ut_title = %N
Parameter: ut_kind = %K
Parameter: ut_file = %F
Parameter: ut_dir = %D
Parameter: subtitles = en
Parameter: plex = *****
Bad ut_label value: %L
Bad ut_state value: %S
Bad ut_title value: %N
Bad ut_kind value: %K
Bad ut_file value: %F
Bad ut_dir value: %D
Illegal usage: no input
Failure (°_°)
Thank You
User avatar
rednoah
The Source
Posts: 19159
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: uTorrent to qTorrent Script Help

Post by rednoah »

You will find setup instructions for qBT linked in the amc script manual.
:idea: Please read the FAQ and How to Request Help.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: uTorrent to qTorrent Script Help

Post by onyxius »

:/ so I have to use python setup now instead of what i was using with uTorrent following these instructions?

viewtopic.php?f=4&t=5157
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: uTorrent to qTorrent Script Help

Post by onyxius »

Ok, so do i leave the command like this or do I remove the single quotes from the right side or left side if i want to use them? I see a couple of the right side does not have single quotes and i'm not very familiar with python.

Code: Select all

command = [
	'filebot', '-script', 'fn:amc',
	'--output', output,
	'--action', 'duplicate',
	'--conflict', 'skip',
	'-non-strict',
	'--log-file', output + '/amc.log',
	'--def',
		'unsorted=y',
		'music=y',
		'artwork=y',
		'movieFormat='  + movieFormat,
		'seriesFormat=' + seriesFormat,
		'animeFormat='  + animeFormat,
		'musicFormat='  + musicFormat,
		'ut_label=' + label,
		'ut_state=' + state,
		'ut_title=' + title,
		'ut_kind='  + kind,
		'ut_file='  + file,
		'ut_dir='   + directory,
		'subtitles=en',
		'plex='     + myhost:token
]
What i'm trying to use:

Code: Select all

--action duplicate --conflict skip -non-strict --log-file amc.log --def unsorted=y music=y artwork=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" --def subtitles=en --def plex
So where do i enter in the plex information like host and token? I'm guessing it would be added under 'ut_dir=' as shown above?
Last edited by onyxius on 05 Dec 2019, 18:03, edited 2 times in total.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: uTorrent to qTorrent Script Help

Post by onyxius »

So i tested out the above in cmd and get the following:

SyntaxError: invalid syntax

and its pointing to 'plex=' + myhost:token

So what is the correct syntax to have this info update plex with the new file? Its got an ^ at one of the . in the ip address, so lets say 10.0.1.100:token Its got an error at the 10.0. <-- this period.

I tried single quote like above 'ip:token' and it ran but no AMC.log file created and it didnt actually run from the looks of it.

I also tried 'plex=myhost:token'
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: uTorrent to qTorrent Script Help

Post by onyxius »

So i made it closer

Code: Select all

Run script [fn:amc] at [Thu Dec 05 11:59:15 CST 2019]
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = y
Parameter: movieFormat = {plex}
Parameter: seriesFormat = {plex}
Parameter: animeFormat = {plex}
Parameter: musicFormat = {plex}
Parameter: ut_label = %L
Parameter: ut_state = 
Parameter: ut_title = %N
Parameter: ut_kind = multi
Parameter: ut_file = 
Parameter: ut_dir = %F
Parameter: subtitles = en
Parameter: plex = *****
Bad ut_label value: %L
Bad ut_title value: %N
Bad ut_dir value: %F
Illegal usage: output folder must exist and must be a directory: C:\ipaddress\Plex
Failure (°_°)
So i'm assuming i cant use UNC paths \\server ip address\folder name?

Edit: oops its python, gotta have a \ for every \ being used. So it needed to be \\\\ip address\foldername.


So this is now my output

Code: Select all

Run script [fn:amc] at [Thu Dec 05 12:05:18 CST 2019]
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = y
Parameter: movieFormat = {plex}
Parameter: seriesFormat = {plex}
Parameter: animeFormat = {plex}
Parameter: musicFormat = {plex}
Parameter: ut_label = %L
Parameter: ut_state = 
Parameter: ut_title = %N
Parameter: ut_kind = multi
Parameter: ut_file = 
Parameter: ut_dir = %F
Parameter: subtitles = en
Parameter: plex = *****
Bad ut_label value: %L
Bad ut_title value: %N
Bad ut_dir value: %F
Illegal usage: no input
Failure (°_°)
This is what i ran in cmd for testing:
python "C:\qtorrent-postprocess.pyw" "%L" "" "%N" "multi" "" "%F"
User avatar
rednoah
The Source
Posts: 19159
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: uTorrent to qTorrent Script Help

Post by rednoah »

You don't have to use the Python script. qBT variable values matter. Doesn't matter if you pass those to the python that then passes them to filebot, or if you pass them to filebot directly.

e.g. qBT variables and corresponding amc script parameters:

Code: Select all

--def "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L"
:idea: %variables are replaced by qBT, and the resulting command is then executed by qBT.
:idea: Please read the FAQ and How to Request Help.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: uTorrent to qTorrent Script Help

Post by onyxius »

Thanks rednoah,
Now that i have been playing around with this i like the clean look but i'm still in the same place as before with the Bad ut_ returns i'm getting.
User avatar
rednoah
The Source
Posts: 19159
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: uTorrent to qTorrent Script Help

Post by rednoah »

This means that %variables haven't been replaced with real values:

Code: Select all

Bad ut_label value: %L
Bad ut_title value: %N
Bad ut_dir value: %F
:idea: If you get this in CMD, because you literally do %L / %N / %F on the command-line, that's a user error. Read the amc script Troubleshooting section for details.

:idea: If qBT doesn't replace the variables. Then it's a qBT problem. Maybe you're using a super new version, or a super old version. No idea. You qBT should have documentation regarding post-processing variables.
:idea: Please read the FAQ and How to Request Help.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: uTorrent to qTorrent Script Help

Post by onyxius »

Thank you, that makes more sense on why i'm getting it and yea i'm using 3.2.3 for qBT.

So my initial script should have worked as well because those 3 "label, title and dir" are still returning bad. Odd, i would think that it would work the same as uTorrent and pass that information.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: uTorrent to qTorrent Script Help

Post by onyxius »

Has anyone else had this issue with qBT and resolved it?

This is what qBT is set to run:

Code: Select all

"C:\Program Files (x86)\Python38-32\pythonw.exe" "C:\qtorret-postprocess.pyw" "%L" "" "%N" "multi" "" "%F"
This is my script right now:

Code: Select all

# Run Program uTorrent: 
# "C:\qtorrent-postprocess.pyw" "%L" "%S" "%N" "%K" "%F" "%D"
#
# Run Program qTorrent:
# "C:\qtorrent-postprocess.pyw" "%L" "" "%N" "multi" "" "%F"
#
# Test with Console:
# python "C:\qtorrent-postprocess.pyw" "Movie" "5" "Avatar" "multi" "" "X:\Files\Avatar"


import sys
import subprocess


# configuration
output = '\\\\hostipaddress\Plex'


# custom formats (use / instead of \ as directory separator)
movieFormat  = '''{plex}'''
seriesFormat = '''{plex}'''
animeFormat  = '''{plex}'''
musicFormat  = '''{plex}'''


# required args
label, state, title, kind, file, directory = sys.argv[1:7]


command = [
	'filebot', '-script', 'fn:amc',
	'--output', output,
	'--action', 'duplicate',
	'--conflict', 'skip',
	'-non-strict',
	'--log-file', '/amc.log',
	'--def',
		'unsorted=y',
		'music=y',
		'artwork=y',
		'movieFormat='  + movieFormat,
		'seriesFormat=' + seriesFormat,
		'animeFormat='  + animeFormat,
		'musicFormat='  + musicFormat,
		'ut_label=' + label,
		'ut_state=' + state,
		'ut_title=' + title,
		'ut_kind='  + kind,
		'ut_file='  + file,
		'ut_dir='   + directory,
		'subtitles=en',
		'plex=IPAddress:token'
]


# execute command only for certain conditions (disabled by default)
'''
if state not in ['5', '11']:
	print('Illegal state: %s' % state)
	sys.exit(0)
'''


# execute command (and hide cmd window)
subprocess.run(command, creationflags=0x08000000)

This is my output:

Code: Select all

Run script [fn:amc] at [Thu Dec 05 12:05:18 CST 2019]
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = y
Parameter: movieFormat = {plex}
Parameter: seriesFormat = {plex}
Parameter: animeFormat = {plex}
Parameter: musicFormat = {plex}
Parameter: ut_label = %L
Parameter: ut_state = 
Parameter: ut_title = %N
Parameter: ut_kind = multi
Parameter: ut_file = 
Parameter: ut_dir = %F
Parameter: subtitles = en
Parameter: plex = *****
Bad ut_label value: %L
Bad ut_title value: %N
Bad ut_dir value: %F
Illegal usage: no input
Failure (°_°)
User avatar
rednoah
The Source
Posts: 19159
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: uTorrent to qTorrent Script Help

Post by rednoah »

Please take a screenshot of qBT that shows things being set up correctly. That page will usually also show available %variable names.
:idea: Please read the FAQ and How to Request Help.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: uTorrent to qTorrent Script Help

Post by onyxius »

Here is my settings for running the external program.
Can we not link imgur images here? What do you guys normally use?

Image

This is the link i'm trying to use https://imgur.com/a/ZuLJMRC
User avatar
rednoah
The Source
Posts: 19159
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: uTorrent to qTorrent Script Help

Post by rednoah »

Have you tried %f and %n yet? Your version of qBT says that those are the supported variables.
:idea: Please read the FAQ and How to Request Help.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: uTorrent to qTorrent Script Help

Post by onyxius »

I guess i'm kind of confused, I thought you have to use the label, state, title, kind, file and directory.

So instead of:

Code: Select all

"C:/Program Files (x86)/Python38-32/pythonw.exe" "C:/qtorret-postprocess.pyw" "%L" "" "%N" "multi" "" "%F"
I should use:

Code: Select all

"C:/Program Files (x86)/Python38-32/pythonw.exe" "C:/qtorret-postprocess.pyw" "" "" "%N" "multi" "" "%F"
User avatar
rednoah
The Source
Posts: 19159
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: uTorrent to qTorrent Script Help

Post by rednoah »

1.
Nope. Everything is optional. At least one input folder would be good though, otherwise there's nothing to process.


2.
Your qBT says %f and %n so do %f and %n and not %F and not %N. Evidently, variables are case-sensitive.


3.
What version of qBT are you using? Are you sure it's the very latest one? Evidently, some versions use lower-case variables, while others use upper-case variables...
Image
:idea: Please read the FAQ and How to Request Help.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: uTorrent to qTorrent Script Help

Post by onyxius »

Ahh ok now that makes even more sense that its a version issue. Unfortunately I cannot upgrade my version from 3.2.3 at this time, so i'll have to just use uTorrent again instead. Thank you rednoah for all the help and explanation, I greatly appreciate it.
User avatar
rednoah
The Source
Posts: 19159
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: uTorrent to qTorrent Script Help

Post by rednoah »

onyxius wrote: 06 Dec 2019, 18:14 Ahh ok now that makes even more sense that its a version issue. Unfortunately I cannot upgrade my version from 3.2.3 at this time, so i'll have to just use uTorrent again instead.
This is what we learnt from all of the above? :?

:arrow: qBT 3 only gives us %f and %n to work with. That's what we learned.

qBT 4:

Code: Select all

--def "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L"
qBT 3:

Code: Select all

--def "ut_dir=%f" "ut_kind=multi" "ut_title=%n"
Done.
:idea: Please read the FAQ and How to Request Help.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: uTorrent to qTorrent Script Help

Post by onyxius »

Well I didn't know the limitations of this version were so extensive vs the newer like the screenshot you posted has more Supported parameters, i thought mine listed 2 as an example. All in all my original copy and paste from uTorrent to qTorrent would have worked if i was on a newer version. I did learn about the python file which i like as it is a lot cleaner looking.
Post Reply