mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2026-05-10 18:57:56 +08:00
✨ 初步实现携带cookie请求
This commit is contained in:
@@ -9,6 +9,7 @@ from bs4 import BeautifulSoup as bs
|
||||
from ..post import Post
|
||||
from .platform import NewMessage
|
||||
from ..types import Target, RawPost
|
||||
from ..utils.site import create_cookie_client_manager
|
||||
from ..utils import Site, text_fletten, text_similarity
|
||||
|
||||
|
||||
@@ -16,6 +17,7 @@ class RssSite(Site):
|
||||
name = "rss"
|
||||
schedule_type = "interval"
|
||||
schedule_setting = {"seconds": 30}
|
||||
client_mgr = create_cookie_client_manager("rss")
|
||||
|
||||
|
||||
class RssPost(Post):
|
||||
@@ -63,7 +65,7 @@ class Rss(NewMessage):
|
||||
return post.id
|
||||
|
||||
async def get_sub_list(self, target: Target) -> list[RawPost]:
|
||||
client = await self.ctx.get_client()
|
||||
client = await self.ctx.get_client(target)
|
||||
res = await client.get(target, timeout=10.0)
|
||||
feed = feedparser.parse(res)
|
||||
entries = feed.entries
|
||||
|
||||
Reference in New Issue
Block a user