mirror of
https://github.com/moparisthebest/SickRage
synced 2024-08-13 16:53:54 -04:00
05410e2aa0
Replaced urllib2 with requests for both TVDB and TVRage. Updated cache cleanup code to process both TVDB and TVRage cache folders.
11 lines
301 B
Python
11 lines
301 B
Python
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
|