Automation via Transmission failing

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Automation via Transmission failing

Post by mikejandreau »

I ran through the process of installing the CLI and downloading the transmission-postprocess.sh file

I modified it to output to my directory on my external drive where my media lives. However, it doesn't run when the torrent finishes.

If I try to run it manually, I get this error:

Code: Select all

Locking /Users/Alfred/.filebot/logs/amc.log
Run script [fn:amc] at [Fri Jun 09 07:50:06 EDT 2017]
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = y
Parameter: excludeList = .excludes
Parameter: ut_dir = /
Parameter: ut_kind = multi
Parameter: ut_title = 
Parameter: ut_label = N/A
Bad ut_dir value: /
Illegal usage: output folder must exist and must be a directory: /Volumes/Mega\ Storage/Video
Failure (°_°)
Not sure what to do to make it work. Can someone help?
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Re: Automation via Transmission failing

Post by mikejandreau »

I read in the troubleshooting that I can't run it manually since it needs data from Transmission. Makes sense.

But it's not running at all when a torrent finishes. Or if it is, there's an error and I don't see any errors.

The torrent finishes, then nothing happens at all.
User avatar
rednoah
The Source
Posts: 22984
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automation via Transmission failing

Post by rednoah »

1.
Please run filebot -script fn:sysinfo and post the output.


2.
This is the folder you're trying to process, literally:

Code: Select all

/Volumes/Mega\ Storage/Video
:idea: Do you really have a folder with a backslash in the name?

Please read up on how to use the command-line:
viewtopic.php?f=4&t=1899
:idea: Please read the FAQ and How to Request Help.
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Re: Automation via Transmission failing

Post by mikejandreau »

Code: Select all

FileBot 4.7.9 (r4984)
JNA Native: 5.1.0
MediaInfo: 0.7.93
7-Zip-JBinding: 9.20
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2017-05-15 (r500)
Groovy: 2.4.10
JRE: Java(TM) SE Runtime Environment 1.8.0_131
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 12 Core / 7 GB Max Memory / 26 MB Used Memory
OS: Mac OS X (x86_64)
Package: APP
uname: Darwin Pennyworth.home 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64
Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 22984
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automation via Transmission failing

Post by rednoah »

This is a very simple beginner mistake and has nothing to do with FileBot specifically. For the sake of education, please try to figure it out yourself first. ;)

:arrow: This is all you need to know: Cmdline and Argument Passing
:idea: Please read the FAQ and How to Request Help.
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Re: Automation via Transmission failing

Post by mikejandreau »

I think I've got it.

I changed to:

Code: Select all

#!/bin/sh -xu

# Input Parameters
ARG_PATH="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
ARG_NAME="$TR_TORRENT_NAME"
ARG_LABEL="N/A"

# Configuration
CONFIG_OUTPUT=""/Volumes/Mega\/ Storage/Video/""

/usr/local/bin/filebot -script fn:amc --output "$CONFIG_OUTPUT" --action duplicate --conflict skip -non-strict --log-file amc.log --def unsorted=y music=y artwork=y excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL"
It doesn't throw any errors when running manually, now. So I'm downloading a torrent to see what happens when it's done downloading.
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Re: Automation via Transmission failing

Post by mikejandreau »

Nope, nothing happened when the torrent finished.

How can I access the log to see if it failed somewhere in the process?
User avatar
rednoah
The Source
Posts: 22984
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automation via Transmission failing

Post by rednoah »

Alright, after reading up how Cmdline and Argument Passing works, I will now ask your expertise.

Please explain (in as much detail as possible) how the shell interprets this line:

Code: Select all

""/Volumes/Mega\/ Storage/Video/""
:idea: Please read the FAQ and How to Request Help.
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Re: Automation via Transmission failing

Post by mikejandreau »

My fault, I copied the wrong thing.

My script is actually:

Code: Select all

#!/bin/sh -xu

# Input Parameters
ARG_PATH="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
ARG_NAME="$TR_TORRENT_NAME"
ARG_LABEL="N/A"

# Configuration
CONFIG_OUTPUT=""/Volumes/Mega\ Storage/Video/""

/usr/local/bin/filebot -script fn:amc --output "$CONFIG_OUTPUT" --action duplicate --conflict skip -non-strict --log-file amc.log --def unsorted=y music=y artwork=y excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL"
Which I believe should be the right syntax for where my Plex files live. But still, nothing happened when the torrent completed.
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Re: Automation via Transmission failing

Post by mikejandreau »

I must have not saved the .sh file properly. I just tested it again and it worked perfectly. Hooray!

Last question (and feel free to point me to a doc on this; I couldn't find one), how can I delete the original file once the script makes its copy and renames it properly?
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Re: Automation via Transmission failing

Post by mikejandreau »

I think I found it.

Trying

Code: Select all

clean=y
in my script now.
User avatar
rednoah
The Source
Posts: 22984
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automation via Transmission failing

Post by rednoah »

1.
Please explain (in as much detail as possible) how the shell interprets this line:

Code: Select all

""/Volumes/Mega\ Storage/Video/""

2.
Please read Shell Script Debugging for Beginners to answer some of your previous questions.


:idea: As a general rule, I will not give you code you don't understand, so you will need to figure this out yourself, and learn as you go along.
:idea: Please read the FAQ and How to Request Help.
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Re: Automation via Transmission failing

Post by mikejandreau »

I'm not sure how it's interpreted. I tried a number of things until I got it to work.

Then, for whatever reason, it stopped working. I don't know what I changed to make it stop working, but I can't get it working again.

I'll go back to the UI and do this the old fashioned way. I can't get the script to work again after trying to change it to delete my original un-renamed file.

Thanks anyhow.
User avatar
rednoah
The Source
Posts: 22984
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automation via Transmission failing

Post by rednoah »

The command-line tools are for advanced users with basic command-line skills. It's not for everyone.

The GUI works perfectly fine for most people and you can even automate things a little bit with Presets.
:idea: Please read the FAQ and How to Request Help.
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Re: Automation via Transmission failing

Post by mikejandreau »

I'll check out the presets and muck with the automation some more.

I did get the automation to work on my Desktop with some files, so I think it's just my output path.

One question for clarification; the script should only run against a torrent file once, right? I think I'm confusing myself because I'm downloading the same torrent multiple times to test if it's working, and I think maybe there's something in place that's telling it to only run a single time per .torrent, does that sound logical?

Right now (when outputting to my desktop), it works fine for a brand new torrent. But if I re-download something I already downloaded, the script doesn't run. (Presumably because something in the log says it already ran?)
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

Re: Automation via Transmission failing

Post by mikejandreau »

I am now successful at getting it to run reliably, just had to get the right output path.

Now I just need to set myself a weekly reminder to go clean out the completed torrents directory (since clean=y will only delete empty directories and a bunch of essentially junk gets left behind once the original renamed file is moved).

Thanks for your help! (and for Filebot, in general!)
User avatar
rednoah
The Source
Posts: 22984
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automation via Transmission failing

Post by rednoah »

mikejandreau wrote: 09 Jun 2017, 17:09 I'm downloading the same torrent multiple times to test if it's working
This is not smart. You're wasting your time. You'll never ever get anywhere like this. You do know that you can just run commands in CMD, right? Instead of wasting time doing things the stupid way, you could have just spent a few hours systematically learning how to use the command-line, then just get the job done in half an hour.


Before you can run the script from Transmission, you need to be able to run it yourself. Otherwise you'll be doing things the VERY HARD way and that never ends well. Using the command-line is easy. But if you work with your eyes closed and hands tied behind your back then it might feel a bit more difficult than it actually is.


Did you read the manual at all? Which part exactly is not clear?
rednoah wrote:Troubleshooting
If something is not working, first read the Notes above, then just run the command manually in a new console window and see what happens. You CANNOT run the command without replacing the VARIABLES. The variables have to be replaced with actual values first. You can find the actual cmdline call in the µTorrents Logger tab so you can just copy it from there. You may need to enable the Logger tab first (just right-click one of the other tabs like Info).

*** If you need help start a new thread and always include cmdline output! ***

It's always helpful to check the exact command utorrent ends up executing in the Logger tab. It'll look something like this:

Code: Select all

[2013-03-05 20:44:24]  Executing: filebot -script fn:amc --output "D:/Organized Media" --log-file amc.log --action duplicate --conflict override -non-strict --def "ut_dir=D:\Media\Avatar" "ut_file=" "ut_kind=multi" "ut_title=Avatar" "ut_label=" "ut_state=5"

Open CMD. Run the command. Modify. Run. Modify. Run. Repeat until it works the way you want.
:idea: Please read the FAQ and How to Request Help.
Post Reply