Kodi Community Forum

Full Version: fanart.tv API v3
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, any devs using the fanart.tv API could you please update to the v3 version docs are here: http://docs.fanarttv.apiary.io/

In general if you are just using the standard JSON feed it wont be a big change, the only real difference is that the name is no longer the property which should make it a lot easier to use the data.

For those interested, I set up an SSD server just to test the differences between the 2 APIs using ab settings of ab -k -n 8000 -c 100

So thats 100 concurrent requests running 8000 times which gave the following results:

Old API:
Time taken for tests: 52.556 seconds
Requests per second: 152.22 [#/sec] (mean)
Load: Over 20 and rising while the test was running

New API:
Time taken for tests: 6.260 seconds
Requests per second: 1278.01 [#/sec] (mean)
Load: No appreciable increase

Obviously real world usage is different as thats just hitting a single URL but it's still a useful comparison

Any questions please let me know.
https://github.com/RuudBurger/CouchPotat...bea8b12b0e this commit might help you understand the changes that need to be made.

ignore
- image_url = image.get('url')
+ image_url = image.get('url') or image.get('href')

as "href" was a mistake that has been corrected, but as you can see the data is now immediately usable without having to build a construct

name, resource = fanart_data.items()[0]
log.debug('Found images for %s', name)
images = self._parseMovie(resource)

becomes

log.debug('Found images for %s', fanart_data.get('name'))
images = self._parseMovie(fanart_data)