unpacking torrent to dir based on label with AMC script?

Any questions? Need some help?
Post Reply
beltoft
Posts: 13
Joined: 17 May 2014, 16:35

unpacking torrent to dir based on label with AMC script?

Post by beltoft »

Im using filebot with the AMC script and rtorrent its working perfect but I would like filebot to unpack to dirs defined by me based on the torrent label and if I havent defined any dir for the label it should default back to the standard dir

is this possible with the AMC script
User avatar
rednoah
The Source
Posts: 23940
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: unpacking torrent to dir based on label with AMC script?

Post by rednoah »

By "unpack" do you mean "copy to" because unpack wouldn't make sense since files are moved to another location anyway. If you want to move files into a structure define your own formats and use the {label} binding as you see fit. ;)
:idea: Please read the FAQ and How to Request Help.
beltoft
Posts: 13
Joined: 17 May 2014, 16:35

Re: unpacking torrent to dir based on label with AMC script?

Post by beltoft »

yes i mean "copy to" as it is unpacked before it moved/copied - my mistake :)

im not sure what you mean by define your own formats. could you give an example?

what i want to do is this:

if {label} is XYZ then copy into this/folder/structure/
and if {label} is anything else then use default/folder/structure

does it make sense?
User avatar
rednoah
The Source
Posts: 23940
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: unpacking torrent to dir based on label with AMC script?

Post by rednoah »

Do you know how the Format works? http://www.filebot.net/naming.html

Did you read Change how files will be organized section in the AMC docs? viewtopic.php?f=4&t=215

e.g.

Code: Select all

V:/{label}/{n}/Season {s}/{sxe} - {t}

Code: Select all

V:/{label =~ 'test' ? 'Test' : 'TV Shows'}/{n}/Season {s}/{sxe} - {t}
etc... anything else could easily be based on the examples above ;)

Note that these examples are overly simplistic and that the amc script uses much more complicated formats by default. ;)
:idea: Please read the FAQ and How to Request Help.
beltoft
Posts: 13
Joined: 17 May 2014, 16:35

Re: unpacking torrent to dir based on label with AMC script?

Post by beltoft »

yes i've read the "change how files will be organized" but I don't really understand it.

I don't want things with this label to be sorted or renamed. it should just be dumped in a subfolder with the torrents name in a folder I specify

if the label is different from what I've specified it should be processed as normal
User avatar
rednoah
The Source
Posts: 23940
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: unpacking torrent to dir based on label with AMC script?

Post by rednoah »

In this case you wanna have a look at the --def ignore and --def unsorted options.
:idea: Please read the FAQ and How to Request Help.
beltoft
Posts: 13
Joined: 17 May 2014, 16:35

Re: unpacking torrent to dir based on label with AMC script?

Post by beltoft »

I've looked at --def ignore but won't that just make AMC totally ignore whatever matches? and isn't the --def unsorted only for things that AMC don't recognize?

Maybe I can use the --def format anyway but as far as I have understood it will be applied to everything going through AMC and I don't want that. can it be set up so the format only will be applied to whatever torrent that have the specified label and everything else will be processed as normal?

EDIT:

I've looking info if --filter could be used but the examples i've found here is not that helpful.

Could something along the line of --filter "$LABEL = XYS copy to /alternative/file/path" be used?
User avatar
rednoah
The Source
Posts: 23940
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: unpacking torrent to dir based on label with AMC script?

Post by rednoah »

1.
No, the --filter option does not do what you think/hope it does.

2.
As far as I can tell, what you want is: IF $LABEL = XYZ THEN ignore all files, right?

That is not supported, but if the LABEL happens to be in the file path, then you could use the ignore option to ignore the files that have that label in their path. If a file is ignored, it will not be recognized as anything, and as such it will be moved via the unsorted logic if enabled.

What you can't currently do is override the unsorted output format to your /alternative/file/path via cmdline options.

3.
If you somehow want to process files via episode/movie logic, but move files to different location as given by the label, then it's all in the format as explained earlier.
:idea: Please read the FAQ and How to Request Help.
beltoft
Posts: 13
Joined: 17 May 2014, 16:35

Re: unpacking torrent to dir based on label with AMC script?

Post by beltoft »

right now i've set AMC up so it process everything and sort it into /Movies and /TV Shows. so far so good :)

what i want to do is: IF $LABEL = XYZ then copy to /AnotherFolder ELSE do as normal and process into /Movies or /TV Shows depending on content

so no files is ignored but just processed differently depending on label. hope it makes sense
User avatar
rednoah
The Source
Posts: 23940
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: unpacking torrent to dir based on label with AMC script?

Post by rednoah »

So you do want to process these files as Episodes or Movies using the normal logic, except you want a slightly different output format? Then use your own format, and use label as a condition in your format the way you want it.

I've already provided an example above: viewtopic.php?f=8&t=2355#p13535
:idea: Please read the FAQ and How to Request Help.
beltoft
Posts: 13
Joined: 17 May 2014, 16:35

Re: unpacking torrent to dir based on label with AMC script?

Post by beltoft »

the best thing would be if they wasn't processed at all but just unpacked and then copied to the folder of my choice. if thats not a possibility then its ok they're processed and renamed.

what i don't understand is how can i use format when it says in viewtopic.php?f=4&t=215
"This script uses multiple format expressions, so the simple --format option is not supported"

because i want to use AMC to process the files except the ones with $LABEL = XYZ or alternative AMC should also process the files with $LABEL = XYZ but place them in a different output folder

the call i make to filebot from rtorrent looks like this

Code: Select all

filebot -script fn:amc --output "/home/" --log-file amc.log --action copy --conflict auto -non-strict --def subtitles=da,en --def clean=y --def artwork=y --def excludeList=amc-input.txt "ut_dir=$TORRENT_PATH" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL"
could I just add

Code: Select all

--format {$TORRENT_LABEL =~ 'XYZ' : AlternativeFolder/{n} ({y})/{n} ({y}){' CD'+pi}{'.'+lang}
to that string and then everything with LABEL XYZ is processed into folder /home/AlternativeFolder/ and everything without label =XYZ is processed into /home/Movies or /home/TV Shows
User avatar
rednoah
The Source
Posts: 23940
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: unpacking torrent to dir based on label with AMC script?

Post by rednoah »

Here's what you want:
Im using filebot with the AMC script and rtorrent its working perfect but I would like filebot to unpack to dirs defined by me based on the torrent label and if I havent defined any dir for the label it should default back to the standard dir
Here's how to do it:
As far as I can tell, what you want is: IF $LABEL = XYZ THEN ignore all files, right?

That is not supported, but if the LABEL happens to be in the file path, then you could use the ignore option to ignore the files that have that label in their path. If a file is ignored, it will not be recognized as anything, and as such it will be moved via the unsorted logic if enabled.

What you can't currently do is override the unsorted output format to your /alternative/file/path via cmdline options.


As for the format. Yes, it starts with...
This script uses multiple format expressions, so the simple --format option is not supported.
It then goes on...
Instead can override the default naming schemes via --def seriesFormat, animeFormat or movieFormat.
Also you clearly have no idea how argument parsing works => viewtopic.php?f=4&t=1899

Your "could I just add" is wrong on so many levels I don't even know where to start. :lol:

While testing and trying to make things work I really really hope you're prototyping things on the cmdline manually, and not via your torrent client.


:idea: Automation is nice, but I recommend using the amc script as-is or switching to the GUI.
:idea: Please read the FAQ and How to Request Help.
beltoft
Posts: 13
Joined: 17 May 2014, 16:35

Re: unpacking torrent to dir based on label with AMC script?

Post by beltoft »

As I said I've read the about the format but never really understood it. The same goes for argument parsing. Thats why I'm asking for help.
I had hoped this would be a simple task since AMC and filebot have so many options and the files I want separated into its own folder is easily identified via the label

and for this line

Code: Select all

Instead can override the default naming schemes via --def seriesFormat, animeFormat or movieFormat.
As far as I understand it, it applies to everything processed by AMC and not only specific things while the rest would be processed with default settings as I want it. Am I wrong?

I think that maybe I can use the ignore along with the unsorted logic and then just accept that I can't control where it is moved to.
I had just understood that the --ignore would make whatever mentioned here completely ignored by filebot/AMC but after I've read your explanation again it seems that its not the case. It will still be unpacked and copied to the unsorted folder if --def unsorted=y is set. Correct?
User avatar
rednoah
The Source
Posts: 23940
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: unpacking torrent to dir based on label with AMC script?

Post by rednoah »

Yes, ignore just means files are ignored for normal processing, and with unsorted enabled anything that falls through normal processing will be handled anyway and moved to a folder called "Unsorted" while keeping the original filename.

Using the unsorted logic would most certainly be the easiest way to do it. Just need to make sure you torrent client creates a folder for each label and then downloads the files to there.
:idea: Please read the FAQ and How to Request Help.
beltoft
Posts: 13
Joined: 17 May 2014, 16:35

Re: unpacking torrent to dir based on label with AMC script?

Post by beltoft »

Ok I've played around with the ignore function at its partially working as i want

I've downloaded the AMC script and is running it locally so I can control where the ignored files should be placed however I would like to have every ignored file placed into its own subfolder with the name of the torrent. This way it would be easier for me to see what everything ignored is, as the filenames alone often don't give any clue

I've fried to put different format arguments into the AMC script where the ignore path is created but haven't got much luck in getting it to work. eg will {n} in the path not work and im guessing its because the files are ignored so the name is never found.

Then I tried to inset {file} into the path and it worked but I'm getting the full path to the file so I tried to add the after function like this {file.after(XYZ)} but that didn't work either :/

So is there a way where i can get only the name of the parent folder of the original file and put it into the path so the output would be like this:
/unsorted/{original.file.perantfolder}/{fn}.{ext}
User avatar
rednoah
The Source
Posts: 23940
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: unpacking torrent to dir based on label with AMC script?

Post by rednoah »

This will do:

Code: Select all

Unsorted/{folder.name}/{file.name}
:idea: Please read the FAQ and How to Request Help.
Post Reply