Skip to content

Commit d927eaa

Browse files
authored
fix #558 (#559)
* Update rss_parsing.py * Update add_cookies.py
1 parent 151fe33 commit d927eaa

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/plugins/ELF_RSS2/command/add_cookies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ async def handle_first_receive(matcher: Matcher, args: Message = CommandArg()) -
3232
3333
获取方式:
3434
PC端 Chrome 浏览器按 F12
35-
找到Console选项卡,输入:
36-
document.cookie
35+
找到 network 选项卡,
36+
找到对应请求点开, 复制请求中完整的 cookie
3737
输出的字符串就是了\
3838
"""
3939

src/plugins/ELF_RSS2/rss_parsing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ async def fetch_rss(rss: Rss) -> Tuple[Dict[str, Any], bool]:
155155
proxy = get_proxy(rss.img_proxy) if URL(rss_url).host not in local_host else None
156156
cookies = rss.cookies or None
157157
headers = HEADERS.copy()
158+
if cookies:
159+
headers["cookie"] = cookies
158160
d = {}
159161
cached = False
160162

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

167169
async with aiohttp.ClientSession(
168-
cookies=cookies, # type: ignore
169170
headers=headers,
170171
raise_for_status=True,
171172
timeout=aiohttp.ClientTimeout(10),

0 commit comments

Comments
 (0)