How to extract and rename?

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
User avatar
xadox
Posts: 28
Joined: 23 Mar 2012, 05:49

How to extract and rename?

Post by xadox » 16 Apr 2012, 12:43

I would like to extract rar files from a fix folder to a fix folder and rename them in one step.
Since I have no clue how to realise this it would be nice if someone can lend me a hand with it.
Greets XadoX

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

Re: How to extract and rename?

Post by rednoah » 16 Apr 2012, 12:55

filebot -extract /path/to/archives/ --output /output/folder/
&&
filebot -rename /output/folder/ --output /path/to/final/destination/
:idea: Please read the FAQ and How to Request Help.

User avatar
xadox
Posts: 28
Joined: 23 Mar 2012, 05:49

Re: How to extract and rename?

Post by xadox » 17 Apr 2012, 05:38

Thx. Is there also a way to extract the files to series name folders?

Currently I am extracting the files with WinRar. Then I move the files to the NAS in the right series folder. And finaly I rename them with FileBot.
Greets XadoX

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

Re: How to extract and rename?

Post by rednoah » 17 Apr 2012, 06:18

Extracting does't apply any special series/movie matching logic. You can script things the way you want if you really need to.

EDIT: FileBot can move files into any folder structure. Just define your template --format as absolute path. e.g. X:/TV/{n}/Season {s}/{episode}
:idea: Please read the FAQ and How to Request Help.

User avatar
xadox
Posts: 28
Joined: 23 Mar 2012, 05:49

Re: How to extract and rename?

Post by xadox » 17 Apr 2012, 07:31

Thx for the feedback.
Greets XadoX

onlinewurm
Posts: 3
Joined: 23 Sep 2019, 14:21

Re: How to extract and rename?

Post by onlinewurm » 25 Sep 2019, 18:57

From a folder Goldene.Hochzeit.mit.Handicap.2019.GERMAN.720p I would like to extract the rar and rename in one step as a Goldene Hochzeit mit Handicap 2019.mkv.

Use FileBot_4.8.5

#!/bin/sh
filebot -extract /home/rar/ --output /home/folder/
filebot -rename /home/folder/ --output /home/final/

[email protected]:/home/scripts# ./rar.sh
Read archive [muhhd-goldenehochzeitmithandicap-hdtv.rar] and extract to [/home/folder]
Extracting files [/home/folder/muhhd-goldenehochzeitmithandicap-hdtv.mkv]
"-rename/home/folder/" is not a valid option
[email protected]:/home/scripts#

thanks for any help

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

Re: How to extract and rename?

Post by rednoah » 26 Sep 2019, 10:24

You can do filebot -extract -rename ... to perform extraction and renaming with a single filebot command. However, FileBot internally will still extract files and then rename them.


Note that the issue at hand is unrelated to your question. You're simply missing a <space> in your command:

Code: Select all

"-rename/home/folder/" is not a valid option
:arrow: Please read Cmdline and Argument Passing for details.

:!: The sh script you pasted is likely not exactly the same as the sh script that is being executed and produced this error message.
:idea: Please read the FAQ and How to Request Help.

onlinewurm
Posts: 3
Joined: 23 Sep 2019, 14:21

Re: How to extract and rename?

Post by onlinewurm » 26 Sep 2019, 21:36

thank you for your help
I got it with the unzip and rename
but one more question i have
I can set the path of the Extracting files myself

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

Re: How to extract and rename?

Post by rednoah » 27 Sep 2019, 03:17

The --output folder argument is used for that.

If you want different --output folder for -extract and -rename, then you'll have to make 2 separate filebot calls.
:idea: Please read the FAQ and How to Request Help.

onlinewurm
Posts: 3
Joined: 23 Sep 2019, 14:21

Re: How to extract and rename?

Post by onlinewurm » 27 Sep 2019, 14:37

Hi
As soon as I try to unpack with the amc-custom.groovy script, the path changes
I would like to put the Extracting files on the target server. And not on the source server

Code: Select all

[email protected]:~# filebot -extract /home/rar/* --output /home/folder/
Read archive [muhhd-goldenehochzeitmithandicap-hdtv.rar] and extract to [/home/folder]
Extracting files [/home/folder/muhhd-goldenehochzeitmithandicap-hdtv.mkv]

Code: Select all

[email protected]:~# filebot -extract /home/rar/* --output /home/folder/ -script /home/scripts/filebot-scripts/amc-custom.groovy
FROM custom amc - Run script [/home/scripts/filebot-scripts/amc-custom.groovy] at [Fri Sep 27 16:25:19 CEST 2019]
FROM custom amc - Log file [No log file]
FROM custom amc - tvDB: [TheTVDB]
FROM custom amc - EpisodeOrder: [Airdate]
FROM custom amc - Parameter: Language = [en_US]
FROM custom amc - Parameter: Override = [false]
FROM custom amc - Argument[0]: /home/rar/Goldene.Hochzeit.mit.Handicap.2019.GERMAN.720p.HDTV.x264-muhHD
FROM custom amc - Ignore extra: /home/rar/Goldene.Hochzeit.mit.Handicap.2019.GERMAN.720p.HDTV.x264-muhHD/Sample
FROM custom amc - Ignore hidden: /home/rar/Goldene.Hochzeit.mit.Handicap.2019.GERMAN.720p.HDTV.x264-muhHD/.message
Read archive [muhhd-goldenehochzeitmithandicap-hdtv.rar] and extract to [/home/rar/Goldene.Hochzeit.mit.Handicap.2019.GERMAN.720p.HDTV.x264-muhHD/muhhd-goldenehochzeitmithandicap-hdtv/Goldene.Hochzeit.mit.Handicap.2019.GERMAN.720p.HDTV.x264-muhHD]
Extracting files [/home/rar/Goldene.Hochzeit.mit.Handicap.2019.GERMAN.720p.HDTV.x264-muhHD/muhhd-goldenehochzeitmithandicap-hdtv/Goldene.Hochzeit.mit.Handicap.2019.GERMAN.720p.HDTV.x264-muhHD/muhhd-goldenehochzeitmithandicap-hdtv.mkv]

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

Re: How to extract and rename?

Post by rednoah » 28 Sep 2019, 03:04

If you're using filebot -script ... then you're not using filebot -extract ... so any answers that apply to filebot -extract ... calls may or may not apply to other commands, which may accept the same --options but interpret the values differently.


If you're using the amc script then you'll want read the Options section of the amc script manual page for additional configuration options:
rednoah wrote:
01 Aug 2012, 13:04
--def extractFolder=/path/to/folder Extract archives to this folder
:idea: Please read the FAQ and How to Request Help.

Post Reply