CLI - ISO/Movie issues

Any questions? Need some help?
Post Reply
remo
Posts: 6
Joined: 28 Sep 2019, 19:15

CLI - ISO/Movie issues

Post by remo » 28 Sep 2019, 19:46

Hello everybody.
First I want to thank the developer for this great piece of software. I’m familiar with command line tools and that’s why I love FileBot. It is straight forward, powerful and pretty easy to use.
I crafted a script for processing my tv shows - which works great.
But I do have some issues processing my movie files. Using the amc script seems to be the right decision. I’d like to accomplish something like:

1. Process file types iso and mkv only; move other supported types (!= iso||mkv) to specified folder

1.1 is there any possibility to add iso files to the list of supported media types?
I don’t need to extract my iso files and I don’t want to! A simple fetch and rename by the ISO’s file name would be more than enough.

2. Use TMDB and TheTVDB only. If the passed media cannot be found in one of them, move it to specified folder

3. After removing eg colons from the file name (auto-cleanup by FileBot itself), create a text file (or nfo or whatever) and write/append the original fetched file name into it (including eg colons, question marks etc) -> to review the original fetched media’s name - kind of protocol of cleaned-up file names.

4. Delete files with specified substring before all the magic starts

That’s it.
Having these 5 issues solved, my setup will be perfect.

I don’t want to have a pre-written and finished script. Just point me into the right direction - snippets would be great ;)

Have a nice day.

-remo

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

Re: CLI - ISO/Movie issues

Post by rednoah » 28 Sep 2019, 20:32

1.
You can use the ignore pattern option to ignore files. I’d move them away in a separate command before calling the amc script though.

1.1.
Does disabling extracting make the amc script pick up the iso file? If not, just process the iso files in a separate command.

2.
The unsorted option should take care of that.

3.
You can use xattr metadata for that. You can export custom text files based on that too automatically if it makes your workflow easier.

4.
Best to do in a separate command before everything else.



Are you using Windows or Unix? If Unix, the find command is your friend. If Windows, filebot itself is a convenient replacement for these typical find command use cases.
:idea: Please read the FAQ and How to Request Help.

remo
Posts: 6
Joined: 28 Sep 2019, 19:15

Re: CLI - ISO/Movie issues

Post by remo » 29 Sep 2019, 06:53

Thank you for your reply.
I’ll give it a try.

1. Can you give me some further information regarding point 3 please?
I have no idea how to start.

2. Is there any overview for handling substrings? I guess I have to use something like “fn == /sample/”
But how is the notation for substrings?

Thank you.

-remo

Edit: FileBot runs on my Syno.

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

Re: CLI - ISO/Movie issues

Post by rednoah » 29 Sep 2019, 07:04

1.
e.g. Print before / after file names using xattr:

Code: Select all

$ filebot -mediainfo -r . --format $'{original}\n{fn}\n'
Ant.Man.and.the.Wasp.(2018)
Ant-Man and the Wasp (2018)


Alternatively, you can also query the rename history for all rename operations:

Code: Select all

$ filebot -script fn:history --format '${from.name}\n${to.name}\n'
Ant.Man.and.the.Wasp.(2018).mkv
Ant-Man and the Wasp (2018).mkv

Done ヾ(@⌒ー⌒@)ノ
:idea: viewtopic.php?p=2459#p2459



2.
There's an infinite number of ways to handle substrings. What exactly are you trying to do? Select file that contain the keyword sample? Keep certain keywords in the filename when renaming? Something else?
:idea: Please read the FAQ and How to Request Help.

remo
Posts: 6
Joined: 28 Sep 2019, 19:15

Re: CLI - ISO/Movie issues

Post by remo » 29 Sep 2019, 07:25

You’re insanely fast!
Thank you. I’ll try out your snippets.

To 2. Just want to delete a tv show’s sample files before processing the rest of episodes. Most of them have “sample” as substring included in their file names.

-remo

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

Re: CLI - ISO/Movie issues

Post by rednoah » 29 Sep 2019, 09:30

Since you're on Linux, the usual Linux tools are your friends:

Code: Select all

find . -type f -iname '*sample*.mkv' -delete
:idea: Please read the FAQ and How to Request Help.

remo
Posts: 6
Joined: 28 Sep 2019, 19:15

Re: CLI - ISO/Movie issues

Post by remo » 29 Sep 2019, 09:42

So easy. Thought I should have do that using FileBot.

Thank you. Now I have enough inspiration to try out.

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

Re: CLI - ISO/Movie issues

Post by rednoah » 29 Sep 2019, 10:20

You can, but using filebot is overkill if it's a simple find -delete job:

Code: Select all

filebot -mediainfo -r . --filter 'fn.match(/sample/)' -exec rm -v {f}
:idea: Please read the FAQ and How to Request Help.

remo
Posts: 6
Joined: 28 Sep 2019, 19:15

Re: CLI - ISO/Movie issues

Post by remo » 29 Sep 2019, 12:01

Ok. Using find in Linux Im common with.
Just didn’t think about it.

Just a question:
Is FileBot able to identify sample snippets of a movie or tv show not using file names - lets say can FileBot identify samples by metadata running against a db?

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

Re: CLI - ISO/Movie issues

Post by rednoah » 29 Sep 2019, 16:14

remo wrote:
29 Sep 2019, 12:01
Is FileBot able to identify sample snippets of a movie or tv show not using file names - lets say can FileBot identify samples by metadata running against a db?
No. But the amc script will simply ignore short video files, and that basically eliminates samples and other video clutter.


Here's where using filebot instead of find makes sense, because filebot makes MediaInfo queries and conditions easy:

Code: Select all

filebot -mediainfo -r . --filter 'minutes < 10' -exec rm -v {f}
:idea: Please read the FAQ and How to Request Help.

remo
Posts: 6
Joined: 28 Sep 2019, 19:15

Re: CLI - ISO/Movie issues

Post by remo » 29 Sep 2019, 16:47

I’m very impressed!
Thank you for your great support!!!

Post Reply