fix #1694
This commit is contained in:
@ -40,9 +40,7 @@ class SiteChain(ChainBase):
|
||||
self.rsshelper = RssHelper()
|
||||
self.cookiehelper = CookieHelper()
|
||||
self.message = MessageHelper()
|
||||
self.cookiecloud = CookieCloudHelper(
|
||||
settings=settings
|
||||
)
|
||||
self.cookiecloud = CookieCloudHelper()
|
||||
|
||||
# 特殊站点登录验证
|
||||
self.special_site_test = {
|
||||
|
@ -1,26 +1,22 @@
|
||||
import os
|
||||
import json
|
||||
|
||||
from typing import Any, Dict, Tuple, Optional
|
||||
import os
|
||||
from hashlib import md5
|
||||
from typing import Any, Dict, Tuple, Optional
|
||||
|
||||
from app.core.config import Settings, settings
|
||||
from app.core.config import settings
|
||||
from app.utils.common import decrypt
|
||||
from app.utils.http import RequestUtils
|
||||
from app.utils.string import StringUtils
|
||||
from app.utils.common import decrypt
|
||||
|
||||
|
||||
class CookieCloudHelper:
|
||||
|
||||
_ignore_cookies: list = ["CookieAutoDeleteBrowsingDataCleanup", "CookieAutoDeleteCleaningDiscarded"]
|
||||
|
||||
def __init__(self, settings: Settings):
|
||||
self._setting = settings
|
||||
def __init__(self):
|
||||
self._sync_setting()
|
||||
self._req = RequestUtils(content_type="application/json")
|
||||
|
||||
def _sync_setting(self):
|
||||
if self._setting:
|
||||
self._server = settings.COOKIECLOUD_HOST
|
||||
self._key = settings.COOKIECLOUD_KEY
|
||||
self._password = settings.COOKIECLOUD_PASSWORD
|
||||
@ -35,11 +31,11 @@ class CookieCloudHelper:
|
||||
# 更新为最新设置
|
||||
self._sync_setting()
|
||||
|
||||
if (not self._server and
|
||||
not self._enable_local) or not self._key or not self._password:
|
||||
if ((not self._server and not self._enable_local)
|
||||
or not self._key
|
||||
or not self._password):
|
||||
return None, "CookieCloud参数不正确"
|
||||
|
||||
result = None
|
||||
if self._enable_local:
|
||||
# 开启本地服务时,从本地直接读取数据
|
||||
result = self._load_local_encrypt_data(self._key)
|
||||
|
Reference in New Issue
Block a user