1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-13 12:55:05 -05:00
SickRage/lib/cachecontrol/wrapper.py

11 lines
301 B
Python
Raw Normal View History

from cachecontrol.adapter import CacheControlAdapter
from cachecontrol.cache import DictCache
def CacheControl(sess, cache=None, cache_etags=True):
cache = cache or DictCache()
adapter = CacheControlAdapter(cache, cache_etags=cache_etags)
sess.mount('http://', adapter)
return sess