Be notified of new comments on this post with the RSS feed for this post.
Hi, your script is great and works brilliantly most of the time, however I have noticed that the script seems to break when the new episode name has a question mark (or one of those of the characters that windows won't allow in a file name). Would it be easy to add a couple of lines to your script to just ignore question marks?
Chris: Just edit line 69, ( config['valid_filename_chars'] ) and remove the question-mark character.
Bodaniel: Indeed, we do seem to have similar plans. The moovy application seems interesting - with consistently named files it shouldn't be difficult at all to write a web-interface to organise files, allow it to add new files from a "completed downloads/rips" directory, warn of missing files and such... moovy seems like a good starting point for this, but I have never gotten into Ruby/Rails, although I am reconsidering it with the (somewhat absurd) number of interesting modules/projects that have sprung up around ruby..
Great script!
It did exactly what I wanted it to do.
Thank you for your effort.
Can't get it to work properly on Windows:
F:\Media\TV\Smallville - 8x05 - Committed>tvnamer smallville.s08e05.720p.hdtv.x2
64-ctu.mkv
####################
# Starting tvnamer
# Processing 1 files
# ..got tvdb mirrors
# Starting to process files
####################
# Processing smallville (season: 8, episode 5)
TVDB Search Results:
Traceback (most recent call last):
File "d:\program files (x86)\python26\scripts\tvnamer-script.py", line 8, in <module> load_entry_point('tvnamer==0.5.1', 'console_scripts', 'tvnamer')()
File "build\bdist.win32\egg\tvnamer.py", line 337, in main
File "build\bdist.win32\egg\tvnamer.py", line 183, in processFile
File "build\bdist.win32\egg\tvdb_api.py", line 492, in __getitem__
File "build\bdist.win32\egg\tvdb_api.py", line 477, in _nameToSid
File "build\bdist.win32\egg\tvdb_api.py", line 395, in _getSeries
File "build\bdist.win32\egg\tvdb_ui.py", line 59, in selectSeries
File "build\bdist.win32\egg\tvdb_ui.py", line 55, in _displaySeries
TypeError: encode() takes at most 2 arguments (3 given)
F:\Media\TV\Smallville - 8x05 - Committed>
Could this be extended to move files within a directory structure aswell?
For example something like:
'/home/media/videos/TV/%(seriesname)s/Season-%(epno)02d/%(seriesname)s-E(epno)02d.%(ext)s'
So it would move it to the correct folder as well as renaming the file?
I use the command line in Linux allot and as such spaces in my file names are a bit of a pain, as such I added this to your script to allow it to strip spaces from the file names and replace them with underscores.
Thought you might be interested in including it.
-c and --clean where used mostly because the other letters were already used.
224,228d223
< # Replace spaces with uderscores
< if opts.cleanspace:
< newname = newname.replace(" ","_")
< #end if cleanspace;
<
312,314d306
< parser.add_option( "-c", "--clean", action="store_true", default=False, dest="cleanspace",
< help="Clean spaces. replace with underscores")
<
Dude this script is awesome!
Exactly what I was going to do myself, and now, thanks to you, I got additional freetime :)
Thank you very much! :)
Since it's been almost a year since this was released, and it haven't been updated with an auto-move feature, I made it myself: Download
Just run tvnamer file -m and it will rename and move the file to the location specified in the top of tvnamer.py
For example if you set the target directory to /TV-Shows/ and run tvnamer House.S05E13.hdtv.random.crap.avi -m the script will create a new folder called House in /TV-Shows/ (if it doesn't already exist) and a subfolder called Season 5(also if it doesn't exist). Then move the file to /TV-Shows/House/Season 5/
Remember to edit tvnamer.py before you run the script.
I have also made some changes to the name format, so it's compatible with XBMC.
I searched and searched for something like this, to fit within my workflow.
While it works flawlessly when I do individual files, when I try and apply it to a folder, I get this error - not sure what to do.
File "/usr/local/bin/tvnamer", line 338, in <module>
main()
File "/usr/local/bin/tvnamer", line 332, in main
print "# Processing %(file_seriesname)s (season: %(seasno)d, episode %(epno)d)" % (cfile)
TypeError: format requires a mapping
Help!
THANK YOU
Works very well on Snow Leopard--thank you!
Just a note to say a) thanks! and b) it might be useful to OSX users if the script ignored filenames that begin with '._'
It's only really an issue on non-hfs volumes (I have most of my video on a SMB mounted drobo) but it's pretty irritating when the random resource fork file (the ._show.s02e04.random.avi) gets renamed and the ACTUAL file gets skipped due to duplicate filename!
How difficult would it be to change the formatting?
I like [Show].s??e??.[Episode].avi. It also integrates great in XBMC.
Ignore that :).
Although one suggestion. Is there anyway you could move the config to a .tvrenamer file in our home directory that way when we do an update we don't have to fix it manually each time? Thanks.
Hi everybody.
This script is awesome!
I have only a question. I'm Italian, so I would like to have episodes names in Italian.
In thetvdb.com there are also in italian. So I need only to change language ID from english to Italian.
Where can I do this in the script if it's possible? Thanks a lot
Please reply to me also by email if you want. Thanks Bye Carlo
Thank you for a great script. It would be great if it could do something similar for movies. Thanks in advance.
-A-
Hi
I've noticed your building Tvnamer 2.0 with config files
Firstly I'd like to say a big thanks for looking into wishes of the users above.
Secondly are you intrested in testers for this.
I would be glad to help out with testing
I am very interessted in getting the move script working. I have tested the autoPathTv script, but I am not using the same naming standard and I am unable to understand how to change from [01x23] to S01E23 or get the tvnamer.move.mod part of the script.
Anyone interested in a GUI application for this kind of job?
Check it out: http://filebot.sourceforge.net
So ... that's why there are so many dead torrents out there ... because of idiots like you who can't bear a file name which does not "look nice" and rename their files, breaking the torrents. I suppose you also move the files in a safe place before renaming, and deleting the torrents. God forbid to continue seeding. Idiot.
You can use a restricted version of markdown formatting here. You can use the toolbar above the text field to make this more painless. For more information about markdown please refer to the markdown cheatsheet.
Saw you watched my moovy project on github. Seems we have the same ideas in mind! I discovered tvdb last night and was going to write pretty much exactly what you've done in ruby to rename all my tv shows.
I don't actually store or watch my tv shows off my mac and instead sit on a 2TB vista file server / htpc. Was playing around with making a rails app to run of the HTPC which provided a nice listing of all my tv shows -- displaying banners, episode summaries/ratings and try to find a way to make it also a controller for media center or a vlc instance to stream it....
I"ll be watching your stuff on github. looks awesome. too bad i don't speak python :S