1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 04:02:32 +01:00

replace '24*3600' with '86400'

and generalize cache maxage values
This commit is contained in:
Mike Fährmann 2023-12-18 23:19:44 +01:00
parent 1f9b16a70b
commit 57fc6fcf83
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
24 changed files with 24 additions and 24 deletions

View File

@ -40,7 +40,7 @@ class AryionExtractor(Extractor):
if username:
self.cookies_update(self._login_impl(username, password))
@cache(maxage=14*24*3600, keyarg=1)
@cache(maxage=14*86400, keyarg=1)
def _login_impl(self, username, password):
self.log.info("Logging in as %s", username)

View File

@ -1579,7 +1579,7 @@ class DeviantartEclipseAPI():
return token
@cache(maxage=100*365*86400, keyarg=0)
@cache(maxage=36500*86400, keyarg=0)
def _refresh_token_cache(token):
if token and token[0] == "#":
return None

View File

@ -75,7 +75,7 @@ class ExhentaiExtractor(Extractor):
self.original = False
self.limits = False
@cache(maxage=90*24*3600, keyarg=1)
@cache(maxage=90*86400, keyarg=1)
def _login_impl(self, username, password):
self.log.info("Logging in as %s", username)

View File

@ -67,7 +67,7 @@ class IdolcomplexExtractor(SankakuExtractor):
self.logged_in = False
@cache(maxage=90*24*3600, keyarg=1)
@cache(maxage=90*86400, keyarg=1)
def _login_impl(self, username, password):
self.log.info("Logging in as %s", username)

View File

@ -64,7 +64,7 @@ class ImgbbExtractor(Extractor):
if username:
self.cookies_update(self._login_impl(username, password))
@cache(maxage=360*24*3600, keyarg=1)
@cache(maxage=365*86400, keyarg=1)
def _login_impl(self, username, password):
self.log.info("Logging in as %s", username)

View File

@ -360,7 +360,7 @@ class InkbunnyAPI():
params["page"] += 1
@cache(maxage=360*24*3600, keyarg=1)
@cache(maxage=365*86400, keyarg=1)
def _authenticate_impl(api, username, password):
api.extractor.log.info("Logging in as %s", username)

View File

@ -977,7 +977,7 @@ class InstagramGraphqlAPI():
variables["after"] = extr._update_cursor(info["end_cursor"])
@cache(maxage=90*24*3600, keyarg=1)
@cache(maxage=90*86400, keyarg=1)
def _login_impl(extr, username, password):
extr.log.error("Login with username & password is no longer supported. "
"Use browser cookies instead.")

View File

@ -129,7 +129,7 @@ class KemonopartyExtractor(Extractor):
self.cookies_update(self._login_impl(
(username, self.cookies_domain), password))
@cache(maxage=28*24*3600, keyarg=1)
@cache(maxage=28*86400, keyarg=1)
def _login_impl(self, username, password):
username = username[0]
self.log.info("Logging in as %s", username)

View File

@ -266,6 +266,6 @@ class MangadexAPI():
return
@cache(maxage=28*24*3600, keyarg=0)
@cache(maxage=28*86400, keyarg=0)
def _refresh_token_cache(username):
return None

View File

@ -277,6 +277,6 @@ class MastodonAPI():
params = None
@cache(maxage=100*365*24*3600, keyarg=0)
@cache(maxage=36500*86400, keyarg=0)
def _access_token_cache(instance):
return None

View File

@ -98,7 +98,7 @@ class NewgroundsExtractor(Extractor):
if username:
self.cookies_update(self._login_impl(username, password))
@cache(maxage=360*24*3600, keyarg=1)
@cache(maxage=365*86400, keyarg=1)
def _login_impl(self, username, password):
self.log.info("Logging in as %s", username)

View File

@ -126,7 +126,7 @@ class NijieExtractor(AsynchronousMixin, BaseExtractor):
username, password = self._get_auth_info()
self.cookies_update(self._login_impl(username, password))
@cache(maxage=90*24*3600, keyarg=1)
@cache(maxage=90*86400, keyarg=1)
def _login_impl(self, username, password):
if not username or not password:
raise exception.AuthenticationError(

View File

@ -376,7 +376,7 @@ class OAuthMastodon(OAuthBase):
cache=mastodon._access_token_cache,
)
@cache(maxage=10*365*24*3600, keyarg=1)
@cache(maxage=36500*86400, keyarg=1)
def _register(self, instance):
self.log.info("Registering application for '%s'", instance)

View File

@ -91,7 +91,7 @@ class PillowfortExtractor(Extractor):
if username:
self.cookies_update(self._login_impl(username, password))
@cache(maxage=14*24*3600, keyarg=1)
@cache(maxage=14*86400, keyarg=1)
def _login_impl(self, username, password):
self.log.info("Logging in as %s", username)

View File

@ -422,7 +422,7 @@ class PinterestAPI():
if username:
self.cookies.update(self._login_impl(username, password))
@cache(maxage=180*24*3600, keyarg=1)
@cache(maxage=180*86400, keyarg=1)
def _login_impl(self, username, password):
self.extractor.log.info("Logging in as %s", username)

View File

@ -996,6 +996,6 @@ class PixivAppAPI():
params = text.parse_query(query)
@cache(maxage=10*365*24*3600, keyarg=0)
@cache(maxage=36500*86400, keyarg=0)
def _refresh_token_cache(username):
return None

View File

@ -531,7 +531,7 @@ class RedditAPI():
return util.bdecode(sid, "0123456789abcdefghijklmnopqrstuvwxyz")
@cache(maxage=100*365*24*3600, keyarg=0)
@cache(maxage=36500*86400, keyarg=0)
def _refresh_token_cache(token):
if token and token[0] == "#":
return None

View File

@ -285,7 +285,7 @@ class SankakuAPI():
return
@cache(maxage=365*24*3600, keyarg=1)
@cache(maxage=365*86400, keyarg=1)
def _authenticate_impl(extr, username, password):
extr.log.info("Logging in as %s", username)

View File

@ -56,7 +56,7 @@ class SubscribestarExtractor(Extractor):
if username:
self.cookies_update(self._login_impl(username, password))
@cache(maxage=28*24*3600, keyarg=1)
@cache(maxage=28*86400, keyarg=1)
def _login_impl(self, username, password):
self.log.info("Logging in as %s", username)

View File

@ -81,7 +81,7 @@ class TapasExtractor(Extractor):
self.cookies.set(
"adjustedBirthDate", "1981-02-03", domain=self.cookies_domain)
@cache(maxage=14*24*3600, keyarg=1)
@cache(maxage=14*86400, keyarg=1)
def _login_impl(self, username, password):
self.log.info("Logging in as %s", username)

View File

@ -27,7 +27,7 @@ class TsuminoBase():
self.cookies.setdefault(
"ASP.NET_SessionId", "x1drgggilez4cpkttneukrc5")
@cache(maxage=14*24*3600, keyarg=1)
@cache(maxage=14*86400, keyarg=1)
def _login_impl(self, username, password):
self.log.info("Logging in as %s", username)
url = "{}/Account/Login".format(self.root)

View File

@ -1713,7 +1713,7 @@ class TwitterAPI():
}
@cache(maxage=360*86400, keyarg=1)
@cache(maxage=365*86400, keyarg=1)
def _login_impl(extr, username, password):
import re

View File

@ -45,7 +45,7 @@ class VipergirlsExtractor(Extractor):
if username:
self.cookies_update(self._login_impl(username, password))
@cache(maxage=90*24*3600, keyarg=1)
@cache(maxage=90*86400, keyarg=1)
def _login_impl(self, username, password):
self.log.info("Logging in as %s", username)

View File

@ -138,6 +138,6 @@ class OAuth1API():
return self.extractor.request(url, **kwargs)
@cache(maxage=100*365*24*3600, keyarg=0)
@cache(maxage=36500*86400, keyarg=0)
def _token_cache(key):
return None, None