Command Line script help

Any questions? Need some help?
Post Reply
hookshot
Posts: 5
Joined: 21 Mar 2014, 20:24

Command Line script help

Post by hookshot »

I would like to create a command line script to use in windows.
I run a raspberry pi, which torrents to the server. This uses to automatically grab desired content, and stores the tv shows and anime into folders based on series.

I would like to create a script that i could run which would look at both the anime and tv shows folders, and rename/move the shows to the corresponding anime/tv show folders on my local computer, as the server is not meant for storage. The biggest part of my issue is that I need it to NOT grab anything from folders that contain a file with .part in it, as it will make transmission have issues with the torrent file if one of the files disappears. It would obviously be desirable if folders that were made empty/only left containing small text/image files would be deleted automatically.

So the components I'm looking for:

Checks 2 directories.
Depending on the directory a file is in, Anime/TV shows, renames to new directory Anime/TV shows
Checks with theTVDB for parts of the rename - the current format string I use is:
E:/TV Shows/{n}/{"Season ${s}"}/{n}.{s00e00}.{t}
Will NOT attempt to move/rename files in a folder that contains a file with .part
Cleans up junk folders created.

An additional goal would be for any files in those folders that are not DEFINITELY identified to be moved to a specific folder, as they must be manually dealt with.

I obviously don't intend anyone to write the script for me, I'm more concerned with, are these possible with filebot? And if so, does anyone have any resources for me to look at? I understand BASIC format strings, but as far as doing conditionals inside them, I don't know where to start. Any thoughts you have would be greatly appreciated.
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Command Line script help

Post by rednoah »

This script implements almost everything, except for the .part thing:
http://www.filebot.net/forums/viewtopic.php?f=4&t=215

Cleaner, for deleting left behind almost-empty folders:
http://www.filebot.net/forums/viewtopic ... &t=5#p1341

This example script implements the "do not touch folders with .part files" logic:
http://www.filebot.net/forums/viewtopic.php?f=4&t=5#p52

So I guess you wanna grab this last script and modify it to your needs. Should be pretty simple as long as you don't need any of the advanced logic the amc script provides.
:idea: Please read the FAQ and How to Request Help.
hookshot
Posts: 5
Joined: 21 Mar 2014, 20:24

Re: Command Line script help

Post by hookshot »

Thank you for the help! I would like to be able to use the amc scripts -
The issue is because there are so many layers - i.e. - It torrents from a raspberry pi to a server, and then another computer connects to the server to transfer data off- the majority of those scripts won't work. I don't plan on connecting the computer as a drive on the server, so the server can't start a transfer when a torrent is done unfortunately.

Soon I'll implement some NAS here, and it'll be a different story.
Thanks!
hookshot
Posts: 5
Joined: 21 Mar 2014, 20:24

Re: Command Line script help

Post by hookshot »

rednoah wrote:
This example script implements the "do not touch folders with .part files" logic:
http://www.filebot.net/forums/viewtopic.php?f=4&t=5#p52
So, I ended up making a few configuration changes - notably requiring each torrent to get downloaded to it's own individual folder, as there was a small oversight - part file could be downloaded in the same folder as a different file, if they weren't in folders in the torrent. Now it should pull files when desired and available.

The last remaining piece of the puzzle:

I see you can set conflicts to overwrite/skip/fail,

But is there any way to get uncertainties or conflicts to get moved to a particular folder? I would much rather they go to a separate "unsorted" folder, or if nothing else, is there a way inside the script to know that a file was skipped, so I can notify the user?

Thank you so much, you've been a great help!
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Command Line script help

Post by rednoah »

There's also --conflict auto which will keep the one with higher resolution (if mediainfo works) or larger filesize.

If you wanna be on the save side you're gonna have to do --conflict skip and sift through the logs once in a while to see if anything has been skipped, so egrep is your friend.
:idea: Please read the FAQ and How to Request Help.
Post Reply