Add session and requests_cache to factory
@@ -35,5 +35,21 @@ def plex_server(self):
return get_plex_server()
+ @memoize
+ def session(self):
+ import requests
+ session = requests.Session()
+
+ return session
+
+ @memoize
+ def requests_cache(self):
+ import requests_cache
+ from plex_trakt_sync.path import trakt_cache
+
+ requests_cache.install_cache(trakt_cache)
+
+ return requests_cache
+
factory = Factory()
