This commit is contained in:
jxxghp
2023-06-11 09:25:30 +08:00
parent 8b8142ab60
commit 699fa3fa19
6 changed files with 37 additions and 10 deletions

View File

@ -116,11 +116,13 @@ class FilterModule(_ModuleBase):
if not torrent_episodes:
# 整季按匹配处理
return True
if len(torrent_episodes) == 1 \
and not set(torrent_seasons).intersection(set(season_episodes.get(torrent_seasons[0]))):
# 单季集没有交集的不要
logger.info(f"种子 {torrent.title}{torrent_episodes} 没有需要的集")
return False
if len(torrent_seasons) == 1:
need_episodes = season_episodes.get(torrent_seasons[0])
if need_episodes \
and not set(torrent_seasons).intersection(set(need_episodes)):
# 单季集没有交集的不要
logger.info(f"种子 {torrent.title}{torrent_episodes} 没有需要的集")
return False
return True
def __get_order(self, torrent: TorrentInfo, rule_str: str) -> Optional[TorrentInfo]:

View File

@ -1,3 +1,4 @@
import re
import threading
from pathlib import Path
from threading import Event
@ -9,6 +10,7 @@ from telebot.types import InputFile
from app.core.config import settings
from app.core.context import MediaInfo, Context
from app.core.metainfo import MetaInfo
from app.log import logger
from app.utils.http import RequestUtils
from app.utils.singleton import Singleton
@ -140,8 +142,12 @@ class Telegram(metaclass=Singleton):
for context in torrents:
torrent = context.torrent_info
site_name = torrent.site_name
meta = MetaInfo(torrent.title, torrent.description)
link = torrent.page_url
title = torrent.title
title = f"{meta.get_season_episode_string()} " \
f"{meta.get_resource_type_string()} " \
f"{meta.get_resource_team_string()}"
title = re.sub(r"\s+", " ", title).strip()
free = torrent.get_volume_factor_string()
seeder = f"{torrent.seeders}"
description = torrent.description

View File

@ -1,4 +1,5 @@
import json
import re
import threading
from datetime import datetime
from typing import Optional, List
@ -211,11 +212,13 @@ class WeChat(metaclass=Singleton):
for context in torrents:
torrent = context.torrent_info
meta = MetaInfo(title=torrent.title, subtitle=torrent.description)
torrent_title = f"{torrent.site_name}" \
torrent_title = f"{index}.{torrent.site_name}" \
f"{meta.get_season_episode_string()} " \
f"{meta.get_resource_type_string()} " \
f"{meta.get_resource_team_string()}" \
f"{torrent.get_volume_factor_string()} " \
f"{torrent.seeders}"
title = re.sub(r"\s+", " ", title).strip()
articles.append({
"title": torrent_title,
"description": torrent.description if index == 1 else '',