Kodi Community Forum

Full Version: OMDB API Unstable?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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.

python:

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
(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.

python:

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.
Working also quite well on my side. I just mentioned the awards tag isn't updated for plenty of movies since 2018. Some data filled, some not. Before 2018 in almost every case filled.
Also in summer and autumn 2019 the tomatometerallaudience wasn't responding data for a long time on really a lot of movies. But it's all fine again now. In most cases ratings votes are equal to the websites from original source.
I really hope Letterboxd ratings votes will find it's way into OMDB cause the API is out now and Letterboxd is getting from day to day more popular.
(2020-01-31, 23:55)chrissix Wrote: [ -> ]Working also quite well on my side. I just mentioned the awards tag isn't updated for plenty of movies since 2018. Some data filled, some not. Before 2018 in almost every case filled.
Also in summer and autumn 2019 the tomatometerallaudience wasn't responding data for a long time on really a lot of movies. But it's all fine again now. In most cases ratings votes are equal to the websites from original source.
I really hope Letterboxd ratings votes will find it's way into OMDB cause the API is out now and Letterboxd is getting from day to day more popular.
I really like letterboxd, I hope it is added soon...