Move files to specific folders

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
GeorgeAl
Posts: 10
Joined: 17 Apr 2020, 17:43

Move files to specific folders

Post by GeorgeAl »

I want to move from the download directory (H:\Downloads) to H:\WD\Series (if they are tv shows) and/or H:\WD\Movies (if they are movie files).
Can you help me?

P.S. I am using jDownloader2, and I can not make AMC work correctly.
User avatar
rednoah
The Source
Posts: 18995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Move files to specific folders

Post by rednoah »

GeorgeAl wrote: 19 Apr 2020, 09:20 I am using jDownloader2, and I can not make AMC work correctly.
Why not?

If you're using JD then all the advice we have can be found here:
viewtopic.php?t=3478

If you need more help on JD, then the folks in the JD forums will know best:
https://board.jdownloader.org/
:idea: Please read the FAQ and How to Request Help.
GeorgeAl
Posts: 10
Joined: 17 Apr 2020, 17:43

Re: Move files to specific folders

Post by GeorgeAl »

Ok, forget the jDownloader part can you help me with the other problem.

I want to move from the download directory (H:\Downloads) to H:\WD\Series (if they are tv shows) and/or H:\WD\Movies (if they are movie files).
User avatar
rednoah
The Source
Posts: 18995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Move files to specific folders

Post by rednoah »

Yes, that is what the amc script does. Please read the manual to get started.
:idea: Please read the FAQ and How to Request Help.
GeorgeAl
Posts: 10
Joined: 17 Apr 2020, 17:43

Re: Move files to specific folders

Post by GeorgeAl »

I did not want to make it automatically but manualyl.
User avatar
rednoah
The Source
Posts: 18995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Move files to specific folders

Post by rednoah »

If you're not familiar with the command-line, then I would recommend using the GUI, it can do everything you want just as well, just easier:
https://www.filebot.net/getting-started/


:idea: Please read FAQ #1 and learn how format expressions work.
:idea: Please read the FAQ and How to Request Help.
GeorgeAl
Posts: 10
Joined: 17 Apr 2020, 17:43

Re: Move files to specific folders

Post by GeorgeAl »

I am familiar with the command-line. If you do not to help me please do not reply
User avatar
rednoah
The Source
Posts: 18995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Move files to specific folders

Post by rednoah »

Well, the amc script that I kindly linked for you earlier seems to have an appropriately named Run from cmdline section that you might be interested in reading:
rednoah wrote: 01 Aug 2012, 13:04 Run from cmdline:
Want to try it out first? Running directly from cmdline is even easier and if you set --action test you can do a dry-run and see if everything gets matched up correctly:

Code: Select all

filebot -script fn:amc --output "/path/to/output" --action duplicate -non-strict "/path/to/input" --log-file amc.log --def excludeList=amc.txt
  • If you run this script manually, you can set --mode interactive to enable console-interactive mode.
  • If you run this script automatically in intervals every hour or every day, then you must set --def excludeList or you will get banned.
:idea: Please read the FAQ and How to Request Help.
GeorgeAl
Posts: 10
Joined: 17 Apr 2020, 17:43

Re: Move files to specific folders

Post by GeorgeAl »

Ok I found it. Thank for trying
kim
Power User
Posts: 1027
Joined: 15 May 2014, 16:17

Re: Move files to specific folders

Post by kim »

try this format:

Code: Select all

{'H:/WD/'}{f.isMovie() ? 'Movies/' : 'Series/'}{plex.tail}
User avatar
rednoah
The Source
Posts: 18995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Move files to specific folders

Post by rednoah »

kim wrote: 19 Apr 2020, 18:50 try this format:

Code: Select all

{'H:/WD/'}{f.isMovie() ? 'Movies/' : 'Series/'}{plex.tail}
This code is not correct, because f.isMovie() can very well yield true even even if we're formatting an Episode object. Checking {plex.root} might make more sense.


Though I'd do neither, and keep it simple:

Code: Select all

--output H:/WD --format {plex}
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1027
Joined: 15 May 2014, 16:17

Re: Move files to specific folders

Post by kim »

In my quick test it worked.... but ok then try this:

Code: Select all

{'H:/WD/'}{plex.parentFile.parent == 'Movies' ? 'Movies/' : 'Series/'}{plex.tail}
GeorgeAl
Posts: 10
Joined: 17 Apr 2020, 17:43

Re: Move files to specific folders

Post by GeorgeAl »

The correct code is

Code: Select all

H:\WD\Series\{n.replaceTrailingBrackets()} ({episodelist.airdate.year.bounds().join ('-')})  /Season {s} ({episodelist.findAll{it.season == s}.airdate.year.min()}) / {n} - {sxe} - {t}
Post Reply