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

Problem with Umlauts #4

Closed felixtriller closed 14 years ago

felixtriller commented 14 years ago

tvnamer is unable to scan my TV episodes containing umlauts in the filename.

Example output for: Der gefährlichste Job Alaskas S01E02 - Schlaflose Nächte

ShowNotFound(u'Show Der gefa\u0308hrlichste Job Alaskas not found on www.thetvdb.com',)

dbr commented 14 years ago

Weird, not sure why this is failing.. Shall look into this later (I've added a currently-failing test, to remind me..)

felixtriller commented 14 years ago

More output:

$ tvnamer Der\ gefährlichste\ Job\ Alaskas\ -\ \[01x02\]\ -\ Schlaflose\ Nächte.avi 
####################
# Starting tvnamer
# Found 1 episodes
####################
Traceback (most recent call last):
  File "/usr/bin/tvnamer", line 9, in 
    load_entry_point('tvnamer==2.0', 'console_scripts', 'tvnamer')()
  File "/usr/lib/python2.5/site-packages/tvnamer-2.0-py2.5.egg/tvnamer/main.py", line 236, in main
    tvnamer(paths = sorted(args))
  File "/usr/lib/python2.5/site-packages/tvnamer-2.0-py2.5.egg/tvnamer/main.py", line 155, in tvnamer
    processFile(tvdb_instance, episode)
  File "/usr/lib/python2.5/site-packages/tvnamer-2.0-py2.5.egg/tvnamer/main.py", line 28, in processFile
    print "# Processing file: %s" % episode.fullfilename
  File "/usr/lib/python2.5/site-packages/tvnamer-2.0-py2.5.egg/tvnamer/utils.py", line 390, in fullfilename
    return u"%s.%s" % (self.filename, self.extension)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 7: ordinal not in range(128)
dbr commented 14 years ago

Hmm, are you using the latest version of tvnamer? The traceback looks like it's from an older version (and is likely caused by that print statement, which I've replaced entirely with a p() function which handles unicode better)

dbr commented 14 years ago

There's something odd with either tvdb_api or thetvdb.com's search API.. For now, you can replace ä with a using the custom replacements feature (or do this manually)

Made a ticket for this on the Lighthouse project:

http://dbr.lighthouseapp.com/projects/36049/tickets/55-show-der-gefhrlichste-job-alaskas-failing-search