Original File and folder name

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
saitoh183
Posts: 112
Joined: 02 Oct 2012, 16:59

Original File and folder name

Post by saitoh183 »

I have a question about the CLI variables

So this is the output of a processed file:

Code: Select all

2017-02-22 01:27:25,693 - Media_Processing - DEBUG - StandardE: Locking /media/sdu1/home/saitoh183/private/script/Filebot.log
Run script [fn:amc] at [Wed Feb 22 01:03:11 GMT-05:00 2017]
Parameter: clean = y
Parameter: movieFormat = /media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/{plex[1..-1]}
Parameter: ut_label = Movies
Parameter: exec =  ""python /media/sdu1/home/saitoh183/private/script/rclone_move.py -fp "{file}" -fr "{localize.french.name} ({y})" -en "{ny}"""
Argument[0]: /media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies
{duration} => Expression yields empty value: Binding "duration": Native library (com/sun/jna/linux-x86-64/libjnidispatch.so) not found in resource path ([file:/media/sdu1/home/saitoh183/filebot/FileBot.jar])
Input: /media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST.mp4
Group: [mov:manchester by the sea 2016] => [Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST.mp4]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST.mkv/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST.mp4]
[MOVE] Rename [/media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST.mkv/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST.mp4] to [/media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/Manchester by the Sea (2016)/Manchester by the Sea (2016).mp4]
Processed 1 files
Execute: ""python /media/sdu1/home/saitoh183/private/script/rclone_move.py -fp "/media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/Manchester by the Sea (2016)/Manchester by the Sea (2016).mp4" -fr "Manchester by the Sea (2016)" -en "Manchester by the Sea (2016)"""
There is a line says :
Input: /media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST.mp4

After the file has been renamed, is there a variable that contains the input information above? I would want to pass that variable to the -exec

i currently use

Code: Select all

exec= \"\"python /media/sdu1/home/saitoh183/private/script/rclone_move.py -fp \"{file}\" -fr \"{localize.french.name} ({y})\" -en \"{ny}\"\"\"'
to get

Code: Select all

""python /media/sdu1/home/saitoh183/private/script/rclone_move.py -fp "/media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/Manchester by the Sea (2016)/Manchester by the Sea (2016).mp4" -fr "Manchester by the Sea (2016)" -en "Manchester by the Sea (2016)"""
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Original File and folder name

Post by rednoah »

You can have the original filename via the {original} binding, but not the original file path.

If you want to do stuff with old/new path pairs, then you'll need to write shell script and check the history after the amc script is done:

Code: Select all

filebot -script fn:history
e.g.

Code: Select all

filebot -script fn:history | while IFS=$'\t' read -r FROM TO; do
	echo $FROM ➔ $TO
done
:idea: Please read the FAQ and How to Request Help.
saitoh183
Posts: 112
Joined: 02 Oct 2012, 16:59

Re: Original File and folder name

Post by saitoh183 »

rednoah wrote:You can have the original filename via the {original} binding, but not the original file path.

If you want to do stuff with old/new path pairs, then you'll need to write shell script and check the history after the amc script is done:

Code: Select all

filebot -script fn:history
e.g.

Code: Select all

filebot -script fn:history | while IFS=$'\t' read -r FROM TO; do
	echo $FROM ➔ $TO
done
cool, thanks i will have a look...i would have said filename would have been enough but sometime it is only the filepath folder that contains the movie name and the file name is random characters.
saitoh183
Posts: 112
Joined: 02 Oct 2012, 16:59

Re: Original File and folder name

Post by saitoh183 »

saitoh183 wrote:
rednoah wrote:You can have the original filename via the {original} binding, but not the original file path.

If you want to do stuff with old/new path pairs, then you'll need to write shell script and check the history after the amc script is done:

Code: Select all

filebot -script fn:history
e.g.

Code: Select all

filebot -script fn:history | while IFS=$'\t' read -r FROM TO; do
	echo $FROM ➔ $TO
done
cool, thanks i will have a look...i would have said filename would have been enough but sometime it is only the filepath folder that contains the movie name and the file name is random characters.

Will this work on a headless server as well?
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Original File and folder name

Post by rednoah »

Why wouldn't it? It's a shell script. :lol:
:idea: Please read the FAQ and How to Request Help.
saitoh183
Posts: 112
Joined: 02 Oct 2012, 16:59

Re: Original File and folder name

Post by saitoh183 »

rednoah wrote:Why wouldn't it? It's a shell script. :lol:
:lol: stupid question...
Post Reply