Bug when season has non-numeric episode numbers?
Reported by pulsar | May 25th, 2009 @ 02:51 AM
I get the following output when trying to rename "Family.Guy.S06E03.PDTV.XviD-XOR.avi".
####################
# Starting tvnamer
# Processing 1 files
# ..got tvdb mirrors
# Starting to process files
####################
# Processing Family Guy (season: 6, episode 3)
TVDB Search Results:
1 -> Family Guy # http://thetvdb.com/?tab=series&id=75978
Automatically selecting only result
Traceback (most recent call last):
File "/opt/local/bin/tvnamer", line 339, in <module>
main()
File "/opt/local/bin/tvnamer", line 334, in main
processFile(t, opts, cfile)
File "/opt/local/bin/tvnamer", line 185, in processFile
epname = t[ cfile['file_seriesname'] ][ cfile['seasno'] ][ cfile['epno'] ]['episodename']
File "/opt/local/tvnamer/tvdb_api.py", line 661, in __getitem__
sid = self._nameToSid(key)
File "/opt/local/tvnamer/tvdb_api.py", line 645, in _nameToSid
self._getShowData(sid)
File "/opt/local/tvnamer/tvdb_api.py", line 613, in _getShowData
epsEt = self._getetsrc( self.config['url_epInfo'] % (sid) )
File "/opt/local/tvnamer/tvdb_api.py", line 397, in _getetsrc
et = ElementTree.fromstring(src)
File "<string>", line 86, in XML
SyntaxError: no element found: line 4033, column 0
Since the error occurs in the tvdb_api file, my guess is, that it has something to do with the non-numeric episode listed on http://thetvdb.com/?tab=series&id=75978 -- Could that be the case?
Comments and changes to this ticket
-
dbr/Ben May 26th, 2009 @ 01:06 AM
- → State changed from new to open
The error was most likely a temporary problem with thetvdb.com - I created a blank file with that name and everything worked correctly a few seconds ago.
If the problem still occurs, it is because the API response was cached.
Run tvnamer with the
-ddebug flag on:tvnamer -d Family.Guy.S06E03.PDTV.XviD-XOR.aviIn the debug output, you should see a line like..
DEBUG URL http://www.thetvdb.com/api/0629B785CE550C8D/series/75978/all/en.xml was cached in /your/tmp/folder/tvdb_api/9082835d9b573fad6f2ab276444764fb.bodyIf you delete that
.bodyfile (and the corresponding.headersfile) it should resolve the problem.If not, could you paste the debug output here?
-

pulsar May 26th, 2009 @ 01:17 AM
Thanks for your quick reply! You're right, it seems to have been a temporary problem, since it works now (under same circumstances).
Sorry for all the commotion. :)
PS: Maybe we can derive a feature request from this: Better/more error/sanity checks? :)
-
dbr/Ben July 20th, 2009 @ 08:57 PM
- → State changed from open to resolved
-
dbr/Ben August 7th, 2009 @ 12:37 AM
- → State changed from resolved to accepted
Added better error handling for invalid XML..
On invalid XML, it will re-request the XML (invalidating the cache). If the XML is still broken, it will give a more useful error message, including a "remove the cache files in /tmp/the/tvdbapi_cache_dir/" line, and a link to the Lighthouse project
-
dbr/Ben August 7th, 2009 @ 12:44 AM
- → State changed from accepted to resolved
(from [59a27232a7c1ce1c08b75f74fd8defdf2dbb44a1]) If invalid XML is retrived from thetvdb.com re-request (and re-cache) the XML and parse it again. If it fails, display a more useful error message [#60 state:resolved] [#46 state:resolved] http://github.com/dbr/tvdb_api/commit/59a27232a7c1ce1c08b75f74fd8de...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
