Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #558 #559

Merged
merged 2 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/plugins/ELF_RSS2/command/add_cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ async def handle_first_receive(matcher: Matcher, args: Message = CommandArg()) -

获取方式:
PC端 Chrome 浏览器按 F12
找到Console选项卡,输入:
document.cookie
找到 network 选项卡,
找到对应请求点开, 复制请求中完整的 cookie
输出的字符串就是了\
"""

Expand Down
3 changes: 2 additions & 1 deletion src/plugins/ELF_RSS2/rss_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ async def fetch_rss(rss: Rss) -> Tuple[Dict[str, Any], bool]:
proxy = get_proxy(rss.img_proxy) if URL(rss_url).host not in local_host else None
cookies = rss.cookies or None
headers = HEADERS.copy()
if cookies:
headers["cookie"] = cookies
d = {}
cached = False

Expand All @@ -165,7 +167,6 @@ async def fetch_rss(rss: Rss) -> Tuple[Dict[str, Any], bool]:
headers["If-Modified-Since"] = rss.last_modified

async with aiohttp.ClientSession(
cookies=cookies, # type: ignore
headers=headers,
raise_for_status=True,
timeout=aiohttp.ClientTimeout(10),
Expand Down