enable requests-cache

This commit is contained in:
Chaz Larson 2022-10-14 16:49:17 -05:00
parent 853beb019f
commit 99fa53ecde
2 changed files with 10 additions and 0 deletions

View file

@ -3,6 +3,15 @@ from concurrent.futures import ProcessPoolExecutor
from datetime import datetime
from modules.logs import MyLogger
from requests_cache import install_cache
from datetime import datetime, timedelta
install_cache(
'config/http_cache',
expire_after=timedelta(days=1), # Otherwise expire responses after one day
allowable_methods=['GET', 'POST'], # Cache POST requests to avoid sending the same data twice
allowable_codes=[200],
match_headers=True,
)
try:
import plexapi, requests, schedule
from PIL import ImageFile

View file

@ -3,6 +3,7 @@ tmdbapis==1.0.6
arrapi==1.3.1
lxml==4.9.1
requests==2.28.1
requests-cache==0.9.6
ruamel.yaml==0.17.21
schedule==1.1.0
retrying==1.3.3