@@ -218,6 +218,29 @@ def decide_image_filepath(self, image: JmImageDetail) -> str:
218218 下面是创建对象相关方法
219219 """
220220
221+ @classmethod
222+ def default_dict (cls ) -> Dict :
223+ return JmModuleConfig .option_default_dict ()
224+
225+ @classmethod
226+ def default (cls , proxies = None , domain = None ) -> 'JmOption' :
227+ """
228+ 使用默认的 JmOption
229+ proxies, domain 为常用配置项,为了方便起见直接支持参数配置。
230+ 其他配置项建议还是使用配置文件
231+ @param proxies: clash; 127.0.0.1:7890; v2ray
232+ @param domain: 18comic.vip; ["18comic.vip"]
233+ """
234+ if proxies is not None or domain is not None :
235+ return cls .construct ({
236+ 'client' : {
237+ 'domain' : [domain ] if isinstance (domain , str ) else domain ,
238+ 'postman' : {'meta_data' : {'proxies' : ProxyBuilder .build_by_str (proxies )}},
239+ },
240+ })
241+
242+ return cls .construct ({})
243+
221244 @classmethod
222245 def construct (cls , dic : Dict , cover_default = True ) -> 'JmOption' :
223246 if cover_default :
@@ -286,7 +309,10 @@ def new_jm_client(self, domain_list=None, impl=None, **kwargs) -> JmcomicClient:
286309 postman = Postmans .create (data = postman_conf )
287310
288311 # domain_list
289- domain_list : List [str ] = domain_list or self .client .domain
312+ if domain_list is None :
313+ domain_list = self .client .domain
314+
315+ domain_list : List [str ]
290316 if len (domain_list ) == 0 :
291317 domain_list = [JmModuleConfig .domain ()]
292318
@@ -303,14 +329,6 @@ def new_jm_client(self, domain_list=None, impl=None, **kwargs) -> JmcomicClient:
303329
304330 return client
305331
306- @classmethod
307- def default_dict (cls ) -> Dict :
308- return JmModuleConfig .option_default_dict ()
309-
310- @classmethod
311- def default (cls ):
312- return cls .construct ({})
313-
314332 @classmethod
315333 def merge_default_dict (cls , user_dict , default_dict = None ):
316334 """
0 commit comments