AMC + uTorrent - Status Question & File Name Data Question

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
ImWithBob
Posts: 9
Joined: 18 May 2013, 09:33

AMC + uTorrent - Status Question & File Name Data Question

Post by ImWithBob »

Hey everyone,

First let me say RedNoah you are an amazing developer, I hope you get all the recognition you deserve. FileBot is really a fantastic and amazing program, and the AMC script is really fantastic!

I have two questions that I need help with. For my first question I would like to know if there is there any way to have filebot/amc keep information that is in brackets in the original file name in the newly renamed file name? For example, this is the code I have set for when AMC needs to rename an anime series.

Code: Select all

"animeFormat=/Anime/{n}/{n} - S{(episode.season ? s : 1).pad(2)}E{e.pad(2)} - {t.space(' ')} [{crc32}]"
Most anime downloads have a group name in brackets, for example [RedNoah]. Is it possible for any bracketed information to be kept in the file name? Thankfully with the commands I know of I can have crc data put in brackets weather its in the original file name or not, but any help with keeping group names/other bracketed information would be really helpful. I know this means I will end up with a lot of data with things like [x264] or [hi10p] besides the information I am looking for. But I have a feeling asking to include file name data in brackets, except for things on a blacklist is asking a bit too much even for a great program such as this.

Note: I do vaguely remember an earlier version of FileBot checking anidb and matching anime files crcs to group names, but that was many months ago and I am unsure if such support was kept or if I am even remembering it correctly. I do however remember a long text file with nothing but a list of group names. Not sure if this has any relevance on what I am asking for, but just thought I should bring it up


Now for my next question.


The issue I am having is really quite frustrating because I am sure it has a simple answer and I am just not seeing it. That itself is even more frustrating as I have spent the past 2-3 hours reading and searching all over this and the utorrent support forum trying to find an answer.

Let me show you what I have in my utorrent "Run this program when a torrent finishes" box.

Code: Select all

filebot -script fn:amc --output "D:/Test" --log-file amc.log --action move --conflict override -non-strict --def music=n artwork=n "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S" "animeFormat=/Anime/{n}/{n} - S{(episode.season ? s : 1).pad(2)}E{e.pad(2)} - {t.space(' ')} [{crc32}]" "clean=y"
Here is the problem I am having when using the script. Right now as soon as the torrent reaches 100% and starts to seed the script is run immediately. This is quite a problem as it means that the file is moved and renamed, and there is nothing left to seed. Now you might be saying to yourself "Mr. ImWithBob, why not simply let filebot copy the file instead of move it and turn the "clean=" option to "clean=n" and your problem will be solved." Well that's an easy one for me to answer. If I do that then I will be left with two copies of the file, one of witch I will have to clean up after I am done seeding. This is very inconvenient. As such after reading these forums and searching for every term relating to this I can think of I am now here with what I hope is a simple question.

How can I set either utorrent or the filebot/amc script to run only when the status is changed to finished?

I hope someone here can help me, as I am really at the end of my rope with trying to figure this out. Any assistance that is offered is greatly appreciated.

Sincerely,

-IWB
User avatar
rednoah
The Source
Posts: 22980
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC + uTorrent - Status Question & File Name Data Questi

Post by rednoah »

1. All possible. You'll find these threads inspiring:

match() and matchAll() functions for keeping tokens:
http://www.filebot.net/forums/viewtopic.php?f=5&t=712

{group} binding
http://www.filebot.net/forums/viewtopic.php?f=5&t=4

format expression with data from text file:
http://www.filebot.net/forums/viewtopic.php?f=5&t=182

2. If it's all on one filesystem you might wanna look into hardlinks ;)

Other than that you can run it on state change but add --def ut_state_allow=<seeding finished state id>. That'll make the amc script abort if ut_state doesn't match ut_state_allow.
:idea: Please read the FAQ and How to Request Help.
ImWithBob
Posts: 9
Joined: 18 May 2013, 09:33

Re: AMC + uTorrent - Status Question & File Name Data Questi

Post by ImWithBob »

Thanks for taking the time to respond to my request for help. It is most appreciated.

I attempted to do what you said and added "ut_state_allow=11" (11 is the number for Finished) to my utorrent command and moved the whole thing under the "run program when changes state" field in utorrent. The code I used is below.

Code: Select all

filebot -script fn:amc --output "D:/Test" --log-file amc.log --action move --conflict override -non-strict --def music=n artwork=n "ut_state_allow=11" "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=Anime" "ut_state=%S" "animeFormat=/Anime/{n}/{n} - S{(episode.season ? s : 1).pad(2)}E{e.pad(2)} - {t.space(' ')} [{crc32}]" "clean=y"
I thought I did everything properly, however as soon as the very first state changes it would grab the file and rename it, and before the first state change could even clean up and delete the original file a few more copies had been run all trying to do the same. The catch, all of them, even the first, were trying to rename when the state did not match ut_state_allow=11. I included the logs below so you can see for yourself. Oh and do note that is all from one torrents start to download to finished seeding marking the torrent as finished. Hence why its so long.

Code: Select all

http://pastebin.com/aQJC3RfD
If you could take a look and see what I might have done wrong I would appreciate it. In the mean time I am going to go and write up a list of release groups that I would very much like you to add to your group file. Thanks so much for the info on the group tag, along with the other data. It was exactly what I was looking for.

-IWB
ImWithBob
Posts: 9
Joined: 18 May 2013, 09:33

Re: AMC + uTorrent - Status Question & File Name Data Questi

Post by ImWithBob »

Came up with a list of groups, I will try and come up with more in a few days but I think this (total of 70) should get things started. I posted the list here, as well as in the group forum you linked. If you could add them I would appreciate it. Some are similar, but I assure you I checked them all against the list you already have and removed any and all duplicates.

Code: Select all

http://pastebin.com/nAtMFdmz
Thanks a lot,

-IWB

P.S. A quick note, some do look similar, for instance (G_P) vs G_P (already on list). Also the release group [p] listed as "p" (no quotes) is not a typo, it is a group. in a few days I will have another 10-20, but this pretty much covers most of the big anime release group names.
User avatar
rednoah
The Source
Posts: 22980
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC + uTorrent - Status Question & File Name Data Questi

Post by rednoah »

Sorry, seems that feature has been broke for a while. Fixed that.

Try --script svn:amc and it should work.
:idea: Please read the FAQ and How to Request Help.
ImWithBob
Posts: 9
Joined: 18 May 2013, 09:33

Re: AMC + uTorrent - Status Question & File Name Data Questi

Post by ImWithBob »

rednoah wrote:Sorry, seems that feature has been broke for a while. Fixed that.

Try --script svn:amc and it should work.
Fantastic work, it now works perfectly. I really appreciate all the help. Once you have the group list updated I will be in fantastic shape. Thanks so much for all your hard work!

Can you tell me how long I should leave it at "--script svn:amc" until I return it to "--script fn:amc"?

Thanks,

-IWB
User avatar
rednoah
The Source
Posts: 22980
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC + uTorrent - Status Question & File Name Data Questi

Post by rednoah »

Updated everything. If you use thinks like normal it should auto-update the amc and groups-list within 24h.
:idea: Please read the FAQ and How to Request Help.
ImWithBob
Posts: 9
Joined: 18 May 2013, 09:33

Re: AMC + uTorrent - Status Question & File Name Data Questi

Post by ImWithBob »

Thanks so much, I swaped back and set it to fn:amc and it now works great. Also, thanks for taking the time to update the group list. I know it was a lot of names so I really appreciate it.,

I am still having one problem however. Some of my anime series are getting a log like this. From what I can tell is there are too many options for choosing the right name from AniDB and its just deciding to skip them. Is there any way to override this and force it to rename the file?

Log:

Code: Select all

Parameter: music = n
Parameter: artwork = n
Parameter: ut_state_allow = 11
Parameter: ut_dir = C:\Library\BitTorrent\complete\[gg] The Hentai Prince And The Stony Cat Nyaa.eu RSS
Parameter: ut_file = [gg]_Hentai_Ouji_to_Warawanai_Neko_-_03_[0E161BCC].mkv
Parameter: ut_kind = single
Parameter: ut_title = [gg]_Hentai_Ouji_to_Warawanai_Neko_-_03_[0E161BCC].mkv
Parameter: ut_label = Anime
Parameter: ut_state = 11
Parameter: animeFormat = /Anime/{n}/{n} - S{(episode.season ? s : 1).pad(2)}E{e.pad(2)} - {t.space(' ')} [{crc32}] [{group}] [Hi10p] [SubOnly]
Parameter: clean = y
Input: C:\Library\BitTorrent\complete\[gg] The Hentai Prince And The Stony Cat Nyaa.eu RSS\[gg]_Hentai_Ouji_to_Warawanai_Neko_-_03_[0E161BCC].mkv
Group: [anime:The Hentai Prince And The Stony Cat] => [[gg]_Hentai_Ouji_to_Warawanai_Neko_-_03_[0E161BCC].mkv]
Rename episodes using [AniDB]
Auto-detected query: [The Hentai Prince And The Stony Cat]
Exception: Failed to auto-select search result: [Hentai Ouji to Warawanai Neko., Sirius no Densetsu, Toaru Hikuushi e no Tsuioku]
Done ヾ(@⌒ー⌒@)ノ
I think this bit here is the important part:

Code: Select all

Exception: Failed to auto-select search result: [Hentai Ouji to Warawanai Neko., Sirius no Densetsu, Toaru Hikuushi e no Tsuioku]
It looks like its not picking the first option (which is the correct option), or any option for that matter.

Any help you can offer would be appreciated.

-IWB

P.S. If you watch anime and like comedy's The Hentai Prince and the Stony Cat is quite funny. I highly recommend it.
Last edited by ImWithBob on 19 May 2013, 20:13, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 22980
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC + uTorrent - Status Question & File Name Data Questi

Post by rednoah »

Are you running the amc with the -non-strict switch? That should work, otherwise it's a bug.
:idea: Please read the FAQ and How to Request Help.
ImWithBob
Posts: 9
Joined: 18 May 2013, 09:33

Re: AMC + uTorrent - Status Question & File Name Data Questi

Post by ImWithBob »

Yes I am here is the code.

Code: Select all

ilebot -script fn:amc --output "D:/" --log-file amc.log --action move --conflict override -non-strict --def music=n artwork=n "ut_state_allow=11" "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=Anime" "ut_state=%S" "animeFormat=/Anime/{n}/{n} - S{(episode.season ? s : 1).pad(2)}E{e.pad(2)} - {t.space(' ')} [{crc32}] [{group}] [Hi10p]" "clean=y"
I can't tell if you meant I should not be running it with non-strict, or that if I am running it with non-strict its a bug. Assuming what you mean is its happening because its set to -non-strict what should I change it too?

Again, thanks for all the help.

-IWB
User avatar
rednoah
The Source
Posts: 22980
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC + uTorrent - Status Question & File Name Data Questi

Post by rednoah »

It's searching by english name, but then it's only got the japanese options and can't make sense of it. In that case even non-strict does abort.

Uploaded r1630 where it'll just assume that it got the correct match (if there's less than 5 results).
:idea: Please read the FAQ and How to Request Help.
ImWithBob
Posts: 9
Joined: 18 May 2013, 09:33

Re: AMC + uTorrent - Status Question & File Name Data Questi

Post by ImWithBob »

rednoah wrote:It's searching by english name, but then it's only got the japanese options and can't make sense of it. In that case even non-strict does abort.

Uploaded r1630 where it'll just assume that it got the correct match (if there's less than 5 results).
The new version works just fantastically, thanks so very much. It's selecting and renaming the series just fine.

I sincerely appreciate all your hard work helping me. You can expect a donation from me. This really is amazing software. I wish I was a bit smarter with these things so I could help write tutorials, but as I am unable you can bet I will at least be telling everyone I know about FileBot.

I really don't understand what the problem is or was, as pretty much all the anime I download has Japanese names and then selects the right option from AniDB. For instance, below is a log from Shingeki no Kyojin (Attack on Titan). It seems to have no issue searching AniDB, selecting the English name,making the folders and renaming the files. Most likely I am just not understanding your explanation for the problem, but I thought I would give you these logs from a different anime series anyhow.

Code: Select all

Parameter: music = n
Parameter: artwork = n
Parameter: ut_state_allow = 11
Parameter: ut_dir = C:\Library\BitTorrent\complete\RSS
Parameter: ut_file = [EveTaku] Shingeki no Kyojin - 07 (1280x720 x264-Hi10P AAC)[C9D9CF76].mkv
Parameter: ut_kind = single
Parameter: ut_title = [EveTaku] Shingeki no Kyojin - 07 (1280x720 x264-Hi10P AAC)[C9D9CF76].mkv
Parameter: ut_label = Anime
Parameter: ut_state = 11
Parameter: animeFormat = /Anime/{n}/{n} - S{(episode.season ? s : 1).pad(2)}E{e.pad(2)} - {t.space(' ')} [{crc32}] [{group}] [Hi10p]
Parameter: clean = y
Input: C:\Library\BitTorrent\complete\RSS\[EveTaku] Shingeki no Kyojin - 07 (1280x720 x264-Hi10P AAC)[C9D9CF76].mkv
Group: [anime:Shingeki no Kyojin] => [[EveTaku] Shingeki no Kyojin - 07 (1280x720 x264-Hi10P AAC)[C9D9CF76].mkv]
Rename episodes using [AniDB]
Auto-detected query: [Shingeki no Kyojin]
Fetching episode data for [Shingeki no Kyojin]
Fetching episode data for [Shingeki no Kyojin OAD]
May 19, 2013 3:41:24 AM net.sourceforge.filebot.media.MediaDetection storeMetaInfo
WARNING: Failed to set xattr: java.nio.file.AccessDeniedException: C:\Library\BitTorrent\complete\RSS\[EveTaku] Shingeki no Kyojin - 07 (1280x720 x264-Hi10P AAC)[C9D9CF76].mkv:filename
[MOVE] Rename [C:\Library\BitTorrent\complete\RSS\[EveTaku] Shingeki no Kyojin - 07 (1280x720 x264-Hi10P AAC)[C9D9CF76].mkv] to [D:\Anime\Attack on Titan\Attack on Titan - S01E07 - A Small Blade Defense of Trost (3) [C9D9CF76] [EveTaku] [Hi10p].mkv]
Processed 1 files
Clean clutter files and empty folders
Done ヾ(@⌒ー⌒@)ノ
Thanks agian for all your help, I am now off to enjoy my updated XBMC system and watch it grab and rename files like a boss.

-IWB
User avatar
rednoah
The Source
Posts: 22980
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC + uTorrent - Status Question & File Name Data Questi

Post by rednoah »

It's easy, it'll try to search for something, usually gets multiple results, then tries to take the ones that make sense. With the english-vs-japanese problem the query often doesn't match the result so it can't know which search result is the correct one.

Old logic:
1 option that doesn't make sense => take it
n options that don't make sense => abort

New logic:
1 option that doesn't make sense => take it
5 options or less that don't make sense => take all and try your best
many options that don't make sense => abort
:idea: Please read the FAQ and How to Request Help.
Post Reply