Alt.Binz forum
New Alt.Binz versions => Requests => Topic started by: nwpsys on March 25, 2009, 01:18:37 pm
-
Would it be possible to get an option to rename the UNRAR'd file to match that of the NZB / release ?
EG The NZB/release is Nice.TV.Show.S01E01, the unrar'd file is nice.tv.show.s01e01.avi, it would be great if it could be auto-renamed to Nice.TV.Show.S01E01.avi.
Thanks,
nwpsys
-
Does WinRar support renaming extracted files. I mean: is it normal to change the files which are extracted? As far as I know AltBinz uses an external program to unrar the files and I don't if you are able to change that process.
-
I see what you are saying, but if control was returned to altbinz after the external unrar, then it could be free to do whatever it wanted with the extracted filename.
nwpsys
-
+1 this would be really nice for dvdrips etc, since the files are usually named something like "grp-movieinitials.avi."
-
Renaming after the collection name would make more sence coz' you'd have complete control how the file is renamed. An elaborate renaming pattern like the TV-Sorting in sabnzbd would be awesome but with the newly introduce "$col" variable i guess you should be able to do the renaming after the collection with a bat-file...
-
I see what you are saying, but if control was returned to altbinz after the external unrar, then it could be free to do whatever it wanted with the extracted filename.
nwpsys
file name...but the rar-file could contain tens of files with different file names and extensions. Which to rename?
-
that's true renaming multiple unrar'd files from the same rar-set would be a bit more tricky... maybe have the bat-file delete possible nfo's beforehand or exclude them from renaming. If there are still multiple files left after that they might be named "collection-name","collection-name"-1, "collection-name"-2 ect.
-
file name...but the rar-file could contain tens of files with different file names and extensions. Which to rename?
Ah ha - I understand. My usage of altbinz is downloading RAR sets that only ever contain one file.
So I suppose the logic could be "if only one file has been unrar'd then rename it to match the release if the option has been selected, otherwise do nothing".
nwpsys
-
my 2 bits:
renaming files is evil !!!!!!!
;D
-
I wrote a small python script which should only act if the collection is either named Show.Name.S01E13.Episode.Title.HDTV.XviD-LOL or Show_Name.1x13.Episode_Title.HDTV_XviD-FoV
Then the script will only rename the avi-file if it matches the file with the season number and episode number from the collection name.
And in addition files in the format "Show_Name.1x13.Episode_Title.HDTV_XviD-FoV" will be replaced with "Show.Name.S01E13.Episode.Title.HDTV.XviD-FoV" to get a more consistent naming system :) .
Create subfolders based on NZB name should be activated with this script.
"C:\Users\...\AppData\Local\Alt.Binz\rename.pyw" $u $col
import os,sys,re
if len(sys.argv) != 3:
sys.exit()
unrardir = sys.argv[1]
collection = sys.argv[2]
regexp1 = re.compile(".*\.s(\d+)e(\d+)\..*",re.IGNORECASE)
regexp2 = re.compile(".*\.(\d+)x(\d+)\..*",re.IGNORECASE)
result = regexp1.match(collection)
if result == None:
result = regexp2.match(collection)
if result == None:
sys.exit()
season = result.group(1)
episode = result.group(2)
collection = re.sub("_",".",collection)
pattern = "\.%sx%s\."%(season,episode)
replacement = ".S%02iE%s."%(int(season),episode)
collection = re.sub(pattern,replacement,collection)
season = season.lstrip("0")
else:
season = result.group(1).lstrip("0")
episode = result.group(2)
matchexp = ".*s?0?%sx?e?%s.*\.avi"%(season,episode)
regexp3 = re.compile(matchexp,re.IGNORECASE)
files = os.listdir(unrardir)
for file in files:
result = regexp3.match(file)
if result != None:
os.rename(os.path.join(unrardir, file),os.path.join(unrardir, "%s.avi"%collection))
sys.exit()
-
And in addition files in the format "Show_Name.1x13.Episode_Title.HDTV_XviD-FoV" will be replaced with "Show.Name.S01E13.Episode.Title.HDTV.XviD-FoV" to get a more consistent naming system :) .
...and I am forced to repeat: Renaming files is evil!
P2P is filled with renamed files (and several non abmm/altbin posts too). Why do it?
Keep the filenames as they are. That's ''consistent''. Renaming them isn't ''consistent''.
-
renaming makes perfect sense for archiving if 1x01 s01e02 and 103 names are mixed the correct order gets lost
-
sorting order is a minor inconvenience.
EDIT: just so I don't come in as too 'mean' or 'cruel'....
Renaming files is evil (Yes, I insist!)
But if the renamed files never get 'shared' _EVER_ and you're the only one that will ever see those renamed files, it's fine.
If there's any future sharing of those files (either over the internet, or locally via snickernet*) then they should have never been renamed in the first place; sorting order be damned.
*snickernet: involves wearing snickers, then 'walking' to your buddy's house with your portable HDD at hand and leeching the hell out of their archive.
-
sorting order is a minor inconvenience.
yeah it is minor, but if your using a mobile player that determins the playlist by alphabetical order it's pretty annoying if the episode 7 suddenly appears between 2 and 3...
-
I wrote a small python script which should only act if the collection is either named Show.Name.S01E13.Episode.Title.HDTV.XviD-LOL or Show_Name.1x13.Episode_Title.HDTV_XviD-FoV
Thanks, moepmoep, I will give that a try.
As for renaming files, it is personal choice. If I am collecting 720p TV shows from DIMENSION and CTU, then I get a mix of cases when unrar'd, which I choose to modify.
nwpsys
-
I'm going to butt in and be doubly rude by saying that I like the sound of how sabnzbd does it (afaik). Basically it gets info such as season/ep from the nzb name and can automatically create a customized hierarchy of destination folders. Not sure if it does file renaming as well, but the principle is basically the same. Personally I'd only need folders rather than file renaming, but to each his own. ;)
Details of the sab way:
http://sabnzbd.wikidot.com/folder-sorting
http://sabnzbd.wikidot.com/configure-sorting
-
Apologies for bumping an old topic
Given that almost every unrar'd media file is named something like 'b1QcqGYzsrXWxhxT0CbYZ7WcoEuAK2geBYb' is it possible to revisit this feature?
Would be great to have an option to rename the extracted file the same as the release name
-
Yes, I too would also appreciate this feature - given that so many .mkv files are obfuscated before they are rar'ed - if there was an option to unrar and then rename based on the nzb name, this would be extremely handy, and save me having to manually copy and paste the directory name over the top of the obfuscated name of the .mkv file. Please add my name to this list for this request please. Thanks in advance.
-
Done, but more flexibility will be added.
-
Thank you very much for adding these features! :D
I also look forward to seeing the additional flexibility once that is coded.