Q&A for n00bs

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
simmz
Posts: 3
Joined: 07 Apr 2017, 01:19

Process without --db ??

Post by simmz » 07 Apr 2017, 17:33

Is it possible to process files without the use of a database?

All I'm trying to do is organize a flat folder into sub-directories: e.g.

$:~/Movies> tree
.
├── Video - 01.mp4
├── Video - 02.mp4
├── Video - 03.mp4
├── Video - 04.mp4
└── Video - 05.mp4

Would be processed and become:

$:/mnt/data/test> tree
├── 480x270
│ └── Video - 03.mp4
├── 640x360
│ └── Video - 04.mp4
└── 960x540
├── Video - 01.mp4
├── Video - 02.mp4
└── Video - 05.mp4

I can accomplish this with:
$:~/filebot.sh -script fn:amc ./ --output "/mnt/data/sorted" --action copy --conflict auto --def "movieFormat={resolution}/{fn}"

but it pointlessly tried to identify/match the files.

I also tried:
filebot.sh -rename . --db xattr --action copy --format {resolution}/{fn}

which returns:
Rename files using [Extended Attributes]
Failed to identify or process any files
Failure (°_°)

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

Re: Q&A for n00bs

Post by rednoah » 07 Apr 2017, 18:47

-non-strict allows you to process files that are not xattr tagged:

Code: Select all

filebot -rename *.mp4 --action duplicate --db xattr -non-strict --format {resolution}/{fn}
@see viewtopic.php?f=4&t=4788
:idea: Please read the FAQ and How to Request Help.

simmz
Posts: 3
Joined: 07 Apr 2017, 01:19

Re: Q&A for n00bs

Post by simmz » 07 Apr 2017, 20:02

Really!?!?! that's all I was missing. I thought -non-strict was just for oddly named files.
Learn something new everyday. Your next beer is on me via paypal.

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

Re: Q&A for n00bs

Post by rednoah » 07 Apr 2017, 20:07

-non-strict has different meanings in different contexts. If you're using --db xattr with -non-strict then -non-strict refers to not strictly processing only xattr tagged files.
:idea: Please read the FAQ and How to Request Help.

simmz
Posts: 3
Joined: 07 Apr 2017, 01:19

Re: Q&A for n00bs

Post by simmz » 07 Apr 2017, 20:17

Makes sense. Thanks for your help. I spent the better part of the day trying to make that little one-liner work.

kindofblue91
Posts: 3
Joined: 13 Apr 2017, 15:38

Re: Q&A for n00bs

Post by kindofblue91 » 13 Apr 2017, 15:45

I apologize in advance if this is an easy fix!

So pretty frequently I'm getting a "file is being used" error when uTorrent runs my post-download amc script. To remedy this for now, I've created a scheduled task to run my sort command, to scoop up any files that the post-download script couldn't immediately grab.

My issue is that even if the rename/file transfer errors out with "file is being used", the filename is being written to the exclude list.

So the question is, am I able to setup the script so if Filebot errors out on a file, that file is NOT added to the exclude list?

If that is not possible, is it possible to run the uTorrent post-download script WITHOUT --def excludeList? The scheduled task would still have --def excludeList. Haven't removed that line because of your indication that frequent repeats would constitute a ban from the script.

Thanks so much!

If it helps any, here are my 2 scripts:

uTorrent post-download

Code: Select all

filebot -script fn:amc --output "D:\Plex" --action move --conflict skip -non-strict --log-file amc.log --def "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" excludeList=amc.txt movieFormat="D:/Plex/Movies/{fn}" seriesFormat="D:/Plex/TV/{fn}"
Scheduled task

Code: Select all

filebot -script fn:amc --output "D:\Plex" --action move --conflict skip -non-strict "C:\Users\username\Downloads" --log-file amc.log --def excludeList=amc.txt movieFormat="D:/Plex/Movies/{fn}" seriesFormat="D:/Plex/TV/{fn}"

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

Re: Q&A for n00bs

Post by rednoah » 13 Apr 2017, 16:46

1.
You can't use --action move on files that are being seeded. My recommendation is to use --action duplicate and to make sure that input/output folder are on the same drive (i.e. your Downloads and Plex folder should be on Drive D:) so that it can create hardlinks instead of having to physically copy the data from one drive to another.

You want to seed files and you want to create an additional file entry (i.e. hardlink) in your Plex folder. That is not a problem. You can have the same file twice (or many times) without using any extra disk space.

@see https://en.wikipedia.org/wiki/Hard_link#Example


2.
If you're using {fn} as format, then I see no reason to use FileBot or the amc script at all actually. There's simpler tools for just moving files into folders. You're using a space ship when you should be using a tractor. :lol:

:idea: If you use Plex on your Plex folder, Plex will definitely not be happy with a flat folder of completely and utterly unorganized files. :lol:

:?: Are you sure you know what {fn} means?
:idea: Please read the FAQ and How to Request Help.

kindofblue91
Posts: 3
Joined: 13 Apr 2017, 15:38

Re: Q&A for n00bs

Post by kindofblue91 » 13 Apr 2017, 16:56

Thanks for the reply!

I'm using Filebot because I couldn't find a tool to accurately sort Movies/TV Shows on Windows. On Mac, I had a Folder Action set up that performed this nicely (with few errors, it searched the filename for S**E**)
:idea: If you use Plex on your Plex folder, Plex will definitely not be happy with a flat folder of completely and utterly unorganized files. :lol:
Plex doesn't seem to mind unorganized files just sitting in their TV/Movie folder...at least, as far as I can tell! :lol: I just have 2 Plex libraries, one at D:\Plex\Movies & one at D:\Plex\TV.
:?: Are you sure you know what {fn} means?
Yes, using {fn} because I didn't see a need to rename the files.

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

Re: Q&A for n00bs

Post by rednoah » 13 Apr 2017, 17:04

Plex wrote:It's important that your media files and library folders are named and organized
Plex is very explicit about how files must be organized:
https://support.plex.tv/hc/en-us/catego ... reparation
kindofblue91 wrote:Yes, using {fn} because I didn't see a need to rename the files.
You're either insanely lucky, or you just haven't seen much yet. :lol:
:idea: Please read the FAQ and How to Request Help.

kindofblue91
Posts: 3
Joined: 13 Apr 2017, 15:38

Re: Q&A for n00bs

Post by kindofblue91 » 13 Apr 2017, 17:13

Oh jeez, my TV library would probably give you a hernia, then! My thought process was that once Plex has indexed the library, it wouldn't really care that all episodes aren't grouped in a series-named sub-folder :?

Image

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

Re: Q&A for n00bs

Post by rednoah » 14 Apr 2017, 02:37

Sure, but to correctly index your library, it needs to make sense first. With flat files like this, it might work sometimes, maybe even most of the time, but certainly not all the time. :D
:idea: Please read the FAQ and How to Request Help.

kaziekama
Posts: 1
Joined: 23 Apr 2017, 22:02

syntax error near unexpected token `('

Post by kaziekama » 23 Apr 2017, 22:11

Command:

Code: Select all

filebot -rename *.mkv --output /mydir --format {n}/{episode.special ? "Specials" : "Season "+s.pad(2)}/'{n} - {episode.special ? "S00E"+special.pad(2) : s00e00} - {t}' --db TheTVDB
Error:

Code: Select all

syntax error near unexpected token `('
-script fn:sysinfo

Code: Select all

FileBot 4.7.9 (r4984)
JNA Native: 5.1.0
MediaInfo: 0.7.73
7-Zip-JBinding: 9.20
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2017-04-03 (r494)
Groovy: 2.4.10
JRE: Java(TM) SE Runtime Environment 1.8.0_65
JVM: 32-bit Java HotSpot(TM) Client VM
CPU/MEM: 4 Core / 224 MB Max Memory / 12 MB Used Memory
OS: Linux (arm)
Package: DEB
Data: /---/---/.filebot
uname: Linux ---4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017 armv7l GNU/Linux
I'm pulling my hair out with this. I really could use an extra set of eyes on my script call.

timpan195
Posts: 1
Joined: 02 Aug 2017, 09:02

Re: Q&A for n00bs

Post by timpan195 » 02 Aug 2017, 09:44

I'm having an issue with running this through powershell, it simply picks the first hit on a movie, the same applies for series.
Is there any way for me to either let me pick which movie / series is or at least have it skip those files since it messes up my library.
I have been testing this out using Red Dawn, both the 1984 version and the 2012 version but both gets placed as the 1984 version.
It names and places the files correctly if they have the year in the name i.e. "Red Dawn (2012).mp4".

Code:

Code: Select all

cd "D:\Google Download Stuff\Series\"
get-childItem 'D:\Google Download Stuff\Series\*.mp4' | filebot -non-strict -rename '*' --db TheTVDB --conflict auto --filter "'s' - 'e'" --format 'D:/Google Download Stuff/Media/Series/{plex[1]} ({y})/Season {s}/{plex.name}' --output 'By Series' --mode interactive
cd "D:\Google Download Stuff\Movies\"
<This section>
get-childItem 'D:\Google Download Stuff\Movies\*.mp4'| filebot -non-strict -rename '*' --mode interactive --db TheMovieDB --conflict auto --format 'D:/Google Download Stuff/Media/Movies/{n0 = n.charAt(0); n0.isDigit() ? "0-9" : n0}/{plex[1]}/{plex.name}' --output 'By First Letter'
</This section>
pause
Below example is with "Red Dawn (2012).mp4" renamed to "Red Dawn.mp4"

Code: Select all

D:\Google Download Stuff>PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& 'D:\Google Download Stuff\Scripts\Move.ps1'"

<Ignore this, Series folder is empty>
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <*> at index 0: * (*)
Rename episodes using [TheTVDB]
No media files: [*]
Failure (°_°)
</Ignore this, Series folder is empty>

Rename movies using [TheMovieDB]
Auto-detect movie from context: [D:\Google Download Stuff\Movies\Red Dawn.mp4]
[MOVE] from [D:\Google Download Stuff\Movies\Red Dawn.mp4] to [D:\Google Download Stuff\Media\Movies\R\Red Dawn (1984)\R
ed Dawn (1984).mp4]
Processed 1 files
Press Enter to continue...:
Image

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

Re: Q&A for n00bs

Post by rednoah » 02 Aug 2017, 10:15

If you're processing badly named files, make sure to try things with --action test first. Here's how I'd deal with this particular file.

Command:

Code: Select all

filebot -rename --db TheMovieDB *.mp4 --filter "y > 2000"
Output:

Code: Select all

Rename movies using [TheMovieDB]
Auto-detect movie from context: [Red Dawn.mp4]
Apply filter [y > 2000] on [12] items
Include [Red Dawn (2012)]
Include [Red Dawn (2011)]
Include [Red (2008)]
Include [Red (2002)]
Include [RED (2010)]
Include [Rockin' at the Red Dog: The Dawn of Psychedelic Rock (2005)]
Include [Assembly (2007)]
[MOVE] from [Red Dawn.mp4] to [Red Dawn (2012).mp4]
Processed 1 files
:idea: Please read the FAQ and How to Request Help.

kyoobix
Posts: 1
Joined: 09 Aug 2017, 12:40

Re: Q&A for n00bs

Post by kyoobix » 09 Aug 2017, 13:44

Hello Forum,

Since I'm new here, I think the n00b section might be the right place for my question.




No matter what I try, I cannot get deluge to run any scripts. I have created a bat file and placed in my documents folder. When executede manually everything works without any problems. But how do i get Deluge to execute my script or my bat-file?

I have tried pasting the script execute-plugin without any luck. Also I have tried putting in a full path for the bat file. C:\users\username\documents\execute.bat. With and without qoutation marks. Also without any luck. How do I get Deluge on windows to execute filebot cmd's after completet download?

Notes
Filebot is up to date.
Deluge is 1.3.15
OS is Windows 10

b0ssem
Posts: 12
Joined: 20 Mar 2017, 07:56

Re: Q&A for n00bs

Post by b0ssem » 05 Oct 2017, 19:46

Hey guys,

I have been using Filebot for some time now but only drag and drop style. So now im moving on to the automated worlds. Please bear with me.

I have started off gently by creating a .bat-file that gets run atomatically when my files get extracted by another software im using. So when the extraction is complete is calls the .bat-script and executes the line below.

This is what i have started out with

Code: Select all

filebot -script fn:amc --output "N:\Done" --action copy -non-strict "N:\TV-IN" --log-file amc.log --def skipExtract=y --def excludeList=amc.txt
Kinda simple, nothing fancy. But there is a few things here that im wondering over.

1. Can I define the script to use any of my presets I have made in Filebot? Some of my swedish TV-Shows get named in english. I want them in Swedish. At the moment i have 2 presets. TV and Movie.

2. Is it possible to make the script to copy the files directly to N:\Done\TV Shows. Instead of how its doing now N:\Done\Tv Shows\ Tvshowname\Season13\

I think that will be good for now.

Thanks in advanced!

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

Re: Q&A for n00bs

Post by rednoah » 05 Oct 2017, 20:10

1.
Yes, you can set custom formats and language preferences via command-line options.

2.
I think you're talking about a custom format that might look something like this:

Code: Select all

N:\Done\{plex.name}
:idea: Please read the FAQ and How to Request Help.

b0ssem
Posts: 12
Joined: 20 Mar 2017, 07:56

Re: Q&A for n00bs

Post by b0ssem » 05 Oct 2017, 21:17

rednoah wrote:
05 Oct 2017, 20:10
1.
Yes, you can set custom formats and language preferences via command-line options.

2.
I think you're talking about a custom format that might look something like this:

Code: Select all

N:\Done\{plex.name}
Thanks for you fast reply!

I will check up on the custom formats and language.

Regarding the custom formats, I did a little test and edited my line as you proposed.

Code: Select all

filebot -script fn:amc --output "N:\Done\{plex.name}" --action copy -non-strict "N:\TV-IN" --log-file amc.log --def skipExtract=y --def excludeList=amc.txt
But i got this error when running
Illegal usage: output folder must exist and must be a directory: N:\Done\{plex.name}

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

Re: Q&A for n00bs

Post by rednoah » 05 Oct 2017, 22:42

1.
--output and --format have distinctively different meanings and functions.

e.g.

Code: Select all

-rename --output N:\Done --format {plex.name}
@see https://www.filebot.net/cli.html


2.
Since you're using the amc script, you'll want to read Change how files will be organized and renamed because you'll need to pass in a custom format for each media type via the --def <type>Format options.
:idea: Please read the FAQ and How to Request Help.

test8457
Posts: 2
Joined: 21 Mar 2019, 13:45

Re: Q&A for n00bs

Post by test8457 » 21 Mar 2019, 19:08

Hi,

I am currently switching to transmission with openvpn in a docker container on my Synology (DSM 6).
Before I used the Synology default download station and used the amc script to take care of completed downloads. That worked really well.
I tried to setup transmission in the same way, but I don't think transmission is currently able to run the filebot script at all. I can see in the transmission log file that the script is called after a download is completed, but the script is not actually running successfully.
I tried to set the right permissions for the script and changed the location of the script to the docker container, but that did not resolve my issue. When I tried to run a command inside the docker container I noticed that filebot command cannot be found: "bash: filebot: command not found".
As I am pretty new to all things regarding docker, could you guide me in any way to let the docker container access filebot? Do I have to alter the $Path settings?

Thanks and kind regards

User avatar
devster
Posts: 209
Joined: 06 Jun 2017, 22:56

Re: Q&A for n00bs

Post by devster » 21 Mar 2019, 19:16

Docker images are built with a specific set of stuff inside, think about that image as a separate machine.
It sounds like you didn't install FileBot in this particular image.
I only work in black and sometimes very, very dark grey. (Batman)

test8457
Posts: 2
Joined: 21 Mar 2019, 13:45

Re: Q&A for n00bs

Post by test8457 » 21 Mar 2019, 19:31

Thanks, that makes sense.
So can I install filebot as a package into my existing docker container, or do I have to create a new docker image with filebot as a dependency?

User avatar
devster
Posts: 209
Joined: 06 Jun 2017, 22:56

Re: Q&A for n00bs

Post by devster » 21 Mar 2019, 20:44

The second option is cleaner, start FROM the first one (Dockerfile syntax) and simply install FileBot, should work then.
I only work in black and sometimes very, very dark grey. (Batman)

Post Reply

Who is online

Users browsing this forum: Hanman and 3 guests