refactor(yuc_wiki):移除查询下季新番功能

This commit is contained in:
SlyAimer 2025-03-18 16:35:01 +08:00
parent 31e898676e
commit cb2fe25718

View file

@ -19,9 +19,6 @@ async def get_yuc_wiki(keyword):
if keyword == '本季新番': if keyword == '本季新番':
template_name = await generate_season_url() template_name = await generate_season_url()
response = requests.get(base_url + f'{template_name}') response = requests.get(base_url + f'{template_name}')
elif keyword == '下季新番':
template_name = await generate_next_season_url()
response = requests.get(base_url + f'{template_name}')
else: else:
template_name = 'forecast_anime' template_name = 'forecast_anime'
response = requests.get(new) response = requests.get(new)
@ -47,19 +44,6 @@ async def generate_season_url():
quarter_month = ((now.month - 1) // 3) * 3 + 1 quarter_month = ((now.month - 1) // 3) * 3 + 1
return f"{now.year}{quarter_month:02d}" return f"{now.year}{quarter_month:02d}"
async def generate_next_season_url():
"""
获取下季度
:return:
"""
now = datetime.now()
quarter_month = ((now.month - 1) // 3) * 3 + 1
current_quarter_start = datetime(now.year, quarter_month, 1)
next_quarter_start = current_quarter_start + timedelta(days=90)
next_quarter_month = ((next_quarter_start.month - 1) // 3) * 3 + 1
return f"{next_quarter_start.year}{next_quarter_month:02d}"
async def dispose_html(response): async def dispose_html(response):
""" """
处理html 处理html