Copy movie to folder based on label
Copy movie to folder based on label
Hi there, I was wondering if anyone could direct me how I might alter the amc script to make it copy movies to a specific folder based on the label from utorrent? Ie. if labelled "kids" it will copy it to the folder D:/Kids movies/
Thanks for your help.
Thanks for your help.
Re: Copy movie to folder based on label
You'll have to modify the script for that. Find the movieFormat variable and insert the value of the ut_label variable that is passed in somewhere.
Re: Copy movie to folder based on label
Thanks for the hint. I'm not familiar with Java or Groovy so not sure how to insert a variable into a string. I tried a few things like this below, based on what I could find on the web, but its not passing on the variable:
mov: tryQuietly{ movieFormat } ?: '''$ut_label/{n} ({y})/{n} ({y}){" CD$pi"}{".$lang"}''',
mov: tryQuietly{ movieFormat } ?: '''${ ut_label }/{n} ({y})/{n} ({y}){" CD$pi"}{".$lang"}''',
mov: tryQuietly{ movieFormat } ?: ''''$ut_label'/{n} ({y})/{n} ({y}){" CD$pi"}{".$lang"}''',
Ideally I'd like to use if statements to make it more flexible, but it didn't work either:
if {ut_label = "Kids"} {
mov: tryQuietly{ movieFormat } ?: '''Kids Movies/{n} ({y})/{n} ({y}){" CD$pi"}{".$lang"}''',
}
I'm sure this is trivial for someone who knows java. Any suggestions would be much appreciated.
Thanks!
mov: tryQuietly{ movieFormat } ?: '''$ut_label/{n} ({y})/{n} ({y}){" CD$pi"}{".$lang"}''',
mov: tryQuietly{ movieFormat } ?: '''${ ut_label }/{n} ({y})/{n} ({y}){" CD$pi"}{".$lang"}''',
mov: tryQuietly{ movieFormat } ?: ''''$ut_label'/{n} ({y})/{n} ({y}){" CD$pi"}{".$lang"}''',
Ideally I'd like to use if statements to make it more flexible, but it didn't work either:
if {ut_label = "Kids"} {
mov: tryQuietly{ movieFormat } ?: '''Kids Movies/{n} ({y})/{n} ({y}){" CD$pi"}{".$lang"}''',
}
I'm sure this is trivial for someone who knows java. Any suggestions would be much appreciated.
Thanks!
Re: Copy movie to folder based on label
Change this:
To:
Code: Select all
'''Movies/{n} ({y})/{n} ({y}){" CD$pi"}{".$lang"}'''
Code: Select all
ut_dir + '''Movies/{n} ({y})/{n} ({y}){" CD$pi"}{".$lang"}'''
Re: Copy movie to folder based on label
Perfect - thanks so much!
Re: Copy movie to folder based on label
sorry to resurrect such an old post but I am trying to do exactly this in utorrent.
I have Labels set up like "New Releases" and "Kid Friendly"
Ho would I add to the script to put my movies in these folders?
this is the script i am running now. Works awesome by the way.
I have Labels set up like "New Releases" and "Kid Friendly"
Ho would I add to the script to put my movies in these folders?
this is the script i am running now. Works awesome by the way.
Code: Select all
filebot -script fn:amc --output "K:\Media" --log-file amc.log --action copy --conflict override -non-strict --def music=y subtitles=en artwork=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" --def clean=y
Re: Copy movie to folder based on label
I realize now that I have to modify the amc script, where is it located on my PC?
Re: Copy movie to folder based on label
1.
It's not. It's on GitHub.
2.
No, you don't. You just need to pass in custom format expressions. If you pass in a label to the amc script, then you'll be able to access it with {label} in your format expression.
It's not. It's on GitHub.
2.
No, you don't. You just need to pass in custom format expressions. If you pass in a label to the amc script, then you'll be able to access it with {label} in your format expression.
Re: Copy movie to folder based on label
ok thank you! I am new to this where would I access the format expression?
would I somehow modify this code:
would I somehow modify this code:
Code: Select all
--def "seriesFormat=X:/TV/{n}/{'S'+s}/{fn}" "animeFormat=X:/Anime/{n}/{fn}" "movieFormat=Z:/Movies/{n} {y}/{fn}" "musicFormat=Z:/Music/{n}/{fn}"
Re: Copy movie to folder based on label
You can try with something like this:
And then move on to conditions based on the label value if that's what you want.
Code: Select all
Z:/{label}/Movies/{n} {y}/{fn}
Re: Copy movie to folder based on label
Awesome ill try that when i get home.
something like that, I only use labels with movies.
Code: Select all
--def "movieFormat=Z:/{label}/Movies/{n} {y}/{fn}
Re: Copy movie to folder based on label
would I have to change Z: to my K: or is the Z a constant?
Re: Copy movie to folder based on label
Neither? Z, K, A, B, C, etc are Windows Drive letters? You know?
Just checking:
* You know what Z:/ means, right?
* You know what {fn} means, right?
You may want to figure out how format expressions work first (using the FileBot Format Editor) before you move on using custom formats in the amc script.
Just checking:
* You know what Z:/ means, right?
* You know what {fn} means, right?
You may want to figure out how format expressions work first (using the FileBot Format Editor) before you move on using custom formats in the amc script.
Re: Copy movie to folder based on label
Yes i thought they were drive letters, my Drive is K: and a folder called Media to store everything, so I would change to Z to K, thank you.
So I will add this line to my utorrent amc line and if im not mistaken it will add the utorrent Label to the path when it copies.
I dont really know what im doing but I would love to learn.
So I will add this line to my utorrent amc line and if im not mistaken it will add the utorrent Label to the path when it copies.
Code: Select all
--def "movieFormat=K:/Media/{label}/Movies/{n} {y}/{fn}
Re: Copy movie to folder based on label
Since you already have --output "K:/Media" you can just do --def "movieFormat={label}/Movies/{n} {y}/{fn}" since the format is relative to the --output folder.
Also, {fn} means original filename.
You can learn from the Automated Media Center Defaults here: viewtopic.php?f=5&t=2
Also, {fn} means original filename.
You can learn from the Automated Media Center Defaults here: viewtopic.php?f=5&t=2
Re: Copy movie to folder based on label
This is great! thank you! I will definitely read through that thread.
One more thing if my folder structure is this:
K:\Media\Movies\New Releases
And my utorrent label is "New Releases" should I move the {label} to this spot:?
One more thing if my folder structure is this:
K:\Media\Movies\New Releases
And my utorrent label is "New Releases" should I move the {label} to this spot:?
Code: Select all
--def "movieFormat=Movies/{label}/{n} {y}/{fn}"
Re: Copy movie to folder based on label
It worked great! Many thanks, I hit the donate button, I have no issue paying for such great service
Re: Copy movie to folder based on label
Hello, this is my first post and been searching and reading for few days now to find a way to move and rename downloaded media with utorrent based on labels. I was looking for an automated single solution for renaming different media type/categories and after sans google showed me filebot as a potential winner i started to check out it's CLI capabilities (i've used filebot GUI before but didn't know about the CLI feature).
Ok, so tested AMC script and it works!, but soon i realized how basic it was and that i needed to modify it in order to fit my needs. I'm new to this and i find it a bit complex but i've been doing ok so far.
Here's my case scenario (Win 10 x64bits):
I created labels that contain subfolders in uTorrent (Preferences>UI Extras>Persistent Labels), these labels match my current file media structure as you can see in the images below but i keep "Append the torren't label" option unchecked.
The goal is to make AMC script use these labels as directories guided by --output path in order to have a fully organized media.


e.g: I download a Concert, a Documentary Series, a TV Show episode, a Web-DL Movie and a Kid's Movie; i have different folders/subfolders for them but all these folders are inside S:/myMedia
Facts:
* Concerts, Web-DL Movie and Kid's Movie are scanned by TheMoveDB
* Documetary Series and the TV Show episode are scanned by TheTVDB
If i use that code based on my labels setup and my example, are the downloads going to be moved to it's respective folder? ... i want to be sure
Edit: Success!
Concerts go to S:/myMedia/Concerts,
Documentary Series go to S:/myMedia/Documentaries/Series,
WEB-DL Movies go to S:/myMedia/Movies/WEB-DL,
Kid's Movies go to S:/myMedia/Kid's Movies (that one has a space, don't know if it will cause conflict?)
... and so on
PS: Movies naming is basic and applies for all the different categories (concerts, documentary films, etc), i like it that way but with TV Shows the naming had to be more advanced because of specials, seasons, parts so i took the default one from github.
Ok, so tested AMC script and it works!, but soon i realized how basic it was and that i needed to modify it in order to fit my needs. I'm new to this and i find it a bit complex but i've been doing ok so far.
Here's my case scenario (Win 10 x64bits):
I created labels that contain subfolders in uTorrent (Preferences>UI Extras>Persistent Labels), these labels match my current file media structure as you can see in the images below but i keep "Append the torren't label" option unchecked.
The goal is to make AMC script use these labels as directories guided by --output path in order to have a fully organized media.



e.g: I download a Concert, a Documentary Series, a TV Show episode, a Web-DL Movie and a Kid's Movie; i have different folders/subfolders for them but all these folders are inside S:/myMedia
Facts:
* Concerts, Web-DL Movie and Kid's Movie are scanned by TheMoveDB
* Documetary Series and the TV Show episode are scanned by TheTVDB
Code: Select all
"C:/Program Files/FileBot/filebot.launcher.exe" -script fn:amc --output "S:/myMedia" --log-file amc.log --action move --conflict override -non-strict --def excludeList=amc.txt "movieFormat={label}/{n} {y}/{n} {y}" "seriesFormat={label}/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {s00e00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}" unsorted=y music=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" --def clean=y xbmc=localhost
Edit: Success!
Concerts go to S:/myMedia/Concerts,
Documentary Series go to S:/myMedia/Documentaries/Series,
WEB-DL Movies go to S:/myMedia/Movies/WEB-DL,
Kid's Movies go to S:/myMedia/Kid's Movies (that one has a space, don't know if it will cause conflict?)
... and so on
PS: Movies naming is basic and applies for all the different categories (concerts, documentary films, etc), i like it that way but with TV Shows the naming had to be more advanced because of specials, seasons, parts so i took the default one from github.