File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -265,6 +265,9 @@ def __is_no_cache_site(_domain: str) -> bool:
265265 for torrent in torrents :
266266 if global_vars .is_system_stopped :
267267 break
268+ if not torrent .enclosure :
269+ logger .warn (f"缺少种子链接,忽略处理: { torrent .title } " )
270+ continue
268271 logger .info (f'处理资源:{ torrent .title } ...' )
269272 # 识别
270273 meta = MetaInfo (title = torrent .title , subtitle = torrent .description )
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class TorrentHelper:
2525 """
2626
2727 def __init__ (self ):
28- self ._invalid_torrents = TTLCache (maxsize = 128 , ttl = 3600 * 24 )
28+ self ._invalid_torrents = TTLCache (region = "invalid_torrents" , maxsize = 128 , ttl = 3600 * 24 )
2929
3030 def download_torrent (self , url : str ,
3131 cookie : Optional [str ] = None ,
@@ -340,11 +340,11 @@ def get_torrent_episodes(files: list) -> list:
340340 episodes = list (set (episodes ).union (set (meta .episode_list )))
341341 return episodes
342342
343- def is_invalid (self , url : str ) -> bool :
343+ def is_invalid (self , url : Optional [ str ] ) -> bool :
344344 """
345345 判断种子是否是无效种子
346346 """
347- return url in self ._invalid_torrents
347+ return url in self ._invalid_torrents if url else True
348348
349349 def add_invalid (self , url : str ):
350350 """
You can’t perform that action at this time.
0 commit comments