@@ -92,7 +92,7 @@ def parser(self, title: str) -> Episode:
9292 if episode is None :
9393 episode = self .get_untrusted_episode ()
9494
95- if not self .episode_trusted :
95+ if not self .season_trusted :
9696 season , season_raw = self .get_untrusted_season ()
9797
9898
@@ -104,6 +104,7 @@ def parser(self, title: str) -> Episode:
104104 # 暂时没有哪个组把集数放前面
105105 if len (parts ) > 1 :
106106 temp_title = "[]" .join (parts [:- 1 ])
107+ print (temp_title )
107108 self .token = re .split (r"[\[\]]" , temp_title )
108109 (
109110 name_en ,
@@ -116,7 +117,7 @@ def parser(self, title: str) -> Episode:
116117 source = source_info [0 ] if source_info else ""
117118 sub = sub_language
118119 resolution = resolution_info [0 ] if resolution_info else ""
119- logger .debug (f"[meta parser] { self .raw_title } >> S{ season } E{ episode } { name_zh } /{ name_en } /{ name_jp } { sub } { sub_type } { group } { year } { resolution } { source } { audio_info } { video_info } " )
120+ # logger.debug(f"[meta parser] {self.raw_title} >> S{season}E{episode} {name_zh}/{name_en}/{name_jp} {sub} {sub_type} {group} {year} {resolution} {source} {audio_info} {video_info}")
120121
121122 return Episode (
122123 title_en = name_en ,
@@ -235,18 +236,21 @@ def get_untrusted_episode(self) -> int:
235236 def get_trusted_season (self ) -> tuple [int , str ]:
236237 """获取可信的季度信息"""
237238 season_info = self .findall_sub_title (p .SEASON_PATTERN_TRUEST , sym = "/[]" )
239+ print (f"trusted season info: { season_info } " )
238240 if not season_info :
239241 season_info = self .findall_sub_title (p .SEASON_PATTERN , sym = "/[]" )
240242
243+
241244 if season_info :
242245 self .season_trusted = True
243246 return self .parse_season (season_info , True )
244247 # return season_info[0][0], season
245- return 0 , ""
248+ return 1 , ""
246249
247250 def get_untrusted_season (self ) -> tuple [int , str ]:
248251 """获取不可信的季度信息"""
249252 season_info = re .findall (p .SEASON_PATTERN_UNTRUSTED , self .title )
253+ print (f"untrusted season info: { season_info } " )
250254 if season_info :
251255 return self .parse_season (season_info , False )
252256 return 1 , ""
@@ -290,6 +294,7 @@ def name_process(self) -> tuple[str, str, str]:
290294 self .token = [token .strip () for token in self .token [:max_len ] if len (token .strip ()) > 1 ]
291295
292296 self .token = self .token [:5 ]
297+ print (f"tokens: { self .token } " )
293298 token_priority = [len (s ) for s in self .token ]
294299 if len (self .token ) == 1 :
295300 anime_title = self .token [0 ]
@@ -307,10 +312,11 @@ def name_process(self) -> tuple[str, str, str]:
307312 token_priority [idx ] -= 90
308313 if re .search (r"[a-zA-Z]{3,}" , token ):
309314 token_priority [idx ] += 2
310- if re .search (r"[\u0800-\u4e00]{2,}" , token ):
311- token_priority [idx ] += 2
312- if re .search (r"[\u4e00-\u9fa5]{2,}" , token ):
313- token_priority [idx ] += 2
315+ if l := re .search (r"[\u0800-\u4e00]{2,}" , token ):
316+ token_priority [idx ] += len (l .group (0 ))* 2
317+ if l := re .search (r"[\u4e00-\u9fa5]{2,}" , token ):
318+ token_priority [idx ] += len (l .group (0 ))* 2
319+ print (token_priority )
314320 idx = token_priority .index (max (token_priority ))
315321 anime_title = self .token [idx ]
316322 anime_title = anime_title .strip ()
0 commit comments