HTTPError 500 and possible bug in urllib2_new.py

Hello Plex lovers!
 
I just started exploring channel development as I want to write a PPTV (Chinese streaming tv) channel plugin and didn't find an existing one but I stumbled a bit on the following problem on plex server 0.9.12.1 on OSX:
 
I got shows listing with metadata, thumbs etc working pretty easily but PPTV kind of obfuscates the final video link. I found some existing code for xbmc that uses another website ('http://www.flvcd.com/parse.php')to get the correct id and links for each video. My problem was that this websites responds with an HTTP error 500 yet still send the correct page content and on the browsers everything was functioning correctly, but through Plex i was only getting error 500 and no page content.
 
I tried to catch the exception and read the error like this:
 

try:
    resp = urllib2.urlopen(url)
    contents = resp.read()
except urllib2.HTTPError, error:
    contents = error.read()

as suggested in many answers i found online but error was only returnin a code and message and read() was not available.
 
So i dug in and found that HTTPErrorProcessor in urllib2 was discarding the response for errors outside 200-300 range and the only way to get the same result as in the browser was to change this bit in urllib2_new.py:
  

class HTTPErrorProcessor(BaseHandler):
    """Process HTTP error responses."""
    handler_order = 1000  # after all other processing

    def http_response(self, request, response):
        code, msg, hdrs = response.code, response.msg, response.info()

        # According to RFC 2616, “2xx” code indicates that the client’s
        # request was successfully received, understood, and accepted.
        if not (200 <= code < 300 or code == 500): ####################### Here I added "or code == 500
            response = self.parent.error(
                ‘http’, request, response, code, msg, hdrs)

        return response

    https_response = http_response

With the change on line 555 I get the correct page response after catching http error 500 exception and i can get the correct video links
 

As i guess this will be overwritten with a Plex Server update, I'd like to know if there is another way to prevent this and I am missing it completely or maybe it's an error in HTTPresponse and error 500 (and others maybe?) should not discard the response.
 
If there is a permanent fix to this then I can release the plugin when it's finished.
 
Thanks in advance, 
 
TheRoboZ