2012-09-25, 15:51
(2012-09-25, 11:15)kerpal2020 Wrote: I applied both fixes, but it only works if my Instant Queue Max Items to Retrieve is set no greater than 100. Do you guys have the same issue? If I set it to 200 or more, it won't retrieve any Movies or TV.
I do have the same issue, and may look into it a little later. If it's something simple I'll try to report back what the fix might be.
Ok, a fairly straightforward fix that I can't really burn test all the way because my entire queue only has 150 items in it.
But, you just need to set the timeout higher on the request to Netflix. It's in Netflix.py:
find the class definition for NetflixClient, and add a timeout parameter to __init__: (Around line 725 in Netflix.py)
Code:
class NetflixClient:
def __init__(self, name, key, secret, callback='',verbose=False):
self.connection = httplib.HTTPConnection("%s:%s" % (HOST, PORT))
self.server = HOST
self.verbose = verbose
self.user = None
self.catalog = NetflixCatalog(self)
You want to add a timeout parameter to the self.connection. So,
self.connection = httplib.HTTPConnection("%s:%s" % (HOST, PORT) )
becomes
self.connection = httplib.HTTPConnection("%s:%s" % (HOST, PORT), timeout=30 )
(I used 30 seconds, but you may have to tweak this to give the server enough time to compile your response and send it back to you - larger if you have a large queue (or are willing to wait), you can try 40, 50, 60 seconds or more if you want)
Code:
class NetflixClient:
def __init__(self, name, key, secret, callback='',verbose=False):
self.connection = httplib.HTTPConnection("%s:%s" % (HOST, PORT), timeout=30 )
self.server = HOST
self.verbose = verbose
self.user = None
self.catalog = NetflixCatalog(self)