@@ -146,25 +146,29 @@ class JmModuleConfig:
146146 REGISTRY_EXCEPTION_LISTENER = {}
147147
148148 # 执行log的函数
149- executor_log = default_jm_logging
149+ EXECUTOR_LOG = default_jm_logging
150150
151151 # 使用固定时间戳
152- flag_use_fix_timestamp = True
152+ FLAG_USE_FIX_TIMESTAMP = True
153153 # 移动端Client初始化cookies
154- flag_api_client_require_cookies = True
154+ FLAG_API_CLIENT_REQUIRE_COOKIES = True
155155 # log开关标记
156- flag_enable_jm_log = True
156+ FLAG_ENABLE_JM_LOG = True
157157 # log时解码url
158- flag_decode_url_when_logging = True
158+ FLAG_DECODE_URL_WHEN_LOGGING = True
159159 # 当内置的版本号落后时,使用最新的禁漫app版本号
160- flag_use_version_newer_if_behind = True
160+ FLAG_USE_VERSION_NEWER_IF_BEHIND = True
161161
162162 # 关联dir_rule的自定义字段与对应的处理函数
163163 # 例如:
164164 # Amyname -> JmModuleConfig.AFIELD_ADVICE['myname'] = lambda album: "自定义名称"
165165 AFIELD_ADVICE = dict ()
166166 PFIELD_ADVICE = dict ()
167167
168+ # 当发生 oserror: [Errno 36] File name too long 时,
169+ # 把文件名限制在指定个字符以内
170+ VAR_FILE_NAME_LENGTH_LIMIT = 100
171+
168172 @classmethod
169173 def downloader_class (cls ):
170174 if cls .CLASS_DOWNLOADER is not None :
@@ -319,12 +323,12 @@ def get_fix_ts_token_tokenparam(cls):
319323 # noinspection PyUnusedLocal
320324 @classmethod
321325 def jm_log (cls , topic : str , msg : str ):
322- if cls .flag_enable_jm_log is True :
323- cls .executor_log (topic , msg )
326+ if cls .FLAG_ENABLE_JM_LOG is True :
327+ cls .EXECUTOR_LOG (topic , msg )
324328
325329 @classmethod
326330 def disable_jm_log (cls ):
327- cls .flag_enable_jm_log = False
331+ cls .FLAG_ENABLE_JM_LOG = False
328332
329333 @classmethod
330334 def new_postman (cls , session = False , ** kwargs ):
@@ -347,7 +351,7 @@ def new_postman(cls, session=False, **kwargs):
347351 DEFAULT_CLIENT_CACHE = None # 默认关闭Client缓存。缓存的配置详见 CacheRegistry
348352 DEFAULT_PROXIES = ProxyBuilder .system_proxy () # 默认使用系统代理
349353
350- default_option_dict : dict = {
354+ DEFAULT_OPTION_DICT : dict = {
351355 'log' : None ,
352356 'dir_rule' : {'rule' : 'Bd_Pname' , 'base_dir' : None },
353357 'download' : {
@@ -364,7 +368,7 @@ def new_postman(cls, session=False, **kwargs):
364368 'postman' : {
365369 'type' : 'cffi' ,
366370 'meta_data' : {
367- 'impersonate' : 'chrome110 ' ,
371+ 'impersonate' : 'chrome ' ,
368372 'headers' : None ,
369373 'proxies' : None ,
370374 }
@@ -387,11 +391,11 @@ def option_default_dict(cls) -> dict:
387391 """
388392 from copy import deepcopy
389393
390- option_dict = deepcopy (cls .default_option_dict )
394+ option_dict = deepcopy (cls .DEFAULT_OPTION_DICT )
391395
392396 # log
393397 if option_dict ['log' ] is None :
394- option_dict ['log' ] = cls .flag_enable_jm_log
398+ option_dict ['log' ] = cls .FLAG_ENABLE_JM_LOG
395399
396400 # dir_rule.base_dir
397401 dir_rule = option_dict ['dir_rule' ]
0 commit comments