Understanding issues (CLI, rutorrent, output format)

Support for Ubuntu and other Desktop Linux distributions
Post Reply
gormson
Posts: 7
Joined: 08 May 2015, 15:51

Understanding issues (CLI, rutorrent, output format)

Post by gormson »

Hello,

First of all thanks for this awesome program and sorry in advance for my English (I'm French :mrgreen: )

For you to understand, i'm trying to implement Filebot on my server and use it to automatically rename the downloaded medias.
I think that I spend approx 10h looking at the forum (and other in French) trying to understand how this tool is working and now I'm at a point that I do not understand.

Behaviour with non media file

i tried to understand and find the information but I failed.
I will use filebot together with rutorrent so that once the download is completed, Filebot is launched and process the file
What happens if the completed download is not a media but a commun file like a pdf, an ISO or a video like a TV show that is not supported?
Do i have to put in one folder all the files that will be surely renamed and in another folder all the file that I know would failed the renaming ?

This point is very unclear for me.

Arguments not understood

The script that will be launched is the following (found it in a tutorial, I'm not the creator):

Code: Select all

#!/bin/bash
TORRENT_PATH=$1
TORRENT_NAME=$2
TORRENT_LABEL=$3

sh /home/<username>/.filebot/filebot.sh --lang fr -script fn:amc --output "/home/<username>/Media" --log-file "/home/<username>/.session/amc.log" --action symlink --conflict override -non-strict --def music=y artwork=y "ut_dir=$TORRENT_PATH" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL" &
and in this expression I don't understand the purpose of the last arguments.

Code: Select all

"ut_dir=$TORRENT_PATH" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL" &
Changing the Format in the above script

What I understood is that the above script is not naming or acting the way i want, so, even if this is not the rule of the forum, can someone confirm me that for having the following structure...

Code: Select all

/home/<username>/Media
....|----Films
...........|----Movie 1 (Year)
...........|----Movie 2 (Year)
...........|----etc..
....|----TVShow
...........|----TVShow1 - S01E04
...........|----TVShow2 - S10E02
...........|----etc..
...I need to use the following expression??

Code: Select all

sh /home/<username>/.filebot/filebot.sh --lang fr -script fn:amc 
--output "/home/<username>/Media" 
--log-file "/home/<username>/.session/amc.log" 
--action symlink --conflict override -non-strict 
--def "seriesFormat={output}/Series/{n} - {s00e00}" "movieFormat={output}/Films/{n} ({y})" 
"ut_dir=$TORRENT_PATH" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL" &
Especially for these arguments :

Code: Select all

def "seriesFormat={output}/Series/{n} - {s00e00}" "movieFormat={output}/Films/{n} ({y})" 
"ut_dir=$TORRENT_PATH" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL" &
Thanks a lot beforehand for any help you can provide to me.
User avatar
rednoah
The Source
Posts: 23101
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Understanding issues (CLI, rutorrent, output format)

Post by rednoah »

Behaviour with non media file

As a rule FileBot will ignore files it doesn't know what to do with (that's for simple filebot calls).

If you're using the amc script it gets more complicated and there's special cases. But in this case you're supposed to use --action copy (or equivalent) and occasionally check logs anyway. You'll see what happens if you have it running for a while.

Arguments not understood

The amc script has it's own set of options. These options in particular pass along various bits of information required for processing.

e.g. Which files to process? ut_dir ...

Now that information naturally has to be passed along by whatever calls that script.

Changing the Format in the above script

You can confirm it yourself by just running the script and see what happens. It should or less give you the structure you want. If you don't like it pass along your own formats and see what happens then.


EDIT:

In short, I don't see any particular problem or question here. Just set it up with --action test and look through the logs once in a while. Then you'll see exactly what's happening.
:idea: Please read the FAQ and How to Request Help.
gormson
Posts: 7
Joined: 08 May 2015, 15:51

Re: Understanding issues (CLI, rutorrent, output format)

Post by gormson »

Hello again.

Thanks for the reply. Indeed there is no explicit problem but even spending hours exploring the forum, I did not find clear answers to my questions.
Filebot is not setup yet on my server and before starting something I always try to understand the behavior.
Apprehending this program is quite difficult considering the tremendous amount of functionality it propose.

Behaviour with non media file

I saw that their was a parameter --filter, is this parameter limited to episode numbers only? or can it exclude also some files based on extension?

Additional Question : Filebot can create symlink during the process, can it create symlink to unprocessed files to a different folder than the processed one also ?

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

Re: Understanding issues (CLI, rutorrent, output format)

Post by rednoah »

--filter is used to nudge auto-detection in the right direction.

If you want to ignore files you will need to use the --def ignore option. See docs.

If unsorted is enabled then all input files that are not otherwise processed are processed using your --action and your unsortedFormat. So I guess it will create symlinks for non-media files as well.
:idea: Please read the FAQ and How to Request Help.
gormson
Posts: 7
Joined: 08 May 2015, 15:51

Re: Understanding issues (CLI, rutorrent, output format)

Post by gormson »

Hello,

Thanks again for taking time to answer me.

So i explored the ignore & unsorted options and tested it with the action test.

However, i've got difficulties with some file numbered in absolute numbering.

Creating only symlink with filebot

I want to implement the script on each torrent completed so today I created a script (torrent-postprocess) with the following code

Code: Select all

#!/bin/bash
TORRENT_PATH=$1
TORRENT_NAME=$2
TORRENT_LABEL=$3

sh /home/user/.filebot/filebot.sh --lang fr -script fn:amc --output "/home/user/Media" --log-file "/home/user/.session/amc.log" --action test  --conflict override -non-strict --def unsorted=y "seriesFormat={output}/Series/{n} - {s00e00}" "movieFormat={output}/Films/{n} ({y})" "ut_dir=$TORRENT_PATH" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL" &
My idea would be to create 2 folders for the torrents :
- Folder ToBeScripted : with all the files to be processed by filebot for renaming
- Forder Other : With all the files that only need to be symlinked or hard linked by file bot

And to summarize :
Torrent finished event.download.finished >> Folder TobeScripted >> amc script and symlink creation
.........................................................>> Folder Other............>> filebot create symlink without renaming

Torrent deleted event.download.erased...>> Filebot fn:cleaner.....>> filebot suppress the symlinks from the erased torrent from both folders.


Do you think the approach is efficient?

I'm trying this way as --def "ignore=testfolder1, testfolder2" seems to "not process at all" the file, am I correct?

Thanks in advance.
gormson
Posts: 7
Joined: 08 May 2015, 15:51

Re: Understanding issues (CLI, rutorrent, output format)

Post by gormson »

I tried to create a symlink with filebot without any renaming with no success.

I tried this

Code: Select all

sh /home/gormson/.filebot/filebot.sh --lang en --output "/home/gormson/testfilbot/renamed" --log-file "/home/gormson/testfilbot/amc.log" --action symlink "ut_dir=/home/gormson/testfilbot/torrentfinis/Batman And Robin 040.cbr" "ut_kind=multi" &
when I launch it, the help page is prompted...

In fact I don't even know is what I try to do is possible. :cry:
User avatar
rednoah
The Source
Posts: 23101
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Understanding issues (CLI, rutorrent, output format)

Post by rednoah »

You're missing a --def before the script options to start the name=value script option sequence.

Code: Select all

--def  "ut_dir=...
:idea: Please read the FAQ and How to Request Help.
gormson
Posts: 7
Joined: 08 May 2015, 15:51

Re: Understanding issues (CLI, rutorrent, output format)

Post by gormson »

I just tried this (I put each parameter on one line to facilitate the reading)

Code: Select all

sh /home/gormson/.filebot/filebot.sh --lang en 
--output "/home/gormson/testfilbot/renamed" 
--log-file "/home/gormson/testfilbot/amc.log" 
--action symlink 
--def "ut_dir=/home/gormson/testfilbot/torrentfinis/Batman And Robin 040.cbr" "ut_kind=multi" &
As previously, only the help is prompted.

Maybe I'm missing something, is there a dedicated script to be specified instead of fn:amc to only create symlink?

Thanks a lot.
User avatar
rednoah
The Source
Posts: 23101
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Understanding issues (CLI, rutorrent, output format)

Post by rednoah »

You're not giving any -command.

Code: Select all

-script path/to/script.groovy          : Run Groovy script
You could easily have figured this out by reading the manual and checking what you did differently => viewtopic.php?f=4&t=215
:idea: Please read the FAQ and How to Request Help.
gormson
Posts: 7
Joined: 08 May 2015, 15:51

Re: Understanding issues (CLI, rutorrent, output format)

Post by gormson »

Ok, I fully and truly understand (and deeply thank you) that you are solicited a lot answering to all the various demand of new users (or complete noob like me).
Believe me when I say that I spend a lot of time reading the page you linked and I did not figure out how to do what I looking for.

My goal is to use filebot to create the symlink on files WITHOUT renaming them in order to run later the clean script on torrent deleted via rutorrent. This is to manage files that would failed the amc script.

So that's why I was trying through the code I pasted above.

So maybe it is impossible but so far it seems, through your answers, that it was possible.

Is there a script to do that? can the files be processed without renaming and then symlinked using existing script?

If not, do you have a doc to guide me through script writing?
User avatar
rednoah
The Source
Posts: 23101
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Understanding issues (CLI, rutorrent, output format)

Post by rednoah »

Well, if all you're trying to do is bypass all the filebot magic just to get symlinks, why don't you just create symlinks? If filebot is not the right tool for the job, use other more suitable tools.

@see http://www.cyberciti.biz/faq/unix-creat ... n-command/

I'm sure you can find lots of bash scripts via Google if it's just simple symlinking files.
:idea: Please read the FAQ and How to Request Help.
gormson
Posts: 7
Joined: 08 May 2015, 15:51

Re: Understanding issues (CLI, rutorrent, output format)

Post by gormson »

Reason is simple, I wanted to use the fn:clean function of filebot on torrent that are erased from rutorrent.

Now I need to script something to find and erase links that are broken. Not impossible but less direct.

And indeed, filebot is a little bit of magic in my seedbox world. :o

Thanks for the time spent on my case. :mrgreen:
Post Reply