Bugfix by viperidae
Reference:
---------------
Reference: https://sickrage.tv/forums/forum/help-support/bug-issue-reports/6224-there-was-an-error-with-the-xml-retrieved-from-tvrage-com
Quote:
----------
Had a look at the code and the xml documents...
It looks like the problem is caused by an empty <genre /> element in Results/shows/show/genres/
Line 459 of tvrage_api.py (it's 460 in my track in the previous post because of the debug statements I put in)
I assume it's because value is NoneType, gets replaced by a [NoneType] list and then tries to call '|'.join([NoneType]) when it was expecting a list of strings.
I changed this to the following and the problem appears to be resolved
Syslog extract:
----------------------
tvrage_error: There was an error with the XML retrieved from tvrage.com
First try emptying the cache folder at..
C:\Users\Josh\Documents\Programs\SickRage\cache\indexers\TVRage
If this does not resolve the issue, please try again later. If the error persists, report a bug on
2014-08-09 00:43:25 INFO SEARCHQUEUE-BACKLOG-74608 :: [NMatrix] :: Searching for episodes we need from Top Gear Season 21
2014-08-09 00:43:25 DB SEARCHQUEUE-BACKLOG-74608 :: [NMatrix] :: cache.db: SELECT * FROM [nmatrix] WHERE indexerid = ? AND season = ? AND episodes LIKE ? with args [74608, 21, '%|2|%']
2014-08-09 00:43:25 DB SEARCHQUEUE-BACKLOG-74608 :: [NMatrix] :: cache.db: UPDATE lastSearch SET time = ? WHERE provider = ? with args [1407559405, 'nmatrix']
2014-08-09 00:43:25 DB SEARCHQUEUE-BACKLOG-74608 :: [NMatrix] :: cache.db: INSERT INTO lastSearch (time, provider) VALUES (?, ?) with args [1407559405, 'nmatrix']
2014-08-09 00:43:25 DB SEARCHQUEUE-BACKLOG-74608 :: [NMatrix] :: sickbeard.db: SELECT * FROM indexer_mapping WHERE indexer_id = ? AND indexer = ? with args [74608, 1]
2014-08-09 00:43:25 ERROR SEARCHQUEUE-BACKLOG-74608 :: [NMatrix] :: Error while searching NMatrix, skipping: There was an error with the XML retrieved from tvrage.com
First try emptying the cache folder at..
C:\Users\Josh\Documents\Programs\SickRage\cache\indexers\TVRage
If this does not resolve the issue, please try again later. If the error persists, report a bug on
2014-08-09 00:43:25 DEBUG SEARCHQUEUE-BACKLOG-74608 :: [NMatrix] :: Traceback (most recent call last):
File "C:\Users\Josh\Documents\Programs\SickRage\sickbeard\search.py", line 428, in searchProviders
searchResults = curProvider.findSearchResults(show, season, episodes, search_mode, manualSearch)
File "C:\Users\Josh\Documents\Programs\SickRage\sickbeard\providers\generic.py", line 264, in findSearchResults
for curString in self._get_episode_search_strings(epObj):
File "C:\Users\Josh\Documents\Programs\SickRage\sickbeard\providers\newznab.py", line 133, in _get_episode_search_strings
rid = helpers.mapIndexersToShow(ep_obj.show)[2]
File "C:\Users\Josh\Documents\Programs\SickRage\sickbeard\helpers.py", line 1178, in mapIndexersToShow
mapped_show = t[showObj.name]
File "C:\Users\Josh\Documents\Programs\SickRage\lib\tvrage_api\tvrage_api.py", line 675, in __getitem__
selected_series = self._getSeries(key)
File "C:\Users\Josh\Documents\Programs\SickRage\lib\tvrage_api\tvrage_api.py", line 566, in _getSeries
allSeries = self.search(series)
File "C:\Users\Josh\Documents\Programs\SickRage\lib\tvrage_api\tvrage_api.py", line 557, in search
seriesEt = self._getetsrc(self.config['url_getSeries'], self.config['params_getSeries'])
File "C:\Users\Josh\Documents\Programs\SickRage\lib\tvrage_api\tvrage_api.py", line 500, in _getetsrc
raise tvrage_error(errormsg)
Fixed issues with indexerApi caching code, seemed TVRage was really the only one experiancing the problems but has been corrected for theTVDB just in case.
Git updates are now forced to overwrite locale changes to avoid needing to manually stash uncommited changes before being able to proceed with a update.
Fixed indexer mapping when unable to locate show on indexer that we are trying to map to.
Provider getURL and downloadResult functions now removed and replaced with ones from helpers.py to help slim the code down plus allow more better control over request sessions.
Removed TVTumbler code.
Fixed HDBits provider.
Fixed config settings that were ment to be booleans but instead where set as str or int, should help resolve random html errors.
XEM Refresh check re-coded.
NameParser code for creating show object has been changed to only attempt at the very end once its found the bestMatch result, helps on resources and performance.
Indexer mapping now uses indexer api calls to gather its information and then stores it to a new table called indexer_mapping for instant lookups later on.
Fixed trakt related issues for adding new shows and syncing.
Centered items at bottom of pages to just look a little nicer and fit properly.
Fixed unicode issues with Indexer API's
Fixed issues with scene numbering.
Fixed issues with black and white lists for anime shows when editing a show.
Fixed invalid indexer id issues for TVRage shows.
Fixed issues for getting posters and backdrops for TVRage shows.
We now convert XML straight to a dict object for Indexer APIs, improved overall performance api's
Fixed issues with TVRage shows and displaying genre's properly.
Added session handler to our cache handler so that we can pass in paramaters at the request level and use them for our cache handler to process features.
Fixed bug in metadata function that was throwing attribute errors when checking for banner images for shows from TVRage
Converted some list comprehensions to generators to improve speed and lower memory usage of SB
Re-write of New Show seearch function
Re-write of Existing show search helper function for determining indexer/indexerid
Massive code cleanup and more bugs found and fixed
Indexer code fully modualized for future proofing
Switched out urllib2 HTTP Handler for requests HTTP Handler in main getURL function in helpers module.
Fixed date parsing for sports in NameParser module.
Misc fixes and improvements throughout the code.
This version of SickBeard uses both TVDB and TVRage to search and gather it's series data from allowing you to now have access to and download shows that you couldn't before because of being locked into only what TheTVDB had to offer.
Also this edition is based off the code we used in our XEM editon so it does come with scene numbering support as well as all the other features our XEM edition has to offer.
Please before using this with your existing database (sickbeard.db) please make a backup copy of it and delete any other database files such as cache.db and failed.db if present, we HIGHLY recommend starting out with no database files at all to make this a fresh start but the choice is at your own risk!
Enjoy!