2017-06-18, 21:52
https://github.com/reclosedev/requests-cache
packaged for kodi
if you use the requests package to communicate with web sites, requests-cache offers a transparent way to cache the replies from those sites without much change in your code.
Just import the requests-cache package, set-up the cache file and all requests response will be cached.
usage:
packaged for kodi
if you use the requests package to communicate with web sites, requests-cache offers a transparent way to cache the replies from those sites without much change in your code.
Just import the requests-cache package, set-up the cache file and all requests response will be cached.
usage:
Code:
import requests_cache
#define the cache file to reside in the ..\Kodi\userdata\addon_data\(your addon)
addonUserDataFolder = xbmc.translatePath(addon.getAddonInfo('profile'))
CACHE_FILE = xbmc.translatePath(os.path.join(addonUserDataFolder, 'requests_cache'))
#cache expires after: 86400=1 day 604800=7 days
requests_cache.install_cache(CACHE_FILE, backend='sqlite', expire_after=604800 )