Skip to content

Commit

Permalink
Merge c354414 into edf1771
Browse files Browse the repository at this point in the history
  • Loading branch information
easybe committed Oct 15, 2020
2 parents edf1771 + c354414 commit 474692b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tvdbapi_client/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""Provide API client for TVDB API v2.0 services."""
import json
import logging
import os
import tempfile

import cachecontrol
from cachecontrol import caches
Expand Down Expand Up @@ -103,9 +105,10 @@ def token_expired(self):
def session(self):
"""Provide access to request session with local cache enabled."""
if self._session is None:
cache_dir = os.path.join(tempfile.gettempdir(), 'tvdb_cache')
self._session = cachecontrol.CacheControl(
requests.Session(),
cache=caches.FileCache('.tvdb_cache'))
cache=caches.FileCache(cache_dir))
return self._session

@exceptions.error_map
Expand Down

0 comments on commit 474692b

Please sign in to comment.