Skip to content

Commit

Permalink
precompute extractor config paths
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Sep 14, 2020
1 parent 231dd4c commit 055c32e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gallery_dl/extractor/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def __init__(self, match):
self._cookiefile = None
self._cookiejar = self.session.cookies
self._parentdir = ""

self._cfgpath = ("extractor", self.category, self.subcategory)
self._write_pages = self.config("write-pages", False)
self._retries = self.config("retries", 4)
self._timeout = self.config("timeout", 30)
Expand Down Expand Up @@ -69,12 +71,10 @@ def skip(self, num):
return 0

def config(self, key, default=None):
return config.interpolate(
("extractor", self.category, self.subcategory), key, default)
return config.interpolate(self._cfgpath, key, default)

def config_accumulate(self, key):
return config.accumulate(
("extractor", self.category, self.subcategory), key)
return config.accumulate(self._cfgpath, key)

def request(self, url, *, method="GET", session=None, retries=None,
encoding=None, fatal=True, notfound=None, **kwargs):
Expand Down

0 comments on commit 055c32e

Please sign in to comment.