Anime and the AMC Script

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
vballrican
Donor
Posts: 80
Joined: 21 Dec 2014, 01:29

Anime and the AMC Script

Post by vballrican »

Hello everyone, I had my system configured to use filebot upon completion of torrent and it was working fine until I tried a series recently...

Now it doesn't rename the files like The.Big.Bang.Theory.S08E02.HDTV.x264-LOL to The Big Bang Theory S08E02 - (episode name).

Here's the script:
filebot -script fn:amc --output "H:/Media" -non-strict "H:/New" --log-file amc.log --db theTVDB --action copy --def artwork=y "seriesFormat=H:/Media/TV/{n} ({certification}, {genre}, {y})/Season {s}/{fn}" "animeFormat=H:/Media/Anime/{n} ({certification}, {genre}, {y})/{fn}" "movieFormat=H:/Media/Movies/{n} ({y}) [{certification} {Genre}]/{n}" "musicFormat=H:/Media/Music/{n}/{fn}" excludeList=amc.txt

Any ideas?

Thanks.
User avatar
rednoah
The Source
Posts: 23050
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script not working properly anymore

Post by rednoah »

(Relevant) Logs?
:idea: Please read the FAQ and How to Request Help.
vballrican
Donor
Posts: 80
Joined: 21 Dec 2014, 01:29

Script not working the way i need it

Post by vballrican »

Hi Rednoah, i started using Filebot again after a while. Trying to setup an automated script in uTorrent that processes downloaded files.. I have what i need almost work but.. a few things do not.. I need the script to rename the downloaded movies/series/anime accordingly.. That works except it doesn't create the Season Folder like in the GUI settings. I also need artwork to download, that doesn't work.

PS: i just donated to you because I need to get this working asap. Thanks.

The script I'm using is:

Code: Select all

filebot -script fn:amc --output "I:/Processed" --action copy --conflict skip -non-strict --log-file amc.log --def excludeList --def artwork=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" movieFormat="I:/Movies/{ny}/{fn}" seriesFormat="I:/TV/{n} [{certification}, {genre}, {y}]/{'Season ' +s}/{n} - {s00e00} - {t}" animeFormat="I:/Anime/{n} [{certification}, {genre}, {y}]/{'Season ' +s}/{n} - {s00e00} - {t}" musicFormat="I:/MusicNew/{n}/{fn}"
User avatar
rednoah
The Source
Posts: 23050
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script not working properly anymore

Post by rednoah »

Anime don't have seasons. Converting AniDB Absolute episode data to TheTVDB Airdate SxE episode data is non-trivia.

Please read [Anime] Convert Absolute to SxE numbers.

There's a script for that as well, but you can't trust that it'll always work and it certainly shouldn't be used without human supervision: Convert Absolute numbers to SxE numbers
:idea: Please read the FAQ and How to Request Help.
vballrican
Donor
Posts: 80
Joined: 21 Dec 2014, 01:29

Re: Script not working properly anymore

Post by vballrican »

rednoah wrote:Anime don't have seasons. Converting AniDB Absolute episode data to TheTVDB Airdate SxE episode data is non-trivia.

Please read [Anime] Convert Absolute to SxE numbers.
But the GUI creates a season folder accordingly and renames according to TheTVDB. The TVDB anime has seasons! For example, Haikyuu!! has 2 seasons and about to start a 3rd.. :| just want to be able to do everything from the utorrent run program instead of having to manually do it. Thanks.
User avatar
rednoah
The Source
Posts: 23050
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script not working properly anymore

Post by rednoah »

The GUI and the CLI work exactly the same. If you want your anime to have SxE numbers you need to process them with TheTVDB (e.g. by forcing TV mode via --def ut_label=TV).

Bindings like {sxe} and {s00e00} can't work when using AniDB, but FileBot will actually try to match AniDB entries to TheTVDB entries to give you the missing data if possible.

This will work for shows like Naruto and One Piece that have 1:1 equivalents on both databases, but it'll never work for shows like Seikai no Monshou (and probably Haikyuu) that are organized completely differently in those two databases.
:idea: Please read the FAQ and How to Request Help.
vballrican
Donor
Posts: 80
Joined: 21 Dec 2014, 01:29

Re: Script not working properly anymore

Post by vballrican »

So --db TheTVDB doesn't define which DB to use for renaming? If I run Haikyuu thru the GUI, it renames the episodes in the SxE format and creates the Season 1 and Season 2 folders inside the main title folder... I can't get that with the CLI script.. :(

Edit: So i added ut_label=TV to my script and it created the Season 1 folder but, it didn't rename the files... I'm going crazy with this... :(
User avatar
rednoah
The Source
Posts: 23050
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script not working properly anymore

Post by rednoah »

1.
The amc script will ignore your --db and --format options.

2.
If you force TV mode, then TheTVDB will be used and files will be processed in accordance with your series format. Check the logs.


PS: You still haven't posted any filenames or logs. Please read How to 'Request Help'. If you check the logs, you'll probably see what's wrong immediately.
:idea: Please read the FAQ and How to Request Help.
vballrican
Donor
Posts: 80
Joined: 21 Dec 2014, 01:29

Re: Script not working properly anymore

Post by vballrican »

Ok. :( so if the amc script ignores my --format options, how do i get the files to the proper dirs after renaming, artwork, etc?

Trying without the --db and --format options right now.

Basically, i just need a script that processes after a utorrent download. It renames the series according to TheTVDB(S00E00) including season and folder structure for PLEX, downloads subtitles and artwork, and moves all this to it's proper parent folder, IE Anime Series, Anime Movies, etc. What is the aprox donation amount to get you to write the script? :|

Thanks
User avatar
rednoah
The Source
Posts: 23050
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script not working properly anymore

Post by rednoah »

The --format option is used for single -rename calls.

The amc script is much more advanced but it'll still make -rename calls internally with the appropriate db/format options depending on the files at hand using the 3 --def ***Format options.

As previously mentioned, Anime can be extremely tricky and the process of converting Anime data to TheTVDB data cannot be reliably automated for all cases.

Nevermind Anime Movies. Not even remotely supported. I know of no algorithms that could tell Anime Movies and normal movies apart (reliably, not just most of the time).

No amount of money will make the impossible possible. ;)
:idea: Please read the FAQ and How to Request Help.
vballrican
Donor
Posts: 80
Joined: 21 Dec 2014, 01:29

Re: Script not working properly anymore

Post by vballrican »

:cry: So for now, all i can use is the basic script to maybe copy the folder/files to the appropriate dirs and manually run them thru the Filebot GUI(Which works pretty good)? The utorrent automation idea covers only basic processing due to the differences between the script and the gui?

Can I at least get subtitles and artwork using the after download processing? I can handle the renaming manually as that's how i've been doing it all along.

Thanks.

PS: How do i attach screenshots?
User avatar
rednoah
The Source
Posts: 23050
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script not working properly anymore

Post by rednoah »

1.
The GUI and the CLI use the format engine. The same code. It could not possibly yield different results (unless input is different). You're probably testing with two different files for two different Anime, one that happens to work and one that happens not to work.

2.
Screenshots: https://snag.gy/

3.
I recommend letting the amc script process Anime as usual, and if you need to convert those files in the Anime folder to TheTVDB you can just use the GUI.

Manual Matching is the way to go if the filenames are misleading: http://www.filebot.net/getting-started/


4.
Artwork is all based on TheTVDB and TheMovieDB so it won't work well for Anime (if processed with AniDB; if processed with TheTVDB it's a TV Show for all accounts and purposes).
:idea: Please read the FAQ and How to Request Help.
vballrican
Donor
Posts: 80
Joined: 21 Dec 2014, 01:29

Re: Script not working properly anymore

Post by vballrican »

rednoah wrote:1. The GUI and the CLI use the format engine. The same code. It could not possibly yield different results (unless input is different). You're probably testing with two different files for two different Anime, one that happens to work and one that happens not to work.

-- Ok. I actually tested with the same show. GUI works but CLI does not. So how do i translate this format Image
into a CLI format with subtitles and artwork?
This is how it looks in the gui. That's how i want to rename. Image


2.
Screenshots: https://snag.gy/

-- Got it. Account created and screenshots uploaded. :)

3.
I recommend letting the amc script process Anime as usual, and if you need to convert those files in the Anime folder to TheTVDB you can just use the GUI.

Manual Matching is the way to go if the filenames are misleading: http://www.filebot.net/getting-started/

-- Just that PLEX uses TheTVDB for it's shows. Until I learn how to configure a different scraper, it's staying that way.

4.
Artwork is all based on TheTVDB and TheMovieDB so it won't work well for Anime (if processed with AniDB; if processed with TheTVDB it's a TV Show for all accounts and purposes).

-- So far, every show i have renamed through the GUI has been able to acquire the artwork with the --def artwork=y switch using the amc script afterwards.
Thanks for your help!
User avatar
rednoah
The Source
Posts: 23050
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script not working properly anymore

Post by rednoah »

1.
Looks good to me:

Code: Select all

⋮
Parameter: animeFormat = Anime/{n}/Season {s}/{n} - {s00e00} - {t}
⋮
[COPY] Rename [Hand Maid May - 01 [00000000].mp4] to [Anime/Hand Maid May/Season 1/Hand Maid May - S01E01 - How Do You Do.mp4]
In this specific case, AniDB seems to be compatible with TheTVDB so FileBot will be able to fake SxE info for you. I'd still recommend using the FileBot GUI to rename files with TheTVDB though.


4.
Of course. After you make sure the name matches exactly TheTVDB (plus FileBot tags the files with TheTVDB ID) it can't not work. :D

BTW: You are not processing your entire library with the amc script just to get some missing artwork, right? Thanks thanks to --def excludeList=amc.txt (stored in --output folder) you'll be fine. But I'd use the "Fetch Missing Artwork" scripts. ;)

@see viewtopic.php?f=4&t=5#p204
@see viewtopic.php?f=4&t=5#p205
:idea: Please read the FAQ and How to Request Help.
vballrican
Donor
Posts: 80
Joined: 21 Dec 2014, 01:29

Re: Script not working properly anymore

Post by vballrican »

Ok, Thanks a lot. I was just trying to automate my new shows but 100% automation is impossible.. :) Love the program and keep up the good work! :)

After i rename the folders/files with the GUI, i use this to fetch artwork and move the files into the appropriate dirs. But you mentioned that the amc script will ignore the --format but it still moves my media.

Code: Select all

filebot -script fn:amc --output "H:/Done" -non-strict "H:/process" --log-file amc.log --db TheTVDB --action move --def excludeList=amc.txt artwork=y "seriesFormat=H:/Series/Anime/{n} [{certification}, {genre}, {y}]/Season {s}/{fn}" "animeFormat=H:/Anime/{n} [{certification}, {genre}, {y}]/{fn}" "movieFormat=H:/process/{n} ({y}) - [{certification}, {Genre}]/{n} {y})" "musicFormat=H:/Music/{n}/{fn}"
User avatar
rednoah
The Source
Posts: 23050
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script not working properly anymore

Post by rednoah »

You're not using the --format option. Why are we even talking about this? Well, doesn't matter it'd be ignored anyway. You are using the --db option though. Only a problem if you think it does something, it doesn't, it'll be ignored.

As per documentation of the amc script, the --def seriesFormat / animeFormat / movieFormat options are used to pass formats for the various content types.
:idea: Please read the FAQ and How to Request Help.
vballrican
Donor
Posts: 80
Joined: 21 Dec 2014, 01:29

Re: Script not working properly anymore

Post by vballrican »

Ok. So this is my script right now..

Code: Select all

filebot -script fn:amc --output "N:/Done" -non-strict "N:/process" --log-file amc.log --action move --def excludeList=amc.txt ut_label=TV artwork=y "seriesFormat=N:/Series/Anime/{n} [{certification}, {genre}, {y}]/Season {s}/{fn}" "animeFormat=N:/Anime/{n} [{certification}, {genre}, {y}]/{fn}" "movieFormat=N:/process/{n} ({y}) - [{certification}, {Genre}]/{n} {y})" "musicFormat=N:/Music/{n}/{fn}"
It sorts my media accordingly and gets the artwork except it doesn't rename files, which for now, i will continue doing with the GUI... :|

Thanks
User avatar
rednoah
The Source
Posts: 23050
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script not working properly anymore

Post by rednoah »

1.
You are aware that by forcing TV mode via --def ut_label=TV you will not be able to process anything else (like movies and music) right? Because you seem to pass in a few extra formats for that will never be used. Since you're forcing TV mode, only the seriesFormat will be used.


2.
Whatever you're doing is still pretty strange. Do you know what {fn} means? It refers to the current filename. There's plenty of people that complain "doesn't rename files" while explicitly instructing FileBot to keep the current filename.


3.
Well, I give up at this point. I'll give you quick summary of doing it the smart way.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 23050
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Script not working properly anymore

Post by rednoah »

The Smart way of using the AMC Script while dealing with Anime manually:

1. Use the amc script as is and let it do whatever it wants.
2. Now you have Anime, TV Shows and Movies folders.
3. TV Shows and Movies folders are added to Plex/Kodi (but Anime is not)
4. Now you have TV Shows and Movies nicely in your Plex/Kodi library (except for Anime which are completely ignored at this point)
5. Whenever you have time check your Anime folder and use FileBot GUI to match files with TheTVDB, set your seriesFormat as format, and then let it move/rename files from the (absolute) Anime path to the (season/episode) TV Shows path.
6. Now Anime is empty, and TV Shows contains your "Anime" and "TV Shows" with standard TheTVDB naming and it'll show up nicely in your library
:idea: Please read the FAQ and How to Request Help.
vballrican
Donor
Posts: 80
Joined: 21 Dec 2014, 01:29

Re: Script not working properly anymore

Post by vballrican »

rednoah wrote:The Smart way of using the AMC Script while dealing with Anime manually:

1. Use the amc script as is and let it do whatever it wants.
2. Now you have Anime, TV Shows and Movies folders.
3. TV Shows and Movies folders are added to Plex/Kodi (but Anime is not)
4. Now you have TV Shows and Movies nicely in your Plex/Kodi library (except for Anime which are completely ignored at this point)
5. Whenever you have time check your Anime folder and use FileBot GUI to match files with TheTVDB, set your seriesFormat as format, and then let it move/rename files from the (absolute) Anime path to the (season/episode) TV Shows path.
6. Now Anime is empty, and TV Shows contains your "Anime" and "TV Shows" with standard TheTVDB naming and it'll show up nicely in your library

Thank you, I will try this tonight. Thanks for all your help! :)
vballrican
Donor
Posts: 80
Joined: 21 Dec 2014, 01:29

Re: Anime and the AMC Script

Post by vballrican »

Ok, so i used the normal amc script as is except i added ut_label=TV to it like this:

Code: Select all

filebot -script fn:amc --output "N:/Media" --log-file amc.log --action move -non-strict "N:/Process" --def excludeList=amc.txt artwork=y ut_label=TV
It processes my files and renames them according to theTVDB :), moves the folder/files into TV Shows, and downloads the artwork! :)

Everything is almost perfect, except for I also want to rename the folder to foldername [certification, genre, year] like Gatchaman Crowds [TV-G, Action, 2013] done by the GUI. What do i add to the above script to make it rename the folder accordingly?

Thanks.
User avatar
rednoah
The Source
Posts: 23050
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Anime and the AMC Script

Post by rednoah »

If you pass --def seriesFormat then you define the output path (which includes the parent folder names).
:idea: Please read the FAQ and How to Request Help.
vballrican
Donor
Posts: 80
Joined: 21 Dec 2014, 01:29

Re: Anime and the AMC Script

Post by vballrican »

Ok. I did that and lost the file rename... :| arrgghhh!! *pulling my hair*..
User avatar
rednoah
The Source
Posts: 23050
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Anime and the AMC Script

Post by rednoah »

If you use a format like this, why would you expect the filename to change?

Code: Select all

Anime/{n} [{certification}, {genre}, {y}]/Season {s}/{fn}
You are renaming files, exactly as specified by your format:

Code: Select all

{fn} ... current filename
{n} - {s00e00} - {t} ... Series Name - S00E00 - Episode Title
Use the FileBot Format Editor in the GUI and play with it. It's really not that hard.
:idea: Please read the FAQ and How to Request Help.
Post Reply