Skip to content

Commit

Permalink
Merge pull request #503 from ArjixWasTaken/patch-16
Browse files Browse the repository at this point in the history
added a cache system for SeleScrape and Improve SeleScrape generally
  • Loading branch information
ArjixWasTaken committed Aug 20, 2021
2 parents 7b6d9e7 + 4e184b3 commit 0fc9613
Show file tree
Hide file tree
Showing 2 changed files with 214 additions and 110 deletions.
5 changes: 5 additions & 0 deletions anime_downloader/sites/helpers/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def setup_func(url: str,
cf : bool
cf if True performs the request through cfscrape.
For cloudflare protected sites.
sel : bool
sel if True perfroms the request through selescrape (selenium).
referer : str
a url sent as referer in request headers
'''
Expand All @@ -57,6 +59,7 @@ def setup_func(url: str,
from selenium import webdriver
from anime_downloader.sites.helpers import selescrape
sess = selescrape
sess.cache = cache
except ImportError:
sess = cf_session
logger.warning("This provider may not work correctly because it requires selenium to work.\nIf you want to install it then run: 'pip install selenium' .")
Expand Down Expand Up @@ -107,6 +110,8 @@ def get(url: str,
cf : bool
cf if True performs the request through cfscrape.
For cloudflare protected sites.
sel : bool
sel if True perfroms the request through selescrape (selenium).
referer : str
a url sent as referer in request headers
'''
Expand Down

0 comments on commit 0fc9613

Please sign in to comment.