anidb.net hash/rename/move

Come up with a useful post-processing script? Share it here!
Post Reply
Benni-chan
Newbie
Newbie
Posts: 4
Joined: February 22nd, 2011, 3:58 pm

anidb.net hash/rename/move

Post by Benni-chan »

Hi,

I'm writing a little postprocessing script for my anime downloads. The script hashes the downloaded file, retrieves informations from anidb.net and renames the file after a renaming scheme (which is configurable). if wished, the file will then be moved to a target location.

if anyone has interest in this script, i will upload it, as soon as it is finished. (shouldn't take too long.)
Benni-chan
Newbie
Newbie
Posts: 4
Joined: February 22nd, 2011, 3:58 pm

Re: anidb.net hash/rename/move

Post by Benni-chan »

Since I'm using this script for several days now, I think I can release it. It's not complete done yet, but it works. Some part of it is optimized for my UnRaid Server, but should work on any Linux machine (and maybe Windows too. Didn't test it!).

The script will hash your downloaded anime files, check anidb for details and rename and move the files.

So far I only tested the script with TV Shows, not with Movies.

To use the script, extract the zip into your sabnzbd script folder and select sabtoanidb.py as your post processing script in your anime category.
you have to enter your anidb username and password into the config file. also you have to modify the target directory in the config file to tell the script, where your anime folder is. (the script will copy the files to a directory with the name of the anime in that folder.)

you can specify your rename scheme in the config file, too.
there are a lot of tags to use:

Code: Select all

%ATr%: Anime Name (Romaji)
%ATe%: Anime Name (English)
%ATk%: Anime Name (Kanji)
%ATs%: Anime Name (synonyms) (lists all synoyms currently)
%ATo%: Anime Name (other)

%ETr%: Episode title (romaji)
%ETe%: Episode title (english)
%ETk%: Episode title (kanji)

%GTs%: Group Name (short)
%GTl%: Group Name (long)

%EpHiNo%: Highest (subbed) episode number
%EpCount%: Anime Episode count
%AYearBegin%: The beginning year of the anime
%AYearEnd%:  The ending year of the anime
%ACatList%: Category of the Anime

%EpNo%: #File's Episode number

%Type%: Anime type, Value: Movie, TV, OVA, Web
%Depr%: File is deprecated if the value is '1'
%Cen%: File is censored if the value is '1'
%Ver%: File version
%Source%: Where the file came from (HDTV, DTV, WWW, etc)
%Quality%: How good the quality of the file is (Very Good, Good, Eye Cancer)
%AniDBFN%: Default AniDB filename
%CurrentFN%: Current Filename
%FCrc% : The file's crc
%FCRC%: The file's crc in upper letters
%FVideoRes%: Video Resolution (e.g. 1920x1080)
%FALng%: List of available audio languages
%FSLng%: List of available subtitle languages
%FACodec%: Codecs used for the Audiostreams
%FVCodec%: Codecs used for the Videostreams
%suf%: File Suffix
you can download the script here: https://github.com/Benni-chan/SABnzbd-- ... -Anidb.net

PS: I didn't write the complete script myself. A lot of it is based on pyanidb (an older python based anidb client).

PPS: I'm not responsible for any data loss or any other problems you may have from using this scripts.
Last edited by Benni-chan on October 13th, 2012, 1:29 pm, edited 2 times in total.
airtraxx
Newbie
Newbie
Posts: 3
Joined: March 1st, 2011, 9:14 pm

Re: anidb.net hash/rename/move

Post by airtraxx »

Thanks for releasing this.  I'm going to give it a shot.  I definitely can use this script.
squareatom
Newbie
Newbie
Posts: 26
Joined: February 17th, 2011, 6:40 pm

Re: anidb.net hash/rename/move

Post by squareatom »

Hey there is already a perl script that does this... Works if the file is actually on anidb. You just have to watch you don't get banned because the script does not throttle.

https://github.com/clip9/adbren
Benni-chan
Newbie
Newbie
Posts: 4
Joined: February 22nd, 2011, 3:58 pm

Re: anidb.net hash/rename/move

Post by Benni-chan »

yeah, i had trouble getting adbren to run correct. also since sabnzbd uses python, everything needed is already installed (perl may not be already installed)

i'm using my client since march, and so far i didn't run in any big problems.
only trouble is, when a file isn't already on anidb, i have to hash it manually, since there is afaik no way to tell sabnzbd to run the postprocess script again.
saitoh183
Newbie
Newbie
Posts: 8
Joined: September 3rd, 2012, 1:55 am

Re: anidb.net hash/rename/move

Post by saitoh183 »

I know this is a old thread but could someone have a look at this and offer some help?
Benni-chan
Newbie
Newbie
Posts: 4
Joined: February 22nd, 2011, 3:58 pm

Re: anidb.net hash/rename/move

Post by Benni-chan »

hi,
sorry for your trouble with the script.

i currently don't have a windows machine around, but I'll try to help you out. but will take some time to look through the code.
saitoh183
Newbie
Newbie
Posts: 8
Joined: September 3rd, 2012, 1:55 am

Re: anidb.net hash/rename/move

Post by saitoh183 »

Benni-chan wrote:hi,
sorry for your trouble with the script.

i currently don't have a windows machine around, but I'll try to help you out. but will take some time to look through the code.
Thanks :)

There are some commits there that i copied in order to try and get it to work but still no luck
Post Reply