功能:细节修改
- 一言字数 - web 模式缓存
This commit is contained in:
parent
c9ef0ccca3
commit
69f883f0a5
@ -1,9 +1,12 @@
|
|||||||
|
from functools import lru_cache
|
||||||
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
import models
|
import models
|
||||||
import scraper
|
import scraper
|
||||||
|
|
||||||
|
|
||||||
|
@lru_cache(maxsize=None)
|
||||||
class Generator:
|
class Generator:
|
||||||
|
|
||||||
def __init__(self, rss):
|
def __init__(self, rss):
|
||||||
|
@ -109,7 +109,7 @@ def get_yiyan():
|
|||||||
:return:一言
|
:return:一言
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
response = requests.get("https://v1.hitokoto.cn/?c=d&min_length=18&max_length=24&encode=text",
|
response = requests.get("https://v1.hitokoto.cn/?c=d&min_length=16&max_length=20&encode=text",
|
||||||
timeout=30) # Set timeout to 5 seconds
|
timeout=30) # Set timeout to 5 seconds
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
return response.text
|
return response.text
|
||||||
|
Loading…
Reference in New Issue
Block a user