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

12 lines
405 B
Python
Raw Normal View History

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