Page 19 of 41

Re: Exclude Blacklist & Series-Mappings

Posted: 01 Apr 2017, 08:23
by rednoah
ffreese wrote:Hi,
for me there was one big reason to stay at v 4.2 with the old gui: I run filebot on a server and use x2go for access.
As newer filebot versions need glx > V1.3 they simply do stall, because x2go is stuck at V1.2...

Maybe we could have a modern version with oldstyle-gui for older pc or x2go-users?
How is this question related to Exclude Blacklist & Series-Mappings?

:idea: You can disable graphics acceleration to work around graphics issues. See FAQ for details. Java Swing and JavaFX fully support software rendering as far as I know.

Usage Examples

Posted: 05 Apr 2017, 09:27
by rednoah
1. Rename files with FileBot:

Code: Select all

$ filebot -rename *.mp4 --db TheMovieDB -non-strict
Rename movies using [TheMovieDB]
Auto-detect movie from context: [avatar.mp4]
[MOVE] From [avatar.mp4] to [Avatar (2009).mp4]
Processed 1 files
2. Confirm that FileBot metadata has been stored as xattr in the filesystem:

Code: Select all

$ filebot -script fn:xattr *.mp4
/path/to/Avatar (2009).mp4
	net.filebot.filename: avatar.mp4
	net.filebot.metadata: {"@type":"Movie","year":2009,"imdbId":499549,"tmdbId":19995,"language":"en","id":19995,"name":"Avatar","aliasNames":[]}
3. Use xattr metadata in filter and format expressions:

Code: Select all

$ filebot -mediainfo -r . --filter "y >= 2000" --format "{n} by {director}"
Avatar by James Cameron
4. Process xattr tagged files based on existing xattr metadata:

Code: Select all

filebot -rename -r . --db xattr --action copy --output /Volumes/USB --filter "episode && age < 30" --format "{n} - {sxe} - {t}"

Process without --db ??

Posted: 07 Apr 2017, 17:33
by simmz
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 (°_°)

Re: Q&A for n00bs

Posted: 07 Apr 2017, 18:47
by rednoah
-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

Re: Q&A for n00bs

Posted: 07 Apr 2017, 20:02
by simmz
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.

Re: Q&A for n00bs

Posted: 07 Apr 2017, 20:07
by rednoah
-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.

Re: Q&A for n00bs

Posted: 07 Apr 2017, 20:17
by simmz
Makes sense. Thanks for your help. I spent the better part of the day trying to make that little one-liner work.

Re: Presets

Posted: 11 Apr 2017, 18:57
by stephen147
Could you add the ability to overwrite or keep file extension in the presets.

I overwrite my movies while keep extensions on TV programs.

Re: Presets

Posted: 12 Apr 2017, 00:24
by rony123
I think it is already included? is not it?
HemorrhageTreatment

Re: Presets

Posted: 12 Apr 2017, 02:20
by rednoah
Extension: Preserve / Override works independently of Presets and cannot be enabled/disabled via clicking a Preset.
stephen147 wrote:Could you add the ability to overwrite or keep file extension in the presets.
If I make it too easy, then the novice folks will accidentally delete all their extensions and then blame FileBot.
stephen147 wrote:I overwrite my movies while keep extensions on TV programs.
Why do your movie files have the wrong extension? I've never once come across a movie file with the wrong extension.

Re: Presets

Posted: 12 Apr 2017, 23:36
by stephen147
Could that option not be enabled by default so the user can't tamper with it or warning if checkbox is ticked?

It's the only way to rename subtitles and movies together in same rename by using this:

Code: Select all

{n.replace(':','-').replaceAll(/[\/:*?"<>|]/,' - ')}    ({y})                   {any{fn.match(/(?i)25th.+?anniv/)}{''}.replaceAll(/(?i).*25th.+?anniv.*/, "(25th Anniv. Edition)")}          {any{fn.match(/(?i)remastered/)}{''}.replaceAll(/(?i).*Remastered.*/, "(Remastered)")}           {any{fn.match(/(?i)extended.+?edit/)}{''}.replaceAll(/(?i).*Extended.+?Edit.*/, "(Extended Edition)")}     {any{fn.match(/IMAX.+?Edition/)}{''}.replaceAll(/(?i).*imax.+?edition.*/, "(IMAX Edition)")}             {any{fn.match(/(?i)direct.+?cut/)}{''}.replaceAll(/(?i).*direct.+?cut.*/, "(Director's Cut)")}     {any{fn.match(/(?i)unrated/)}{''}.replaceAll(/(?i).*unrated.*/, "(Unrated)")}     {any{fn.match(/(?i)\(limited.*?\)/)}{''}.replaceAll(/(?i).*limited.*/, "(Limited Edition)")}    {any{fn.match(/(?i)\(uncut.*?\)/)}{''}.replaceAll(/(?i).*uncut.*/, "(Uncut)")}    {any{fn.match(/(?i)collector.+?s.+?edition/)}{''}.replaceAll(/(?i).*collector.+?s.+?edition.*/, "(Collector's Edition)")}                  {any{fn.match(/\([^\()+?[^\d]+?\)\s*/)} {""}{''}}   {self.vf ? self.vf + "" : self.hpi}    {"${self.source ?: 'WEB-DL'}"}    {ac}    {audio[0].channels.replaceAll(/^(\d{1}).*/,'$1')replaceAll(/2/, "2ch").replaceAll(/6/, "5.1ch").replaceAll(/8/, "7.1ch")}    {vc}_{any{"$group"}{fn.match(/(?<=[_-])[^\s_-]+?$/)}{'NA'}.replaceAll(/[-_\[\]]\s*|\.\w{3}$/, "")}/{n.replace(':','-').replaceAll(/[\/:*?"<>|]/,' - ')}    ({y})                   {any{fn.match(/(?i)25th.+?anniv/)}{''}.replaceAll(/(?i).*25th.+?anniv.*/, "(25th Anniv. Edition)")}          {any{fn.match(/(?i)remastered/)}{''}.replaceAll(/(?i).*Remastered.*/, "(Remastered)")}           {any{fn.match(/(?i)extended.+?edit/)}{''}.replaceAll(/(?i).*Extended.+?Edit.*/, "(Extended Edition)")}     {any{fn.match(/IMAX.+?Edition/)}{''}.replaceAll(/(?i).*imax.+?edition.*/, "(IMAX Edition)")}             {any{fn.match(/(?i)direct.+?cut/)}{''}.replaceAll(/(?i).*direct.+?cut.*/, "(Director's Cut)")}     {any{fn.match(/(?i)unrated/)}{''}.replaceAll(/(?i).*unrated.*/, "(Unrated)")}     {any{fn.match(/(?i)\(limited.*?\)/)}{''}.replaceAll(/(?i).*limited.*/, "(Limited Edition)")}    {any{fn.match(/(?i)\(uncut.*?\)/)}{''}.replaceAll(/(?i).*uncut.*/, "(Uncut)")}    {any{fn.match(/(?i)collector.+?s.+?edition/)}{''}.replaceAll(/(?i).*collector.+?s.+?edition.*/, "(Collector's Edition)")}                  {any{fn.match(/\([^\()+?[^\d]+?\)\s*/)} {""}{''}}   {self.vf ? self.vf + "" : self.hpi}    {"${self.source ?: 'WEB-DL'}"}    {ac}    {audio[0].channels.replaceAll(/^(\d{1}).*/,'$1')replaceAll(/2/, "2ch").replaceAll(/6/, "5.1ch").replaceAll(/8/, "7.1ch")}    {vc}_{any{"$group"}{fn.match(/(?<=[_-])[^\s_-]+?$/)}{'NA'}.replaceAll(/[-_\[\]]\s*|\.\w{3}$/, "")}{any{'.'+lang}{lang}}{any{fn.match(/(?i)sdh.+?/)}{''}.replaceAll(/(?i).*sdh.*/, "_SDH")}{any{fn.match(/(?i)\(foreignpartsonly\)/)}{''}}{"."+ext}

Re: Presets

Posted: 13 Apr 2017, 00:40
by rednoah
stephen147 wrote:It's the only way to rename subtitles and movies together
How so? What's the problem?

Extension: Override only allows you to change ".sub" to ".srt". Why would you do that? In fact, you're not even trying to do that. Your format ends with {"."+ext} so you apparently want to keep the extension.

Re: Presets

Posted: 13 Apr 2017, 00:47
by stephen147
I'll need to revisit this again when I've time.

It was the only way for me to use them bindings successfully to rename movie and sub files was to have the override extension enabled and then rewrite it back again using {"."+ext}.

Re: Q&A for n00bs

Posted: 13 Apr 2017, 15:45
by kindofblue91
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}"

Re: Q&A for n00bs

Posted: 13 Apr 2017, 16:46
by rednoah
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?

Re: Q&A for n00bs

Posted: 13 Apr 2017, 16:56
by kindofblue91
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.

Re: Q&A for n00bs

Posted: 13 Apr 2017, 17:04
by rednoah
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:

Re: Q&A for n00bs

Posted: 13 Apr 2017, 17:13
by kindofblue91
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

Re: Q&A for n00bs

Posted: 14 Apr 2017, 02:37
by rednoah
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

syntax error near unexpected token `('

Posted: 23 Apr 2017, 22:11
by kaziekama
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.

Re: [Mac] Folder Action with Automator

Posted: 24 Apr 2017, 13:55
by Santaspascuas
Hi,

I have followed all your steps, and when I run the Automator I get the following error message: "Illegal usage: output folder must exist and must be a directory: "Media".

I have a folder called Media (users/alvaro/Media) *alvaro is my name
Can you help me with this issue? It is my first time writing scripts and I have no clue of the proper spelling of the output route.
Thanks!

Re: [Mac] Folder Action with Automator

Posted: 24 Apr 2017, 13:59
by rednoah
Thanks for the post! Before a real human comes by, please make sure your report has all the following points checked:
  • What are you trying to do achieve? What's not working? What have you tried so far?
  • Include screenshots, logs or filenames (i.e. demonstrate the issue)
  • Include basic information (i.e. sysinfo output)
:idea: Please read How to Request Help and Fix Problems, Report Bugs, Get Features

Re: --filter and fine-tuning

Posted: 25 Apr 2017, 04:29
by Laynezilla
Is there a complete list of filters anywhere?

Re: --filter and fine-tuning

Posted: 25 Apr 2017, 05:44
by rednoah
:idea: The number of possible filters is infinite. The available bindings (n, y, s, etc) are the same as in format expressions.

What's the problem? What are you trying to accomplish?

Re: [Mac] Folder Action with Automator

Posted: 27 Apr 2017, 13:48
by Santaspascuas
Hi rednoah, apologies for the lousy help request. I have now read the FAQ and the How to Request Help section. I am sorry if I still make mistakes, because I am not English fluent and I dont understand many of the words and instructions. Here I go:
I am running automator on a Mac Mini, runnin OS Sierra 10.12.4.
I am trying to set Automator to look up the destination folder of Transmission (called "Transmission"), where all the movies and tvshows are dowloaded, and process the media files through Filebot to rename them and send them to the Media folder.
Hopefully, in a second stage I would like to send the renamed files to external hard drives and even get the subtitles, but I dont want to bother you even further.
I have installed the filebot console tools and checked that are working.
When I follow the instructions given by you in this post, I open Automator, I select new Document and select Folder Action.
I click the Choose folder combobox and select the folder "Transmission"
When I paste the shell script arguments exactly as you say ("$HOME/Media"), I get the following error: http://i.imgur.com/ALOgN6r.png
If I write another route (/Users/alvaro/Media), the message is similar (quoting and unquoting): http://i.imgur.com/CAHmOX6.png

I hope I've provided enough information.
Many thanks in advance!