Page 1 of 1

Script to rename and move files to new location with new folder structure

Posted: 13 Jun 2018, 02:26
by megahertz
I'm kinda new to filebot and have just setup a seedbox to download.

I have movies going into a folder /downloads/watch and wanting to have the movies renamed and moved to a location, /downloads/Movies
I am wanting to either rename the folder they are contained within to match the filename, in the format of movie [year].extension, or create the folder and place the video file in it during the move.

What command would I need to perform this?

Re: Script to rename and move files to new location with new folder structure

Posted: 13 Jun 2018, 06:13
by rednoah
What have you tried so far? Where did you get stuck? Have you tried the amc script yet?

Re: Script to rename and move files to new location with new folder structure

Posted: 13 Jun 2018, 07:38
by megahertz
I've been trying the following that I grabbed from another post on here

Code: Select all

filebot -rename /downloads/watch/ --db TheMovieDB -no-xattr --action hardlink --format "/downloads/Movies/{n} ({y})/{n} ({y}){f.substring(3)}" -non-strict "$@"
At the moment I am getting an error message stating there are no media files.

Re: Script to rename and move files to new location with new folder structure

Posted: 13 Jun 2018, 07:43
by rednoah
1.
megahertz wrote: 13 Jun 2018, 07:38 At the moment I am getting an error message stating there are no media files.
What does "$@" do exactly? What does -rename /downloads/watch/ do? What does -r do?

:idea: These questions will hint you towards the right direction. ;)


2.
I highly recommend just using the amc script for new comers. It'll work out of the box and comes with lots of documentation. Copying commands from the forums is not a good idea, unless you fully understand how it works and what it does.

Re: Script to rename and move files to new location with new folder structure

Posted: 13 Jun 2018, 08:39
by megahertz
I tried the amc script and got a 'script not found' error.
I believe it may be due to my seedbox provider using an older version of filebox (4.7 r3923 I believe).
I already contacted my provider and they are unwilling to update the version of filebot to a later one.

Re: Script to rename and move files to new location with new folder structure

Posted: 13 Jun 2018, 09:05
by rednoah
What does filebot -version say?

Re: Script to rename and move files to new location with new folder structure

Posted: 13 Jun 2018, 09:15
by megahertz

Code: Select all

FileBot 4.7 (r3923) / Java(TM) SE Runtime Environment 1.8.0_151 (headless)

Re: Script to rename and move files to new location with new folder structure

Posted: 13 Jun 2018, 12:02
by rednoah
I see. That release is from 2 May 2016 so it's quite outdated and I'd be surprised if it works at all.

:idea: If you rely on deprecated tooling now, because you'll be wasting time on things that just don't work, or just won't work in the future.

:idea: I don't know what the error message says, but it sounds like it's failing right away because you're not passing in any input files. Presumably, even if you manage to pass in files, it'll just run into more and more errors because this version is too outdated and probably just doesn't work anymore.

Re: Script to rename and move files to new location with new folder structure

Posted: 13 Jun 2018, 22:05
by megahertz
Unfortunately, short of changing provider, I am stuck with it for the moment.

The folder I have media files in contains other folders with media files in them as well.
I am not sure why it is not able to find them

Re: Script to rename and move files to new location with new folder structure

Posted: 13 Jun 2018, 22:32
by megahertz
Ok my provider has update filebot to version 4.7.9 which now allows me to run the amc script, however it just looks to be sitting there doing nothing after using the following

Code: Select all

filebot -script fn:amc --output "/downloads/Movies/" --action copy -non-strict "/downloads/watch/

Re: Script to rename and move files to new location with new folder structure

Posted: 14 Jun 2018, 00:02
by megahertz
All good, I think I have finally figured it out.

I now need to figure out how to remove the empty folders left behind in my source location.

Re: Script to rename and move files to new location with new folder structure

Posted: 14 Jun 2018, 04:44
by rednoah
1.
You can use the cleaner script for that:
viewtopic.php?f=4&t=5#p1341


2.
Don't forget to use --def excludeList if you're automatically and repeatedly running filebot on the same folder. Please read the Run from cmdline section in the manual:
viewtopic.php?f=4&t=215