dbr / tvnamer

Automatic TV episode file renamer, uses data from thetvdb.com via tvdb_api
https://pypi.python.org/pypi/tvnamer/
The Unlicense
912 stars 115 forks source link

Hawaii.Five-0.2010.S03E19.HDTV.x264-LOL.mp4 is not recognized? #75

Closed kngspook closed 11 years ago

kngspook commented 11 years ago

So I'm having a weird parse error:

####################
# Starting tvnamer
# Found 5 episodes
####################
# Processing file: Castle.2009.S05E18.HDTV.x264-LOL.mp4
# Detected series: Castle 2009 (season: 5, episode: 18)
####################
Old filename: Castle.2009.S05E18.HDTV.x264-LOL.mp4
New filename: Castle (2009) - [05x18] - The Wild Rover.mp4
New path: /Users/neil/Downloads/Castle (2009) - [05x18] - The Wild Rover.mp4
Creating directory /Users/neil/Downloads
rename /Users/neil/Downloads/Castle.2009.S05E18.HDTV.x264-LOL.mp4 to /Users/neil/Downloads/Castle (2009) - [05x18] - The Wild Rover.mp4

####################
# Processing file: Dallas.2012.S02E10.HDTV.x264-LOL.mp4
# Detected series: Dallas 2012 (season: 2, episode: 10)
####################
Old filename: Dallas.2012.S02E10.HDTV.x264-LOL.mp4
New filename: Dallas (2012) - [02x10] - Guilt & Innocence.mp4
New path: /Users/neil/Downloads/Dallas (2012) - [02x10] - Guilt & Innocence.mp4
Creating directory /Users/neil/Downloads
rename /Users/neil/Downloads/Dallas.2012.S02E10.HDTV.x264-LOL.mp4 to /Users/neil/Downloads/Dallas (2012) - [02x10] - Guilt & Innocence.mp4

####################
# Processing file: Hawaii.Five-0.2010.S03E19.HDTV.x264-LOL.mp4
# Detected series: Hawaii Five-0.2010 (season: 3, episode: 19)
Skipping file due to error: Show Hawaii Five-0.2010 not found on www.thetvdb.com

####################

I took a quick glance at the config_defaults and the regexes therein, and didn't find one that obviously applies to any of these filenames, so I can only speculate, but I'm guessing it's maybe because "Hawaii Five-0" is two words instead of one?

A call to tvnamer-2.6 -n "Hawaii Five-0" Hawaii.Five-0.2010.S03E19.HDTV.x264-LOL.mp4 seems to do the trick, naturally.

dbr commented 11 years ago

There is some additional processing to preserve numbers in series names (e.g "Jake 2.0"), because thetvdb cannot find series without the decimal point ("jake 2.0" finds the series, but "jake 2 0" has no results)

Unfortunately that file name is ambiguous with this, as it thinks the 0.2010" is a number it should preserve..

I think the series name cleanup can be improved (so there has to be a space before a decimal number)

For now, you could use the custom-replacements feature, to clean up the series name (replace Hawii.Five-0.2010 with Hawii Five-0 or similar)

I'd post an example config, but am not near a proper computer current Y.. Check the 'tests' directory in the code for examples.

dbr commented 11 years ago

I can't think of a simple way to clean the matched series names in a way that handles both cases.. Ideally thetvdb's search would find the series based on Hawaii Five-0.2010 (by ignoring punctuation), but for now the replacements will fix this

thezoggy commented 11 years ago

in sickbeard we use the cleanRegexedSeriesName function, I noticed that midget has a line added that you dont. wonder if this would help solve your problem.

add this line: seriesname = re.sub("(\d)\.(\d{4})", "\\1 \\2", seriesname) # if it ends in a year then don't keep the dot right above seriesname = re.sub("(\D)[.]", "\\1 ", seriesname)