Merge pull request #5497 from cddjr/bugfix/glitchtip_9684

This commit is contained in:
jxxghp
2026-02-13 17:09:04 +08:00
committed by GitHub
2 changed files with 6 additions and 3 deletions

View File

@@ -265,6 +265,9 @@ class TorrentsChain(ChainBase):
for torrent in torrents:
if global_vars.is_system_stopped:
break
if not torrent.enclosure:
logger.warn(f"缺少种子链接,忽略处理: {torrent.title}")
continue
logger.info(f'处理资源:{torrent.title} ...')
# 识别
meta = MetaInfo(title=torrent.title, subtitle=torrent.description)

View File

@@ -25,7 +25,7 @@ class TorrentHelper:
"""
def __init__(self):
self._invalid_torrents = TTLCache(maxsize=128, ttl=3600 * 24)
self._invalid_torrents = TTLCache(region="invalid_torrents", maxsize=128, ttl=3600 * 24)
def download_torrent(self, url: str,
cookie: Optional[str] = None,
@@ -340,11 +340,11 @@ class TorrentHelper:
episodes = list(set(episodes).union(set(meta.episode_list)))
return episodes
def is_invalid(self, url: str) -> bool:
def is_invalid(self, url: Optional[str]) -> bool:
"""
判断种子是否是无效种子
"""
return url in self._invalid_torrents
return url in self._invalid_torrents if url else True
def add_invalid(self, url: str):
"""