OMDB API Unstable?
#1
I am playing around with the omdb api and i find that only 1 out of 10 request actually comeback usable. All request status_codes are 200 so i know the url is correct. Has anyone else experienced this as I would like to use the api but I want it be reliable. I have not donated yet, may that be the reason?
Shield TV | Windows 10 | Mariadb | Mii Box
Evolve Ecosystem Repo | TV Melodies | Madnox Holiday Mod
Reply
#2
It's working quite well, but sometimes the server aren't responding correctly. 

As workaround I've placed it in a loop with a timeout of 5s and 3 retries.


for i in range(1,4): # loop if heavy server load
            log('OMDb call try %s/3' % str(i), force=RATING_DEBUG)
            try:
                request = requests.get(url, timeout=5)
                if not str(request.status_code).startswith('5'):
                    break

            except Exception:
                if i < 3:
                    xbmc.sleep(500)
                else:
                    log(error_msg + '408', WARNING)
                    return
Embuary | Skin | Helper | Info | Repo | GitHub
Reply
#3
(2020-01-14, 19:02)sualfred Wrote: It's working quite well, but sometimes the server aren't responding correctly. 

As workaround I've placed it in a loop with a timeout of 5s and 3 retries.


for i in range(1,4): # loop if heavy server load
            log('OMDb call try %s/3' % str(i), force=RATING_DEBUG)
            try:
                request = requests.get(url, timeout=5)
                if not str(request.status_code).startswith('5'):
                    break

            except Exception:
                if i < 3:
                    xbmc.sleep(500)
                else:
                    log(error_msg + '408', WARNING)
                    return
Thanks had not even though about this.
Shield TV | Windows 10 | Mariadb | Mii Box
Evolve Ecosystem Repo | TV Melodies | Madnox Holiday Mod
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
OMDB API Unstable?00