Does anybody know of an efficient way to automate the renaming of anime files? Preferably changing the absolute number to the season episode format using data from the tvdb.
For example: [HorribleSubs] Naruto Shippuuden - 197 [720p].mkv should be renamed to Naruto Shippuuden S10E01.
I tried using this script: http://forums.sabnzbd.org/index.php?topic=1477.0 However, it keeps giving me the error that the requested show does not have absolute number when it clearly does. Unfortunately, I have very limited knowledge of php scripting.
Any help or suggestions are appreciated.
Anime Renaming? (Absolute to Season Format)
Anime Renaming? (Absolute to Season Format)
Last edited by Plexi on February 13th, 2011, 3:42 pm, edited 1 time in total.
-
- Newbie
- Posts: 26
- Joined: February 17th, 2011, 6:40 pm
Re: Anime Renaming? (Absolute to Season Format)
Hi there. I updated the original script and it appears to work. I tried it on one file and it worked. I suggest trying it on one file to see if it works.
http://pastebin.com/XsXt0j6a
Props to the original author
EDIT: I tried on my Bleach collection and it worked as the orig author described. Oh yea!
http://pastebin.com/XsXt0j6a
Props to the original author
EDIT: I tried on my Bleach collection and it worked as the orig author described. Oh yea!
Code: Select all
bleach.229.avi
Show name: bleach 229
Possible season number:
Episode number: 229
Clean Show Name: bleach
TheTVDB Series Name: Bleach
TheTVDB Series ID: 74796
TheTVDB Series Season: 12
TheTVDB Series Episode: 17
SUCCESS, Renamed from TV Shows/bleach/bleach.229.avi to TV Shows/bleach/bleach.229.S12E17.avi
Last edited by squareatom on February 17th, 2011, 6:54 pm, edited 1 time in total.
Re: Anime Renaming? (Absolute to Season Format)
I works perfectly. Glad you were able to fix the original script. Thank you for all your help.
Re: Anime Renaming? (Absolute to Season Format)
The script has a bug with anime episodes that are starting with a zero like episode 01,02...09.
I've changed the function that check episode number to remove the 0 and it fixed the problem.
Here the changes :
I've changed the function that check episode number to remove the 0 and it fixed the problem.
Here the changes :
Code: Select all
function get_episode_number($input) {
if (preg_match('/' . '(E|e)([0-9]+)' . '/', $input, $episodenumber) > 0) {
$episodenumber = array('del' => $episodenumber[0], 'res' => $episodenumber[2]);
// fda change <--start
if ($episodearray['res'][0] == '0')
$episodenumber['res'] = substr($episodenumber['res'], 1);
// fda changes end-->
return $episodenumber;
} else {
preg_match_all('/' . '[0-9]+' . '/', $input, $matches);
//Kijk voor alle episodes
$matches = $matches[0];
for ($i=0; $i < count($matches); $i++) {
$lastnum = $matches[$i];
}
$lastnum = array('del' => $lastnum, 'res' => $lastnum);
// fda change <--start
if ($lastnum['res'][0] == '0')
$lastnum['res'] = substr($lastnum['res'], 1);
// fda changes end-->
return $lastnum;
}
}
-
- Newbie
- Posts: 26
- Joined: February 17th, 2011, 6:40 pm
Re: Anime Renaming? (Absolute to Season Format)
Sweet. Post the whole thing on pastebin if you could and up the version. :-)
Re: Anime Renaming? (Absolute to Season Format)
Here my version that include the fix for the episodes that start with a 0 :
http://pastebin.com/HYSLBEu2
http://pastebin.com/HYSLBEu2
Re: Anime Renaming? (Absolute to Season Format)
After years of manually renaming files and using various renaming programs, I have found one that has a very high success rate. Specials can be problematic and some times I have to process twice - initally through TVrage or AniDB before processing through TVDB. I use YAMJ with PopcornHour so I need my files exactly in sync with TVDB. The program is called FileBot and is available here: http://filebot.sourceforge.net/
You can install it or run it via java on the web.
Info: FileBot is the ultimate tool for renaming your tv shows and anime, downloading subtitles from various sources or just simple file verification.
Rename hundreds of media files in a matter of seconds
Fetch episode lists from TVRage, AniDB, TV.com, IMDb or TheTVDB
Highly accurate file / episode matching Series / Anime name auto-detection
Powerful and highly customizable episode naming scheme
I have not tried the scripts referenced in this thread but this is simple to use on any OS running Java.
WF
You can install it or run it via java on the web.
Info: FileBot is the ultimate tool for renaming your tv shows and anime, downloading subtitles from various sources or just simple file verification.
Rename hundreds of media files in a matter of seconds
Fetch episode lists from TVRage, AniDB, TV.com, IMDb or TheTVDB
Highly accurate file / episode matching Series / Anime name auto-detection
Powerful and highly customizable episode naming scheme
I have not tried the scripts referenced in this thread but this is simple to use on any OS running Java.
WF
Re: Anime Renaming? (Absolute to Season Format)
Could someone please help me set this script up to work with my sab im running windows 7 64bit i am completely lost
-
- Newbie
- Posts: 26
- Joined: January 22nd, 2008, 1:14 am
- Location: Chigau! Orewa Chigau!
Re: Anime Renaming? (Absolute to Season Format)
wingfat wrote: After years of manually renaming files and using various renaming programs, I have found one that has a very high success rate. Specials can be problematic and some times I have to process twice - initally through TVrage or AniDB before processing through TVDB. I use YAMJ with PopcornHour so I need my files exactly in sync with TVDB. The program is called FileBot and is available here: http://filebot.sourceforge.net/
You can install it or run it via java on the web.
Info: FileBot is the ultimate tool for renaming your tv shows and anime, downloading subtitles from various sources or just simple file verification.
Rename hundreds of media files in a matter of seconds
Fetch episode lists from TVRage, AniDB, TV.com, IMDb or TheTVDB
Highly accurate file / episode matching Series / Anime name auto-detection
Powerful and highly customizable episode naming scheme
I have not tried the scripts referenced in this thread but this is simple to use on any OS running Java.
WF
Thanks for this, it's an awesome program! I used to use TVRename, but apparently this one is much more robust! I still use TV Rename for fine-tuning the names, but what used to take me am million years now happens in just seconds, so thanks!
Re: Anime Renaming? (Absolute to Season Format)
how can i get this work with sab as soon as the dowmoald is complete