Skip to content

Commit bf7cc6c

Browse files
authored
Merge pull request jxxghp#5497 from cddjr/bugfix/glitchtip_9684
2 parents 26b8be6 + 75cb8d2 commit bf7cc6c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/chain/torrents.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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)

app/helper/torrent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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
"""

0 commit comments

Comments
 (0)